public class CollectionInfo extends FieldInfo
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_REFERENCE_SUFFIX |
static java.lang.String |
REFERENCE_SUFFIX_PROPERTY
The property used to overwrite the reference suffix for extra collection
methods
|
READ_METHOD, READ_WRITE_METHODS, WRITE_METHODATTRIBUTE_TYPE, CHOICE_NODE_NAME_ERROR_INDICATION, ELEMENT_TYPE, TEXT_TYPE| Constructor and Description |
|---|
CollectionInfo(XSType contentType,
java.lang.String name,
java.lang.String elementName,
boolean useJava50)
Creates a new CollectionInfo
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addMaxSizeCheck(java.lang.String methodName,
JSourceCode sourceCode) |
void |
createAccessMethods(JClass jClass,
boolean useJava50)
Generate the various accessor methods.
|
protected void |
createAddAndRemoveMethods(JClass jClass) |
protected void |
createAddMethod(JClass jClass) |
protected void |
createBoundPropertyCode(JSourceCode sourceCode)
Creates the necessary source code for notifying PropertyChangeListeners
when the collection has been updated.
|
protected void |
createCollectionIterationMethods(JClass jClass,
boolean useJava50)
Generate methods for iterating over the objects in the collection.
|
protected void |
createEnumerateMethod(JClass jClass,
boolean useJava50) |
protected boolean |
createExtraMethods()
Returns true if extra collection methods should be generated.
|
protected void |
createGetAndSetMethods(JClass jClass,
boolean useJava50) |
protected void |
createGetAsArrayMethod(JClass jClass,
boolean useJava50) |
protected void |
createGetAsReferenceMethod(JClass jClass) |
protected void |
createGetByIndexMethod(JClass jClass) |
protected void |
createGetCountMethod(JClass jClass) |
protected void |
createInsertMethod(JClass jClass) |
protected void |
createIteratorMethod(JClass jClass,
boolean useJava50) |
protected void |
createRemoveAllMethod(JClass jClass)
Creates implementation of removeAll() method.
|
protected void |
createRemoveByIndexMethod(JClass jClass)
Creates implementation of remove(int i) method.
|
protected void |
createRemoveObjectMethod(JClass jClass)
Creates implementation of remove(Object) method.
|
protected void |
createSetAsArrayMethod(JClass jClass,
boolean useJava50) |
protected void |
createSetAsCopyMethod(JClass jClass)
Creates implementation of collection set method.
|
protected void |
createSetAsReferenceMethod(JClass jClass,
boolean useJava50)
Creates implementation of collection reference set method.
|
protected void |
createSetByIndexMethod(JClass jClass) |
void |
generateInitializerCode(JSourceCode sourceCode)
Creates code for initialization of this Member.
|
FieldInfo |
getContent() |
java.lang.String |
getContentName() |
XSType |
getContentType() |
java.lang.String |
getElementName() |
protected java.lang.String |
getMethodSuffix()
Returns the method suffix for creating method names.
|
protected java.lang.String |
getReferenceMethodSuffix()
Returns the suffix (ending) that should be used when creating the extra
collection methods.
|
XSList |
getXSList() |
boolean |
isMultivalued()
Return whether or not the object described by this XMLInfo is
multi-valued (appears more than once in the XML document).
|
void |
setCreateExtraMethods(boolean extraMethods)
Sets whether or not to create extra collection methods for accessing the
actual collection.
|
void |
setReferenceMethodSuffix(java.lang.String suffix)
Sets the method suffix (ending) to use when creating the extra collection
methods.
|
createGetterComment, createGetterMethod, createHasAndDeleteMethods, createJavaField, createSetterComment, createSetterMethod, getComment, getDeclaringClassInfo, getDefaultValue, getDeleteMethodName, getFixedValue, getHasMethodName, getMethods, getName, getReadMethodName, getValidator, getWriteMethodName, getXMLFieldHandler, isBound, isContainer, isHasAndDeleteMethods, isNillable, isTransient, setBound, setComment, setContainer, setDeclaringClassInfo, setDefaultValue, setFieldInfoReference, setFinal, setFixedValue, setMethods, setNillable, setStatic, setTransient, setValidator, setXMLFieldHandlergetNamespacePrefix, getNamespaceURI, getNodeName, getNodeType, getNodeTypeName, getSchemaType, isElementDefinition, isRequired, setElementDefinition, setMultivalued, setNamespacePrefix, setNamespaceURI, setNodeName, setNodeType, setRequired, setSchemaTypepublic static final java.lang.String DEFAULT_REFERENCE_SUFFIX
public static final java.lang.String REFERENCE_SUFFIX_PROPERTY
public CollectionInfo(XSType contentType, java.lang.String name, java.lang.String elementName, boolean useJava50)
contentType - the _content type of the collection, ie. the type of objects
that the collection will containname - the name of the CollectionelementName - the element name for each element in collectionuseJava50 - true if source code is supposed to be generated for Java 5public void createAccessMethods(JClass jClass, boolean useJava50)
createAccessMethods in class FieldInfojClass - the JClass to add the methods touseJava50 - true if source code is supposed to be generated for Java 5FieldInfo.createAccessMethods(org.exolab.javasource.JClass, boolean)public void generateInitializerCode(JSourceCode sourceCode)
generateInitializerCode in class FieldInfosourceCode - the JSourceCode in which to add the source toFieldInfo.generateInitializerCode(org.exolab.javasource.JSourceCode)public FieldInfo getContent()
public java.lang.String getContentName()
public XSType getContentType()
public java.lang.String getElementName()
public XSList getXSList()
public boolean isMultivalued()
isMultivalued in class XMLInfoXMLInfo.isMultivalued()public void setCreateExtraMethods(boolean extraMethods)
extraMethods - a boolean that when true indicates that extra collection
accessor methods should be created. False by default.setReferenceMethodSuffix(java.lang.String)public void setReferenceMethodSuffix(java.lang.String suffix)
suffix - the method suffix to use when creating the extra collection
methods. If null or emtpty the default value, as specified by
DEFAULT_REFERENCE_SUFFIX will used.setCreateExtraMethods(boolean)protected void addMaxSizeCheck(java.lang.String methodName,
JSourceCode sourceCode)
protected void createAddMethod(JClass jClass)
protected void createBoundPropertyCode(JSourceCode sourceCode)
sourceCode - the JSourceCode to add the new source code to.protected void createEnumerateMethod(JClass jClass, boolean useJava50)
protected final boolean createExtraMethods()
protected void createGetAsArrayMethod(JClass jClass, boolean useJava50)
protected void createGetAsReferenceMethod(JClass jClass)
protected void createGetByIndexMethod(JClass jClass)
protected void createAddAndRemoveMethods(JClass jClass)
jClass - protected void createGetAndSetMethods(JClass jClass, boolean useJava50)
jClass - the JClass to which we add this methoduseJava50 - true if source code is supposed to be generated for Java 5protected void createGetCountMethod(JClass jClass)
protected void createCollectionIterationMethods(JClass jClass, boolean useJava50)
jClass - the JClass to which we add this methoduseJava50 - true if source code is supposed to be generated for Java 5protected void createInsertMethod(JClass jClass)
protected void createIteratorMethod(JClass jClass, boolean useJava50)
protected void createRemoveAllMethod(JClass jClass)
jClass - the JClass to which we add this methodprotected void createRemoveByIndexMethod(JClass jClass)
jClass - the JClass to which we add this methodprotected void createRemoveObjectMethod(JClass jClass)
jClass - the JClass to which we add this methodprotected void createSetAsArrayMethod(JClass jClass, boolean useJava50)
protected void createSetAsCopyMethod(JClass jClass)
jClass - protected void createSetAsReferenceMethod(JClass jClass, boolean useJava50)
jClass - useJava50 - true if source code is supposed to be generated for Java 5protected void createSetByIndexMethod(JClass jClass)
protected java.lang.String getMethodSuffix()
getMethodSuffix in class FieldInfoFieldInfo.getMethodSuffix()protected final java.lang.String getReferenceMethodSuffix()
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com