org.exolab.castor.builder
Class CollectionInfoJ2

java.lang.Object
  extended by org.exolab.castor.builder.XMLInfo
      extended by org.exolab.castor.builder.FieldInfo
          extended by org.exolab.castor.builder.CollectionInfo
              extended by org.exolab.castor.builder.CollectionInfoJ2

public class CollectionInfoJ2
extends CollectionInfo

A helper used for generating source that deals with Java 2 Collections.

Version:
$Revision: 1.4 $ $Date: 2005/05/03 08:12:13 $
Author:
Assaf Arkin

Field Summary
 
Fields inherited from class org.exolab.castor.builder.CollectionInfo
DEFAULT_REFERENCE_SUFFIX, REFERENCE_SUFFIX_PROPERTY, 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
CollectionInfoJ2(XSType contentType, java.lang.String name, java.lang.String elementName)
           
 
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 index.
 void createAddMethod(JMethod method)
          Creates implementation of add method.
 void createClearMethod(JMethod method)
          Creates implementation of clear() method.
 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 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 createRemoveMethod(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.
 void generateInitializerCode(JSourceCode jsc)
          Creates code for initialization of this Member
 
Methods inherited from class org.exolab.castor.builder.CollectionInfo
createBoundPropertyCode, createGetCountMethod, extraMethods, getContent, getContentName, getContentType, getElementName, getReadMethod, getReadMethodName, getReferenceMethodSuffix, getWriteMethodName, getXSList, isMultivalued, setCreateExtraMethods, setReferenceMethodSuffix
 
Methods inherited from class org.exolab.castor.builder.FieldInfo
createGetterComment, createGetterMethod, createHasAndDeleteMethods, createJavaField, createSetterComment, createSetterMethod, getComment, getDeclaringClassInfo, getDefaultValue, getDeleteMethodName, getFixedValue, getHasMethodName, getMethods, getName, getValidator, getXMLFieldHandler, isBound, isContainer, isHasAndDeleteMethods, isNillable, isTransient, methodSuffix, setBound, setComment, setContainer, setDeclaringClassInfo, setDefaultValue, setFinal, setFixedValue, setMethods, setNillable, setReference, setStatic, setTransient, setValidator, setXMLFieldHandler
 
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
 

Constructor Detail

CollectionInfoJ2

public CollectionInfoJ2(XSType contentType,
                        java.lang.String name,
                        java.lang.String elementName)
Parameters:
contentType - 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
Method Detail

generateInitializerCode

public void generateInitializerCode(JSourceCode jsc)
Creates code for initialization of this Member

Overrides:
generateInitializerCode in class CollectionInfo
Parameters:
jsc - the JSourceCode in which to add the source to

createAccessMethods

public void createAccessMethods(JClass jClass)
Creates the Access methods for the collection described by this CollectionInfo

Overrides:
createAccessMethods in class CollectionInfo
Parameters:
jClass - the JClass to add the methods to.
See Also:
FieldInfo.createGetterMethod(org.exolab.javasource.JClass), FieldInfo.createSetterMethod(org.exolab.javasource.JClass), FieldInfo.createHasAndDeleteMethods(org.exolab.javasource.JClass)

createAddMethod

public void createAddMethod(JMethod method)
Creates implementation of add method.

Overrides:
createAddMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createAddInsertMethod

public void createAddInsertMethod(JMethod method)
Creates implementation of add method with index.

Overrides:
createAddInsertMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createEnumerateMethod

public void createEnumerateMethod(JMethod method)
Creates implementation of Enumerate method.

Overrides:
createEnumerateMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createGetMethod

public void createGetMethod(JMethod method)
Creates implementation of object[] get() method.

Overrides:
createGetMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createGetByIndexMethod

public void createGetByIndexMethod(JMethod method)
Creates implementation of the get(index) method.

Overrides:
createGetByIndexMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createGetCollectionReferenceMethod

public void createGetCollectionReferenceMethod(JMethod method)
Creates implementation of collection reference get method. This method simply returns the actual reference to the collection.

Overrides:
createGetCollectionReferenceMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createSetArrayMethod

public void createSetArrayMethod(JMethod method)
Creates implementation of array set method

Overrides:
createSetArrayMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createSetByIndexMethod

public void createSetByIndexMethod(JMethod method)
Creates implementation of set method.

Overrides:
createSetByIndexMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createSetCollectionMethod

public void 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.

Overrides:
createSetCollectionMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createSetCollectionReferenceMethod

public void 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.

Overrides:
createSetCollectionReferenceMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createRemoveMethod

public void createRemoveMethod(JMethod method)
Creates implementation of remove(Object) method.

Parameters:
method - the JMethod in which to create the source code.

createRemoveByObjectMethod

public void createRemoveByObjectMethod(JMethod method)
Creates implementation of remove(Object) method.

Overrides:
createRemoveByObjectMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createRemoveByIndexMethod

public void createRemoveByIndexMethod(JMethod method)
Creates implementation of remove(int i) method.

Overrides:
createRemoveByIndexMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createRemoveAllMethod

public void createRemoveAllMethod(JMethod method)
Creates implementation of removeAll() method.

Overrides:
createRemoveAllMethod in class CollectionInfo
Parameters:
method - the JMethod in which to create the source code.

createClearMethod

public void createClearMethod(JMethod method)
Creates implementation of clear() method.

Parameters:
method - the JMethod in which to create the source code.


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com