Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes

org.exolab.castor.builder.CollectionInfo Class Reference

Inheritance diagram for org.exolab.castor.builder.CollectionInfo:
org.exolab.castor.builder.FieldInfo org.exolab.castor.builder.XMLInfo org.exolab.castor.builder.CollectionInfoJ2 org.exolab.castor.builder.CollectionInfoODMG30

List of all members.

Public Member Functions

 CollectionInfo (XSType contentType, String name, String elementName)
void generateInitializerCode (JSourceCode jsc)
String getReadMethodName ()
String getWriteMethodName ()
void createAccessMethods (JClass jClass)
JMethod getReadMethod ()
XSList getXSList ()
String getContentName ()
XSType getContentType ()
FieldInfo getContent ()
String getElementName ()
boolean isMultivalued ()
void createAddMethod (JMethod method)
void createAddInsertMethod (JMethod method)
void createGetMethod (JMethod method)
void createGetCollectionReferenceMethod (JMethod method)
void createGetByIndexMethod (JMethod method)
void createSetArrayMethod (JMethod method)
void createSetByIndexMethod (JMethod method)
void createSetCollectionMethod (JMethod method)
void createSetCollectionReferenceMethod (JMethod method)
void setCreateExtraMethods (boolean extraMethods)
void setReferenceMethodSuffix (String suffix)
void createGetCountMethod (JMethod method)
void createEnumerateMethod (JMethod method)
void createRemoveByObjectMethod (JMethod method)
void createRemoveByIndexMethod (JMethod method)
void createRemoveAllMethod (JMethod method)

Static Public Attributes

static final String REFERENCE_SUFFIX_PROPERTY = "org.exolab.castor.builder.collections.reference.suffix"
static final String DEFAULT_REFERENCE_SUFFIX = "AsReference"

Protected Member Functions

void createBoundPropertyCode (JSourceCode jsc)
final boolean extraMethods ()
final String getReferenceMethodSuffix ()

Protected Attributes

XSList xsList = null

Detailed Description

A helper used for generating source that deals with Collections

Author:
Keith Visco
Version:
Revision:
1.3
Date:
2004/06/26 06:51:14

Constructor & Destructor Documentation

org.exolab.castor.builder.CollectionInfo.CollectionInfo ( XSType  contentType,
String  name,
String  elementName 
)

Creates a new CollectionInfo

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

References org.exolab.castor.builder.FieldInfo.FieldInfo(), org.exolab.castor.builder.XMLInfo.getSchemaType(), and org.exolab.castor.builder.CollectionInfo.xsList.


Member Function Documentation

void org.exolab.castor.builder.CollectionInfo.createAccessMethods ( JClass  jClass  ) 

Creates the Access methods for the collection described by this CollectionInfo

Parameters:
jClass the JClass to add the methods to.

Reimplemented from org.exolab.castor.builder.FieldInfo.

Reimplemented in org.exolab.castor.builder.CollectionInfoJ2.

References org.exolab.javasource.JMethod.addException(), org.exolab.javasource.JClass.addMethod(), org.exolab.javasource.JMethod.addParameter(), org.exolab.castor.builder.CollectionInfo.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfo.createAddMethod(), org.exolab.javasource.JType.createArray(), org.exolab.castor.builder.CollectionInfo.createEnumerateMethod(), org.exolab.castor.builder.CollectionInfo.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createGetCollectionReferenceMethod(), org.exolab.castor.builder.CollectionInfo.createGetCountMethod(), org.exolab.castor.builder.CollectionInfo.createGetMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfo.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfo.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(), and org.exolab.javasource.JParameter.getType().

void org.exolab.castor.builder.CollectionInfo.createBoundPropertyCode ( JSourceCode  jsc  )  [protected]

Creates the necessary source code for notifying PropertyChangeListeners when the collection has been updated.

Parameters:
jsc the JSourceCode to add the new source code to.

References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), and org.exolab.castor.builder.FieldInfo.getName().

Referenced by org.exolab.castor.builder.CollectionInfoODMG30.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfo.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createAddMethod(), org.exolab.castor.builder.CollectionInfoJ2.createClearMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveAllMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByObjectMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfo.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionReferenceMethod(), and org.exolab.castor.builder.CollectionInfo.createSetCollectionReferenceMethod().

void org.exolab.castor.builder.CollectionInfo.createEnumerateMethod ( JMethod  method  ) 
void org.exolab.castor.builder.CollectionInfo.createGetCollectionReferenceMethod ( JMethod  method  ) 
void org.exolab.castor.builder.CollectionInfo.createGetCountMethod ( JMethod  method  ) 
final boolean org.exolab.castor.builder.CollectionInfo.extraMethods (  )  [protected]

