1 7 8 package org.openejb.alt.config.ejb11; 9 10 14 import java.io.IOException ; 15 import java.io.Reader ; 16 import java.io.Serializable ; 17 import java.io.Writer ; 18 import java.util.Enumeration ; 19 import java.util.Vector ; 20 import org.exolab.castor.xml.MarshalException; 21 import org.exolab.castor.xml.Marshaller; 22 import org.exolab.castor.xml.Unmarshaller; 23 import org.exolab.castor.xml.ValidationException; 24 import org.xml.sax.ContentHandler ; 25 26 31 public class Entity implements java.io.Serializable { 32 33 34 38 41 private java.lang.String _id; 42 43 46 private java.lang.String _description; 47 48 51 private java.lang.String _displayName; 52 53 56 private java.lang.String _smallIcon; 57 58 61 private java.lang.String _largeIcon; 62 63 66 private java.lang.String _ejbName; 67 68 71 private java.lang.String _home; 72 73 76 private java.lang.String _remote; 77 78 81 private java.lang.String _localHome; 82 83 86 private java.lang.String _local; 87 88 91 private java.lang.String _ejbClass; 92 93 96 private java.lang.String _persistenceType; 97 98 101 private java.lang.String _primKeyClass; 102 103 106 private boolean _reentrant; 107 108 111 private boolean _has_reentrant; 112 113 116 private java.util.Vector _cmpFieldList; 117 118 121 private java.lang.String _primkeyField; 122 123 126 private java.util.Vector _envEntryList; 127 128 131 private java.util.Vector _ejbRefList; 132 133 136 private java.util.Vector _ejbLocalRefList; 137 138 141 private java.util.Vector _securityRoleRefList; 142 143 146 private java.util.Vector _resourceRefList; 147 148 149 153 public Entity() { 154 super(); 155 _cmpFieldList = new Vector (); 156 _envEntryList = new Vector (); 157 _ejbRefList = new Vector (); 158 _ejbLocalRefList = new Vector (); 159 _securityRoleRefList = new Vector (); 160 _resourceRefList = new Vector (); 161 } 163 164 168 173 public void addCmpField(org.openejb.alt.config.ejb11.CmpField vCmpField) 174 throws java.lang.IndexOutOfBoundsException 175 { 176 _cmpFieldList.addElement(vCmpField); 177 } 179 185 public void addCmpField(int index, org.openejb.alt.config.ejb11.CmpField vCmpField) 186 throws java.lang.IndexOutOfBoundsException 187 { 188 _cmpFieldList.insertElementAt(vCmpField, index); 189 } 191 198 public void addEjbLocalRef(org.openejb.alt.config.ejb11.EjbLocalRef vEjbLocalRef) 199 throws java.lang.IndexOutOfBoundsException 200 { 201 _ejbLocalRefList.addElement(vEjbLocalRef); 202 } 204 212 public void addEjbLocalRef(int index, org.openejb.alt.config.ejb11.EjbLocalRef vEjbLocalRef) 213 throws java.lang.IndexOutOfBoundsException 214 { 215 _ejbLocalRefList.insertElementAt(vEjbLocalRef, index); 216 } 218 223 public void addEjbRef(org.openejb.alt.config.ejb11.EjbRef vEjbRef) 224 throws java.lang.IndexOutOfBoundsException 225 { 226 _ejbRefList.addElement(vEjbRef); 227 } 229 235 public void addEjbRef(int index, org.openejb.alt.config.ejb11.EjbRef vEjbRef) 236 throws java.lang.IndexOutOfBoundsException 237 { 238 _ejbRefList.insertElementAt(vEjbRef, index); 239 } 241 246 public void addEnvEntry(org.openejb.alt.config.ejb11.EnvEntry vEnvEntry) 247 throws java.lang.IndexOutOfBoundsException 248 { 249 _envEntryList.addElement(vEnvEntry); 250 } 252 258 public void addEnvEntry(int index, org.openejb.alt.config.ejb11.EnvEntry vEnvEntry) 259 throws java.lang.IndexOutOfBoundsException 260 { 261 _envEntryList.insertElementAt(vEnvEntry, index); 262 } 264 269 public void addResourceRef(org.openejb.alt.config.ejb11.ResourceRef vResourceRef) 270 throws java.lang.IndexOutOfBoundsException 271 { 272 _resourceRefList.addElement(vResourceRef); 273 } 275 281 public void addResourceRef(int index, org.openejb.alt.config.ejb11.ResourceRef vResourceRef) 282 throws java.lang.IndexOutOfBoundsException 283 { 284 _resourceRefList.insertElementAt(vResourceRef, index); 285 } 287 292 public void addSecurityRoleRef(org.openejb.alt.config.ejb11.SecurityRoleRef vSecurityRoleRef) 293 throws java.lang.IndexOutOfBoundsException 294 { 295 _securityRoleRefList.addElement(vSecurityRoleRef); 296 } 298 304 public void addSecurityRoleRef(int index, org.openejb.alt.config.ejb11.SecurityRoleRef vSecurityRoleRef) 305 throws java.lang.IndexOutOfBoundsException 306 { 307 _securityRoleRefList.insertElementAt(vSecurityRoleRef, index); 308 } 310 313 public void deleteReentrant() 314 { 315 this._has_reentrant= false; 316 } 318 321 public java.util.Enumeration enumerateCmpField() 322 { 323 return _cmpFieldList.elements(); 324 } 326 333 public java.util.Enumeration enumerateEjbLocalRef() 334 { 335 return _ejbLocalRefList.elements(); 336 } 338 341 public java.util.Enumeration enumerateEjbRef() 342 { 343 return _ejbRefList.elements(); 344 } 346 349 public java.util.Enumeration enumerateEnvEntry() 350 { 351 return _envEntryList.elements(); 352 } 354 357 public java.util.Enumeration enumerateResourceRef() 358 { 359 return _resourceRefList.elements(); 360 } 362 365 public java.util.Enumeration enumerateSecurityRoleRef() 366 { 367 return _securityRoleRefList.elements(); 368 } 370 375 public org.openejb.alt.config.ejb11.CmpField getCmpField(int index) 376 throws java.lang.IndexOutOfBoundsException 377 { 378 if ((index < 0) || (index > _cmpFieldList.size())) { 380 throw new IndexOutOfBoundsException (); 381 } 382 383 return (org.openejb.alt.config.ejb11.CmpField) _cmpFieldList.elementAt(index); 384 } 386 389 public org.openejb.alt.config.ejb11.CmpField[] getCmpField() 390 { 391 int size = _cmpFieldList.size(); 392 org.openejb.alt.config.ejb11.CmpField[] mArray = new org.openejb.alt.config.ejb11.CmpField[size]; 393 for (int index = 0; index < size; index++) { 394 mArray[index] = (org.openejb.alt.config.ejb11.CmpField) _cmpFieldList.elementAt(index); 395 } 396 return mArray; 397 } 399 402 public int getCmpFieldCount() 403 { 404 return _cmpFieldList.size(); 405 } 407 412 public java.lang.String getDescription() 413 { 414 return this._description; 415 } 417 422 public java.lang.String getDisplayName() 423 { 424 return this._displayName; 425 } 427 432 public java.lang.String getEjbClass() 433 { 434 return this._ejbClass; 435 } 437 445 public org.openejb.alt.config.ejb11.EjbLocalRef getEjbLocalRef(int index) 446 throws java.lang.IndexOutOfBoundsException 447 { 448 if ((index < 0) || (index > _ejbLocalRefList.size())) { 450 throw new IndexOutOfBoundsException (); 451 } 452 453 return (org.openejb.alt.config.ejb11.EjbLocalRef) _ejbLocalRefList.elementAt(index); 454 } 456 463 public org.openejb.alt.config.ejb11.EjbLocalRef[] getEjbLocalRef() 464 { 465 int size = _ejbLocalRefList.size(); 466 org.openejb.alt.config.ejb11.EjbLocalRef[] mArray = new org.openejb.alt.config.ejb11.EjbLocalRef[size]; 467 for (int index = 0; index < size; index++) { 468 mArray[index] = (org.openejb.alt.config.ejb11.EjbLocalRef) _ejbLocalRefList.elementAt(index); 469 } 470 return mArray; 471 } 473 480 public int getEjbLocalRefCount() 481 { 482 return _ejbLocalRefList.size(); 483 } 485 490 public java.lang.String getEjbName() 491 { 492 return this._ejbName; 493 } 495 500 public org.openejb.alt.config.ejb11.EjbRef getEjbRef(int index) 501 throws java.lang.IndexOutOfBoundsException 502 { 503 if ((index < 0) || (index > _ejbRefList.size())) { 505 throw new IndexOutOfBoundsException (); 506 } 507 508 return (org.openejb.alt.config.ejb11.EjbRef) _ejbRefList.elementAt(index); 509 } 511 514 public org.openejb.alt.config.ejb11.EjbRef[] getEjbRef() 515 { 516 int size = _ejbRefList.size(); 517 org.openejb.alt.config.ejb11.EjbRef[] mArray = new org.openejb.alt.config.ejb11.EjbRef[size]; 518 for (int index = 0; index < size; index++) { 519 mArray[index] = (org.openejb.alt.config.ejb11.EjbRef) _ejbRefList.elementAt(index); 520 } 521 return mArray; 522 } 524 527 public int getEjbRefCount() 528 { 529 return _ejbRefList.size(); 530 } 532 537 public org.openejb.alt.config.ejb11.EnvEntry getEnvEntry(int index) 538 throws java.lang.IndexOutOfBoundsException 539 { 540 if ((index < 0) || (index > _envEntryList.size())) { 542 throw new IndexOutOfBoundsException (); 543 } 544 545 return (org.openejb.alt.config.ejb11.EnvEntry) _envEntryList.elementAt(index); 546 } 548 551 public org.openejb.alt.config.ejb11.EnvEntry[] getEnvEntry() 552 { 553 int size = _envEntryList.size(); 554 org.openejb.alt.config.ejb11.EnvEntry[] mArray = new org.openejb.alt.config.ejb11.EnvEntry[size]; 555 for (int index = 0; index < size; index++) { 556 mArray[index] = (org.openejb.alt.config.ejb11.EnvEntry) _envEntryList.elementAt(index); 557 } 558 return mArray; 559 } 561 564 public int getEnvEntryCount() 565 { 566 return _envEntryList.size(); 567 } 569 574 public java.lang.String getHome() 575 { 576 return this._home; 577 } 579 584 public java.lang.String getId() 585 { 586 return this._id; 587 } 589 594 public java.lang.String getLargeIcon() 595 { 596 return this._largeIcon; 597 } 599 605 public java.lang.String getLocal() 606 { 607 return this._local; 608 } 610 616 public java.lang.String getLocalHome() 617 { 618 return this._localHome; 619 } 621 626 public java.lang.String getPersistenceType() 627 { 628 return this._persistenceType; 629 } 631 636 public java.lang.String getPrimKeyClass() 637 { 638 return this._primKeyClass; 639 } 641 646 public java.lang.String getPrimkeyField() 647 { 648 return this._primkeyField; 649 } 651 656 public boolean getReentrant() 657 { 658 return this._reentrant; 659 } 661 666 public java.lang.String getRemote() 667 { 668 return this._remote; 669 } 671 676 public org.openejb.alt.config.ejb11.ResourceRef getResourceRef(int index) 677 throws java.lang.IndexOutOfBoundsException 678 { 679 if ((index < 0) || (index > _resourceRefList.size())) { 681 throw new IndexOutOfBoundsException (); 682 } 683 684 return (org.openejb.alt.config.ejb11.ResourceRef) _resourceRefList.elementAt(index); 685 } 687 690 public org.openejb.alt.config.ejb11.ResourceRef[] getResourceRef() 691 { 692 int size = _resourceRefList.size(); 693 org.openejb.alt.config.ejb11.ResourceRef[] mArray = new org.openejb.alt.config.ejb11.ResourceRef[size]; 694 for (int index = 0; index < size; index++) { 695 mArray[index] = (org.openejb.alt.config.ejb11.ResourceRef) _resourceRefList.elementAt(index); 696 } 697 return mArray; 698 } 700 703 public int getResourceRefCount() 704 { 705 return _resourceRefList.size(); 706 } 708 713 public org.openejb.alt.config.ejb11.SecurityRoleRef getSecurityRoleRef(int index) 714 throws java.lang.IndexOutOfBoundsException 715 { 716 if ((index < 0) || (index > _securityRoleRefList.size())) { 718 throw new IndexOutOfBoundsException (); 719 } 720 721 return (org.openejb.alt.config.ejb11.SecurityRoleRef) _securityRoleRefList.elementAt(index); 722 } 724 727 public org.openejb.alt.config.ejb11.SecurityRoleRef[] getSecurityRoleRef() 728 { 729 int size = _securityRoleRefList.size(); 730 org.openejb.alt.config.ejb11.SecurityRoleRef[] mArray = new org.openejb.alt.config.ejb11.SecurityRoleRef[size]; 731 for (int index = 0; index < size; index++) { 732 mArray[index] = (org.openejb.alt.config.ejb11.SecurityRoleRef) _securityRoleRefList.elementAt(index); 733 } 734 return mArray; 735 } 737 740 public int getSecurityRoleRefCount() 741 { 742 return _securityRoleRefList.size(); 743 } 745 750 public java.lang.String getSmallIcon() 751 { 752 return this._smallIcon; 753 } 755 758 public boolean hasReentrant() 759 { 760 return this._has_reentrant; 761 } 763 766 public boolean isValid() 767 { 768 try { 769 validate(); 770 } 771 catch (org.exolab.castor.xml.ValidationException vex) { 772 return false; 773 } 774 return true; 775 } 777 782 public void marshal(java.io.Writer out) 783 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 784 { 785 786 Marshaller.marshal(this, out); 787 } 789 794 public void marshal(org.xml.sax.ContentHandler handler) 795 throws java.io.IOException , org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 796 { 797 798 Marshaller.marshal(this, handler); 799 } 801 804 public void removeAllCmpField() 805 { 806 _cmpFieldList.removeAllElements(); 807 } 809 813 public void removeAllEjbLocalRef() 814 { 815 _ejbLocalRefList.removeAllElements(); 816 } 818 821 public void removeAllEjbRef() 822 { 823 _ejbRefList.removeAllElements(); 824 } 826 829 public void removeAllEnvEntry() 830 { 831 _envEntryList.removeAllElements(); 832 } 834 837 public void removeAllResourceRef() 838 { 839 _resourceRefList.removeAllElements(); 840 } 842 845 public void removeAllSecurityRoleRef() 846 { 847 _securityRoleRefList.removeAllElements(); 848 } 850 855 public org.openejb.alt.config.ejb11.CmpField removeCmpField(int index) 856 { 857 java.lang.Object obj = _cmpFieldList.elementAt(index); 858 _cmpFieldList.removeElementAt(index); 859 return (org.openejb.alt.config.ejb11.CmpField) obj; 860 } 862 870 public org.openejb.alt.config.ejb11.EjbLocalRef removeEjbLocalRef(int index) 871 { 872 java.lang.Object obj = _ejbLocalRefList.elementAt(index); 873 _ejbLocalRefList.removeElementAt(index); 874 return (org.openejb.alt.config.ejb11.EjbLocalRef) obj; 875 } 877 882 public org.openejb.alt.config.ejb11.EjbRef removeEjbRef(int index) 883 { 884 java.lang.Object obj = _ejbRefList.elementAt(index); 885 _ejbRefList.removeElementAt(index); 886 return (org.openejb.alt.config.ejb11.EjbRef) obj; 887 } 889 894 public org.openejb.alt.config.ejb11.EnvEntry removeEnvEntry(int index) 895 { 896 java.lang.Object obj = _envEntryList.elementAt(index); 897 _envEntryList.removeElementAt(index); 898 return (org.openejb.alt.config.ejb11.EnvEntry) obj; 899 } 901 906 public org.openejb.alt.config.ejb11.ResourceRef removeResourceRef(int index) 907 { 908 java.lang.Object obj = _resourceRefList.elementAt(index); 909 _resourceRefList.removeElementAt(index); 910 return (org.openejb.alt.config.ejb11.ResourceRef) obj; 911 } 913 918 public org.openejb.alt.config.ejb11.SecurityRoleRef removeSecurityRoleRef(int index) 919 { 920 java.lang.Object obj = _securityRoleRefList.elementAt(index); 921 _securityRoleRefList.removeElementAt(index); 922 return (org.openejb.alt.config.ejb11.SecurityRoleRef) obj; 923 } 925 931 public void setCmpField(int index, org.openejb.alt.config.ejb11.CmpField vCmpField) 932 throws java.lang.IndexOutOfBoundsException 933 { 934 if ((index < 0) || (index > _cmpFieldList.size())) { 936 throw new IndexOutOfBoundsException (); 937 } 938 _cmpFieldList.setElementAt(vCmpField, index); 939 } 941 946 public void setCmpField(org.openejb.alt.config.ejb11.CmpField[] cmpFieldArray) 947 { 948 _cmpFieldList.removeAllElements(); 950 for (int i = 0; i < cmpFieldArray.length; i++) { 951 _cmpFieldList.addElement(cmpFieldArray[i]); 952 } 953 } 955 960 public void setDescription(java.lang.String description) 961 { 962 this._description = description; 963 } 965 970 public void setDisplayName(java.lang.String displayName) 971 { 972 this._displayName = displayName; 973 } 975 980 public void setEjbClass(java.lang.String ejbClass) 981 { 982 this._ejbClass = ejbClass; 983 } 985 993 public void setEjbLocalRef(int index, org.openejb.alt.config.ejb11.EjbLocalRef vEjbLocalRef) 994 throws java.lang.IndexOutOfBoundsException 995 { 996 if ((index < 0) || (index > _ejbLocalRefList.size())) { 998 throw new IndexOutOfBoundsException (); 999 } 1000 _ejbLocalRefList.setElementAt(vEjbLocalRef, index); 1001 } 1003 1010 public void setEjbLocalRef(org.openejb.alt.config.ejb11.EjbLocalRef[] ejbLocalRefArray) 1011 { 1012 _ejbLocalRefList.removeAllElements(); 1014 for (int i = 0; i < ejbLocalRefArray.length; i++) { 1015 _ejbLocalRefList.addElement(ejbLocalRefArray[i]); 1016 } 1017 } 1019 1024 public void setEjbName(java.lang.String ejbName) 1025 { 1026 this._ejbName = ejbName; 1027 } 1029 1035 public void setEjbRef(int index, org.openejb.alt.config.ejb11.EjbRef vEjbRef) 1036 throws java.lang.IndexOutOfBoundsException 1037 { 1038 if ((index < 0) || (index > _ejbRefList.size())) { 1040 throw new IndexOutOfBoundsException (); 1041 } 1042 _ejbRefList.setElementAt(vEjbRef, index); 1043 } 1045 1050 public void setEjbRef(org.openejb.alt.config.ejb11.EjbRef[] ejbRefArray) 1051 { 1052 _ejbRefList.removeAllElements(); 1054 for (int i = 0; i < ejbRefArray.length; i++) { 1055 _ejbRefList.addElement(ejbRefArray[i]); 1056 } 1057 } 1059 1065 public void setEnvEntry(int index, org.openejb.alt.config.ejb11.EnvEntry vEnvEntry) 1066 throws java.lang.IndexOutOfBoundsException 1067 { 1068 if ((index < 0) || (index > _envEntryList.size())) { 1070 throw new IndexOutOfBoundsException (); 1071 } 1072 _envEntryList.setElementAt(vEnvEntry, index); 1073 } 1075 1080 public void setEnvEntry(org.openejb.alt.config.ejb11.EnvEntry[] envEntryArray) 1081 { 1082 _envEntryList.removeAllElements(); 1084 for (int i = 0; i < envEntryArray.length; i++) { 1085 _envEntryList.addElement(envEntryArray[i]); 1086 } 1087 } 1089 1094 public void setHome(java.lang.String home) 1095 { 1096 this._home = home; 1097 } 1099 1104 public void setId(java.lang.String id) 1105 { 1106 this._id = id; 1107 } 1109 1114 public void setLargeIcon(java.lang.String largeIcon) 1115 { 1116 this._largeIcon = largeIcon; 1117 } 1119 1124 public void setLocal(java.lang.String local) 1125 { 1126 this._local = local; 1127 } 1129 1134 public void setLocalHome(java.lang.String localHome) 1135 { 1136 this._localHome = localHome; 1137 } 1139 1144 public void setPersistenceType(java.lang.String persistenceType) 1145 { 1146 this._persistenceType = persistenceType; 1147 } 1149 1154 public void setPrimKeyClass(java.lang.String primKeyClass) 1155 { 1156 this._primKeyClass = primKeyClass; 1157 } 1159 1164 public void setPrimkeyField(java.lang.String primkeyField) 1165 { 1166 this._primkeyField = primkeyField; 1167 } 1169 1174 public void setReentrant(boolean reentrant) 1175 { 1176 this._reentrant = reentrant; 1177 this._has_reentrant = true; 1178 } 1180 1185 public void setRemote(java.lang.String remote) 1186 { 1187 this._remote = remote; 1188 } 1190 1196 public void setResourceRef(int index, org.openejb.alt.config.ejb11.ResourceRef vResourceRef) 1197 throws java.lang.IndexOutOfBoundsException 1198 { 1199 if ((index < 0) || (index > _resourceRefList.size())) { 1201 throw new IndexOutOfBoundsException (); 1202 } 1203 _resourceRefList.setElementAt(vResourceRef, index); 1204 } 1206 1211 public void setResourceRef(org.openejb.alt.config.ejb11.ResourceRef[] resourceRefArray) 1212 { 1213 _resourceRefList.removeAllElements(); 1215 for (int i = 0; i < resourceRefArray.length; i++) { 1216 _resourceRefList.addElement(resourceRefArray[i]); 1217 } 1218 } 1220 1226 public void setSecurityRoleRef(int index, org.openejb.alt.config.ejb11.SecurityRoleRef vSecurityRoleRef) 1227 throws java.lang.IndexOutOfBoundsException 1228 { 1229 if ((index < 0) || (index > _securityRoleRefList.size())) { 1231 throw new IndexOutOfBoundsException (); 1232 } 1233 _securityRoleRefList.setElementAt(vSecurityRoleRef, index); 1234 } 1236 1241 public void setSecurityRoleRef(org.openejb.alt.config.ejb11.SecurityRoleRef[] securityRoleRefArray) 1242 { 1243 _securityRoleRefList.removeAllElements(); 1245 for (int i = 0; i < securityRoleRefArray.length; i++) { 1246 _securityRoleRefList.addElement(securityRoleRefArray[i]); 1247 } 1248 } 1250 1255 public void setSmallIcon(java.lang.String smallIcon) 1256 { 1257 this._smallIcon = smallIcon; 1258 } 1260 1265 public static java.lang.Object unmarshal(java.io.Reader reader) 1266 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 1267 { 1268 return (org.openejb.alt.config.ejb11.Entity) Unmarshaller.unmarshal(org.openejb.alt.config.ejb11.Entity.class, reader); 1269 } 1271 1274 public void validate() 1275 throws org.exolab.castor.xml.ValidationException 1276 { 1277 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 1278 validator.validate(this); 1279 } 1281} 1282 | Popular Tags |