org.exolab.castor.builder.info

Class CollectionInfo

Known Direct Subclasses:
CollectionInfoJ2, CollectionInfoODMG30

public class CollectionInfo
extends FieldInfo

A helper used for generating source that deals with Collections.
Version:
$Revision: 7148 $ $Date: 2006-02-23 01:08:24 -0700 (Thu, 23 Feb 2006) $
Author:
Keith Visco

Field Summary

static String
DEFAULT_REFERENCE_SUFFIX
Default suffix for the setter/getter by reference method names.
static String
REFERENCE_SUFFIX_PROPERTY
The property used to overwrite the reference suffix for extra collection methods.

Fields inherited from class org.exolab.castor.builder.info.FieldInfo

METHOD_PREFIX_ADD, METHOD_PREFIX_DELETE, METHOD_PREFIX_GET, METHOD_PREFIX_HAS, METHOD_PREFIX_IS, METHOD_PREFIX_SET, READ_METHOD, READ_WRITE_METHODS, WRITE_METHOD

Fields inherited from class org.exolab.castor.builder.info.XMLInfo

ATTRIBUTE_TYPE, CHOICE_NODE_NAME_ERROR_INDICATION, ELEMENT_TYPE, TEXT_TYPE

Constructor Summary

CollectionInfo(XSType contentType, String name, String elementName, boolean useJava50, FieldMemberAndAccessorFactory memberAndAccessorFactory, FieldMemberAndAccessorFactory contentMemberAndAccessorFactory)
Creates a new CollectionInfo.

Method Summary

FieldInfo
getContent()
Return the contents of the collection.
String
getContentName()
Returns the variable name for the content of the collection.
XSType
getContentType()
Returns the type of content in this collection.
String
getElementName()
Returns the name to be used when referring to the elements of this collection.
String
getMethodSuffix()
String
getParameterPrefix()
Returns the element type name converted to a parameter prefix.
String
getReferenceMethodSuffix()
Returns the suffix (ending) that should be used when creating the extra collection methods.
String
getReferenceSuffix()
Returns the reference suffix to use for 'reference style' methods.
XSListType
getXSList()
Returns the schema type represented by this collection.
boolean
isExtraMethods()
Indicates whether extra collection methods should be created.
boolean
isMultivalued()
void
setCreateExtraMethods(boolean extraMethods)
Sets whether or not to create extra collection methods for accessing the actual collection.
void
setReferenceMethodSuffix(String suffix)
Sets the method suffix (ending) to use when creating the extra collection methods.

Methods inherited from class org.exolab.castor.builder.info.FieldInfo

getComment, getDeclaringClassInfo, getDefaultValue, getDeleteMethodName, getFieldInfoReference, getFixedValue, getHasMethodName, getMemberAndAccessorFactory, getMethodSuffix, getMethods, getName, getReadMethodName, getSubstitutionGroupMembers, getValidator, getVisibility, getWriteMethodName, getXMLFieldHandler, isBound, isContainer, isFinal, isHasAndDeleteMethods, isNillable, isStatic, isTransient, setBound, setComment, setContainer, setDeclaringClassInfo, setDefaultValue, setFieldInfoReference, setFinal, setFixedValue, setMethods, setNillable, setStatic, setSubstitutionGroupMembers, setTransient, setValidator, setVisibility, setXMLFieldHandler

Methods inherited from class org.exolab.castor.builder.info.XMLInfo

getNamespacePrefix, getNamespaceURI, getNodeName, getNodeType, getNodeTypeName, getSchemaType, isElementDefinition, isMultivalued, isRequired, setElementDefinition, setMultivalued, setNamespacePrefix, setNamespaceURI, setNodeName, setNodeType, setRequired, setSchemaType

Field Details

DEFAULT_REFERENCE_SUFFIX

public static final String DEFAULT_REFERENCE_SUFFIX
Default suffix for the setter/getter by reference method names.

REFERENCE_SUFFIX_PROPERTY

public static final String REFERENCE_SUFFIX_PROPERTY
The property used to overwrite the reference suffix for extra collection methods.

Constructor Details

CollectionInfo

public CollectionInfo(XSType contentType,
                      String name,
                      String elementName,
                      boolean useJava50,
                      FieldMemberAndAccessorFactory memberAndAccessorFactory,
                      FieldMemberAndAccessorFactory contentMemberAndAccessorFactory)
Creates a new CollectionInfo.
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
useJava50 - true if source code is supposed to be generated for Java 5
memberAndAccessorFactory - the FieldMemberAndAccessorFactory to be used
contentMemberAndAccessorFactory - the FieldMemberAndAccessorFactory for the content

Method Details

getContent

public final FieldInfo getContent()
Return the contents of the collection.
Returns:
the contents of the collection.

getContentName

public final String getContentName()
Returns the variable name for the content of the collection.
Returns:
the variable name for the content of the collection.

getContentType

public final XSType getContentType()
Returns the type of content in this collection.
Returns:
the type of content in this collection.

getElementName

public final String getElementName()
Returns the name to be used when referring to the elements of this collection.
Returns:
the name to be used when referring to the elements of this collection.

getMethodSuffix

public final String getMethodSuffix()
Overrides:
getMethodSuffix in interface FieldInfo

getParameterPrefix

public String getParameterPrefix()
Returns the element type name converted to a parameter prefix.
Returns:
the element type name converted to a parameter prefix.

getReferenceMethodSuffix

public final String getReferenceMethodSuffix()
Returns the suffix (ending) that should be used when creating the extra collection methods.
Returns:
the suffix for the reference methods

getReferenceSuffix

public String getReferenceSuffix()
Returns the reference suffix to use for 'reference style' methods.
Returns:
the reference suffix to use

getXSList

public final XSListType getXSList()
Returns the schema type represented by this collection.
Returns:
the schema type represented by this collection.

isExtraMethods

public boolean isExtraMethods()
Indicates whether extra collection methods should be created.
Returns:
True if extra collection methods will be created.

isMultivalued

public final boolean isMultivalued()
Overrides:
isMultivalued in interface XMLInfo

setCreateExtraMethods

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

setReferenceMethodSuffix

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

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