Returns true if extra collection methods should be generated. The extra collection methods are methods which return an actual reference to the underlying collection as opposed to an enumeration, iterator, or copy.

Returns:
true if extra collection methods should be generated

Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods(), and org.exolab.castor.builder.CollectionInfo.createAccessMethods().

void org.exolab.castor.builder.CollectionInfo.generateInitializerCode ( JSourceCode  jsc  ) 

Creates code for initialization of this Member

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

Reimplemented from org.exolab.castor.builder.FieldInfo.

Reimplemented in org.exolab.castor.builder.CollectionInfoJ2, and org.exolab.castor.builder.CollectionInfoODMG30.

References org.exolab.javasource.JSourceCode.add(), org.exolab.javasource.JSourceCode.append(), and org.exolab.castor.builder.FieldInfo.getName().

FieldInfo org.exolab.castor.builder.CollectionInfo.getContent (  ) 
XSType org.exolab.castor.builder.CollectionInfo.getContentType (  ) 

Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods(), org.exolab.castor.builder.CollectionInfo.createAccessMethods(), org.exolab.castor.builder.CollectionInfoODMG30.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfo.createAddInsertMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createAddMethod(), org.exolab.castor.builder.CollectionInfoJ2.createAddMethod(), org.exolab.castor.builder.CollectionInfo.createAddMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createGetByIndexMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createGetMethod(), org.exolab.castor.builder.CollectionInfoJ2.createGetMethod(), org.exolab.castor.builder.CollectionInfo.createGetMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createRemoveByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createRemoveMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfo.createSetArrayMethod(), org.exolab.castor.builder.CollectionInfoODMG30.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfo.createSetByIndexMethod(), org.exolab.castor.builder.CollectionInfoJ2.createSetCollectionMethod(), org.exolab.castor.builder.CollectionInfo.createSetCollectionMethod(), and org.exolab.castor.builder.CollectionInfo.getReadMethod().

String org.exolab.castor.builder.CollectionInfo.getReadMethodName (  ) 

Returns the name of the read method for this FieldInfo

Returns:
the name of the read method for this FieldInfo

Reimplemented from org.exolab.castor.builder.FieldInfo.

References org.exolab.castor.builder.CollectionInfo.getElementName().

Referenced by org.exolab.castor.builder.CollectionInfo.getReadMethod().

final String org.exolab.castor.builder.CollectionInfo.getReferenceMethodSuffix (  )  [protected]

Returns the suffix (ending) that should be used when creating the extra collection methods

Returns:
the suffix for the reference methods

Referenced by org.exolab.castor.builder.CollectionInfoJ2.createAccessMethods().

String org.exolab.castor.builder.CollectionInfo.getWriteMethodName (  ) 

Returns the name of the write method for this FieldInfo

Returns:
the name of the write method for this FieldInfo

Reimplemented from org.exolab.castor.builder.FieldInfo.

References org.exolab.castor.builder.CollectionInfo.getElementName().

boolean org.exolab.castor.builder.CollectionInfo.isMultivalued (  ) 

Return whether or not this member is a multivalued member or not

Returns:
true if this member can appear more than once

Reimplemented from org.exolab.castor.builder.XMLInfo.

void org.exolab.castor.builder.CollectionInfo.setCreateExtraMethods ( boolean  extraMethods  ) 

Sets whether or not to create extra collection methods for accessing the actual collection

Parameters:
extraMethods a boolean that when true indicates that extra collection accessor methods should be created. False by default.
See also:
setReferenceMethodSuffix

Referenced by org.exolab.castor.builder.FieldInfoFactory.createCollection().

void org.exolab.castor.builder.CollectionInfo.setReferenceMethodSuffix ( String  suffix  ) 

Sets the method suffix (ending) to use when creating the extra collection methods.

Parameters:
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.
See also:
setCreateExtraMethods

References org.exolab.castor.builder.CollectionInfo.DEFAULT_REFERENCE_SUFFIX.

Referenced by org.exolab.castor.builder.FieldInfoFactory.createCollection().


Member Data Documentation

final String org.exolab.castor.builder.CollectionInfo.REFERENCE_SUFFIX_PROPERTY = "org.exolab.castor.builder.collections.reference.suffix" [static]

The property used to overwrite the reference suffix for extra collection methods


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties