|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.exolab.castor.builder.XMLInfo
org.exolab.castor.builder.FieldInfo
org.exolab.castor.builder.CollectionInfo
public class CollectionInfo
A helper used for generating source that deals with Collections
| Field Summary | |
|---|---|
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 |
protected XSList |
xsList
|
| Fields inherited from class org.exolab.castor.builder.FieldInfo |
|---|
READ_METHOD, READ_WRITE_METHODS, WRITE_METHOD |
| Fields inherited from class org.exolab.castor.builder.XMLInfo |
|---|
ATTRIBUTE_TYPE, ELEMENT_TYPE, TEXT_TYPE |
| Constructor Summary | |
|---|---|
CollectionInfo(XSType contentType,
java.lang.String name,
java.lang.String elementName)
Creates a new CollectionInfo |
|
| Method Summary | |
|---|---|
void |
createAccessMethods(JClass jClass)
Creates the Access methods for the collection described by this CollectionInfo |
void |
createAddInsertMethod(JMethod method)
Creates implementation of add method with an index. |
void |
createAddMethod(JMethod method)
Creates implementation of add method. |
protected void |
createBoundPropertyCode(JSourceCode jsc)
Creates the necessary source code for notifying PropertyChangeListeners when the collection has been updated. |
void |
createEnumerateMethod(JMethod method)
Creates implementation of Enumerate method. |
void |
createGetByIndexMethod(JMethod method)
Creates implementation of the get(index) method. |
void |
createGetCollectionReferenceMethod(JMethod method)
Creates implementation of collection reference get method. |
void |
createGetCountMethod(JMethod method)
Creates implementation of getCount method. |
void |
createGetMethod(JMethod method)
Creates implementation of object[] get() method. |
void |
createRemoveAllMethod(JMethod method)
Creates implementation of removeAll() method. |
void |
createRemoveByIndexMethod(JMethod method)
Creates implementation of remove(int i) method. |
void |
createRemoveByObjectMethod(JMethod method)
Creates implementation of remove(Object) method. |
void |
createSetArrayMethod(JMethod method)
Creates implementation of array set method |
void |
createSetByIndexMethod(JMethod method)
Creates implementation of set method. |
void |
createSetCollectionMethod(JMethod method)
Creates implementation of collection set method. |
void |
createSetCollectionReferenceMethod(JMethod method)
Creates implementation of collection reference set method. |
protected boolean |
extraMethods()
Returns true if extra collection methods should be generated. |
void |
generateInitializerCode(JSourceCode jsc)
Creates code for initialization of this Member |
FieldInfo |
getContent()
|
java.lang.String |
getContentName()
|
XSType |
getContentType()
|
java.lang.String |
getElementName()
|
JMethod |
getReadMethod()
Returns the main read method for this member |
java.lang.String |
getReadMethodName()
Returns the name of the read method for this FieldInfo |
protected java.lang.String |
getReferenceMethodSuffix()
Returns the suffix (ending) that should be used when creating the extra collection methods |
java.lang.String |
getWriteMethodName()
Returns the name of the write method for this FieldInfo |
XSList |
getXSList()
|
boolean |
isMultivalued()
Return whether or not this member is a multivalued member or not |
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. |
| Methods inherited from class org.exolab.castor.builder.XMLInfo |
|---|
getNamespacePrefix, getNamespaceURI, getNodeName, getNodeType, getNodeTypeName, getSchemaType, isRequired, setMultivalued, setNamespacePrefix, setNamespaceURI, setNodeName, setNodeType, setRequired, setSchemaType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String REFERENCE_SUFFIX_PROPERTY
public static final java.lang.String DEFAULT_REFERENCE_SUFFIX
protected XSList xsList
| Constructor Detail |
|---|
public CollectionInfo(XSType contentType,
java.lang.String name,
java.lang.String elementName)
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 collection| Method Detail |
|---|
public void generateInitializerCode(JSourceCode jsc)
generateInitializerCode in class FieldInfojsc - the JSourceCode in which to add the source topublic java.lang.String getReadMethodName()
FieldInfo
getReadMethodName in class FieldInfopublic java.lang.String getWriteMethodName()
FieldInfo
getWriteMethodName in class FieldInfopublic void createAccessMethods(JClass jClass)
createAccessMethods in class FieldInfojClass - the JClass to add the methods to.FieldInfo.createGetterMethod(org.exolab.javasource.JClass),
FieldInfo.createSetterMethod(org.exolab.javasource.JClass),
FieldInfo.createHasAndDeleteMethods(org.exolab.javasource.JClass)public JMethod getReadMethod()
public XSList getXSList()
public java.lang.String getContentName()
public XSType getContentType()
public FieldInfo getContent()
public java.lang.String getElementName()
public boolean isMultivalued()
isMultivalued in class XMLInfopublic void createAddMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createAddInsertMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createGetMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createGetCollectionReferenceMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createGetByIndexMethod(JMethod method)
public void createSetArrayMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createSetByIndexMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createSetCollectionMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createSetCollectionReferenceMethod(JMethod method)
method - the JMethod in which to create the source
code.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 createBoundPropertyCode(JSourceCode jsc)
jsc - the JSourceCode to add the new source code to.public void createGetCountMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createEnumerateMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createRemoveByObjectMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createRemoveByIndexMethod(JMethod method)
method - the JMethod in which to create the source
code.public void createRemoveAllMethod(JMethod method)
method - the JMethod in which to create the source
code.protected final boolean extraMethods()
protected final java.lang.String getReferenceMethodSuffix()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||