org.exolab.castor.builder

Class CollectionInfoJ2

public class CollectionInfoJ2 extends CollectionInfo

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

Version: $Revision: 1.1.1.1 $ $Date: 2003/03/03 07:07:42 $

Author: Assaf Arkin

Constructor Summary
CollectionInfoJ2(XSType contentType, String name, String elementName)
Method Summary
voidcreateAccessMethods(JClass jClass)
Creates the Access methods for the collection described by this CollectionInfo
voidcreateAddInsertMethod(JMethod method)
Creates implementation of add method with index.
voidcreateAddMethod(JMethod method)
Creates implementation of add method.
voidcreateClearMethod(JMethod method)
Creates implementation of clear() method.
voidcreateEnumerateMethod(JMethod method)
Creates implementation of Enumerate method.
voidcreateGetByIndexMethod(JMethod method)
Creates implementation of the get(index) method.
voidcreateGetCollectionReferenceMethod(JMethod method)
Creates implementation of collection reference get method.
voidcreateGetMethod(JMethod method)
Creates implementation of object[] get() method.
voidcreateRemoveAllMethod(JMethod method)
Creates implementation of removeAll() method.
voidcreateRemoveByIndexMethod(JMethod method)
Creates implementation of remove(int i) method.
voidcreateRemoveByObjectMethod(JMethod method)
Creates implementation of remove(Object) method.
voidcreateRemoveMethod(JMethod method)
Creates implementation of remove(Object) method.
voidcreateSetArrayMethod(JMethod method)
Creates implementation of array set method
voidcreateSetByIndexMethod(JMethod method)
Creates implementation of set method.
voidcreateSetCollectionMethod(JMethod method)
Creates implementation of collection set method.
voidcreateSetCollectionReferenceMethod(JMethod method)
Creates implementation of collection reference set method.
voidgenerateInitializerCode(JSourceCode jsc)
Creates code for initialization of this Member

Constructor Detail

CollectionInfoJ2

public CollectionInfoJ2(XSType contentType, String name, String elementName)

Parameters: 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

Method Detail

createAccessMethods

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

Parameters: jClass the JClass to add the methods to.

createAddInsertMethod

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

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

createAddMethod

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

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.

createEnumerateMethod

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

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

createGetByIndexMethod

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

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.

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

createGetMethod

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

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

createRemoveAllMethod

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

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

createRemoveByIndexMethod

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

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

createRemoveByObjectMethod

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

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.

createSetArrayMethod

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

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

createSetByIndexMethod

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

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.

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.

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

generateInitializerCode

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

Parameters: jsc the JSourceCode in which to add the source to

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