Public Member Functions | |
CollectionInfoJ2 (XSType contentType, String name, String elementName) | |
void | generateInitializerCode (JSourceCode jsc) |
void | createAccessMethods (JClass jClass) |
void | createAddMethod (JMethod method) |
void | createAddInsertMethod (JMethod method) |
void | createEnumerateMethod (JMethod method) |
void | createGetMethod (JMethod method) |
void | createGetByIndexMethod (JMethod method) |
void | createGetCollectionReferenceMethod (JMethod method) |
void | createSetArrayMethod (JMethod method) |
void | createSetByIndexMethod (JMethod method) |
void | createSetCollectionMethod (JMethod method) |
void | createSetCollectionReferenceMethod (JMethod method) |
void | createRemoveMethod (JMethod method) |
void | createRemoveByObjectMethod (JMethod method) |
void | createRemoveByIndexMethod (JMethod method) |
void | createRemoveAllMethod (JMethod method) |
void | createClearMethod (JMethod method) |
A helper used for generating source that deals with Java 2 Collections.
org.exolab.castor.builder.CollectionInfoJ2.CollectionInfoJ2 | ( | XSType | contentType, | |
String | name, | |||
String | elementName | |||
) |
contextType | the content type of the collection, ie. the type of objects that the collection will contain | |
name | the name of the Collection | |
elementName | the element name for each element in collection |
References org.exolab.castor.builder.XMLInfo.getSchemaType(), org.exolab.castor.builder.XMLInfo.setSchemaType(), and org.exolab.castor.builder.CollectionInfo.xsList.
void org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods | ( | JClass | jClass | ) |
Creates the Access methods for the collection described by this CollectionInfo
jClass | the JClass to add the methods to. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JMethod.addException(), org.exolab.javasource.JClass.addMethod(), org.exolab.javasource.JMethod.addParameter(), org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddMethod(), org.exolab.javasource.JType.createArray(), org.exolab.castor.builder.CollectionInfoJ2.createClearMethod(), org.exolab.castor.builder.CollectionInfoJ2.createEnumerateMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createGetCountMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.extraMethods(), org.exolab.castor.builder.CollectionInfo.getContentName(), org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.castor.builder.CollectionInfo.getElementName(), org.exolab.castor.builder.types.XSType.getJType(), org.exolab.castor.builder.CollectionInfo.getReferenceMethodSuffix(), and org.exolab.javasource.JParameter.getType().
void org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod | ( | JMethod | method | ) |
Creates implementation of add method with index.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfo.getContentName(), org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.castor.builder.types.XSList.getMaximumSize(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getSourceCode(), org.exolab.castor.builder.CollectionInfo.getXSList(), org.exolab.javasource.JSourceCode.indent(), org.exolab.castor.builder.FieldInfo.isBound(), and org.exolab.javasource.JSourceCode.unindent().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createAddMethod | ( | JMethod | method | ) |
Creates implementation of add method.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfo.getContentName(), org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.castor.builder.types.XSList.getMaximumSize(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getSourceCode(), org.exolab.castor.builder.CollectionInfo.getXSList(), org.exolab.javasource.JSourceCode.indent(), org.exolab.castor.builder.FieldInfo.isBound(), and org.exolab.javasource.JSourceCode.unindent().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createClearMethod | ( | JMethod | method | ) |
Creates implementation of clear() method.
method | the JMethod in which to create the source code. |
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getSourceCode(), and org.exolab.castor.builder.FieldInfo.isBound().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createEnumerateMethod | ( | JMethod | method | ) |
Creates implementation of Enumerate method.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.FieldInfo.getName(), and org.exolab.javasource.JMethod.getSourceCode().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createGetByIndexMethod | ( | JMethod | method | ) |
Creates implementation of the get(index) method.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.types.XSType.CLASS, org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getReturnType(), org.exolab.javasource.JMethod.getSourceCode(), org.exolab.javasource.JSourceCode.indent(), org.exolab.javasource.JType.toString(), and org.exolab.javasource.JSourceCode.unindent().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createGetCollectionReferenceMethod | ( | JMethod | method | ) |
Creates implementation of collection reference get method. This method simply returns the actual reference to the collection.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JDocComment.addDescriptor(), org.exolab.javasource.JSourceCode.append(), org.exolab.javasource.JDocComment.appendComment(), org.exolab.castor.builder.CollectionInfo.getElementName(), org.exolab.javasource.JMethod.getJDocComment(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getSourceCode(), and org.exolab.javasource.JDocDescriptor.setDescription().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createGetMethod | ( | JMethod | method | ) |
Creates implementation of object[] get() method.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.types.XSType.CLASS, org.exolab.javasource.JType.getComponentType(), org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.javasource.JType.getName(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getReturnType(), org.exolab.javasource.JMethod.getSourceCode(), org.exolab.javasource.JSourceCode.indent(), org.exolab.javasource.JType.isArray(), org.exolab.javasource.JType.toString(), and org.exolab.javasource.JSourceCode.unindent().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createRemoveAllMethod | ( | JMethod | method | ) |
Creates implementation of removeAll() method.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getSourceCode(), and org.exolab.castor.builder.FieldInfo.isBound().
void org.exolab.castor.builder.CollectionInfoJ2.createRemoveByIndexMethod | ( | JMethod | method | ) |
Creates implementation of remove(int i) method.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.types.XSType.CLASS, org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.javasource.JType.getName(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getReturnType(), org.exolab.javasource.JMethod.getSourceCode(), and org.exolab.castor.builder.FieldInfo.isBound().
void org.exolab.castor.builder.CollectionInfoJ2.createRemoveByObjectMethod | ( | JMethod | method | ) |
Creates implementation of remove(Object) method.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfo.getContentName(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getSourceCode(), and org.exolab.castor.builder.FieldInfo.isBound().
void org.exolab.castor.builder.CollectionInfoJ2.createRemoveMethod | ( | JMethod | method | ) |
Creates implementation of remove(Object) method.
method | the JMethod in which to create the source code. |
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfo.getContentName(), org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getSourceCode(), and org.exolab.castor.builder.FieldInfo.isBound().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod | ( | JMethod | method | ) |
Creates implementation of array set method
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JParameter.getName(), org.exolab.javasource.JMethod.getParameter(), org.exolab.javasource.JMethod.getSourceCode(), org.exolab.javasource.JSourceCode.indent(), org.exolab.castor.builder.FieldInfo.isBound(), and org.exolab.javasource.JSourceCode.unindent().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod | ( | JMethod | method | ) |
Creates implementation of set method.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfo.getContentName(), org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.castor.builder.types.XSList.getMaximumSize(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JMethod.getSourceCode(), org.exolab.castor.builder.CollectionInfo.getXSList(), org.exolab.javasource.JSourceCode.indent(), org.exolab.castor.builder.FieldInfo.isBound(), and org.exolab.javasource.JSourceCode.unindent().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod | ( | JMethod | method | ) |
Creates implementation of collection set method. The method will assign the field a copy of the given collection. The fields will be checked for type safety.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.javasource.JDocComment.appendComment(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfo.getContentType(), org.exolab.castor.builder.CollectionInfo.getElementName(), org.exolab.javasource.JMethod.getJDocComment(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JParameter.getName(), org.exolab.javasource.JDocComment.getParamDescriptor(), org.exolab.javasource.JMethod.getParameter(), org.exolab.javasource.JMethod.getSourceCode(), org.exolab.javasource.JSourceCode.indent(), org.exolab.castor.builder.FieldInfo.isBound(), org.exolab.javasource.JDocDescriptor.setDescription(), and org.exolab.javasource.JSourceCode.unindent().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionReferenceMethod | ( | JMethod | method | ) |
Creates implementation of collection reference set method. This method is a non-type safe method which simply assigns the given collection to the field.
method | the JMethod in which to create the source code. |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), org.exolab.javasource.JDocComment.appendComment(), org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode(), org.exolab.castor.builder.CollectionInfo.getElementName(), org.exolab.javasource.JMethod.getJDocComment(), org.exolab.castor.builder.FieldInfo.getName(), org.exolab.javasource.JParameter.getName(), org.exolab.javasource.JDocComment.getParamDescriptor(), org.exolab.javasource.JMethod.getParameter(), org.exolab.javasource.JMethod.getSourceCode(), org.exolab.castor.builder.FieldInfo.isBound(), and org.exolab.javasource.JDocDescriptor.setDescription().
Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().
void org.exolab.castor.builder.CollectionInfoJ2.generateInitializerCode | ( | JSourceCode | jsc | ) |
Creates code for initialization of this Member
jsc | the JSourceCode in which to add the source to |
Reimplemented from org.exolab.castor.builder.CollectionInfo.
References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), and org.exolab.castor.builder.FieldInfo.getName().