Class FieldInfoFactory
java.lang.Object
org.exolab.castor.builder.factory.FieldInfoFactory
This class is used as a factory to create all the FieldInfo objects used by
the source generator. You may override the FieldInfo classes and this factory
for specific adaptions.
- Version:
- $Revision: 9147 $ $Date: 2005-03-05 06:42:06 -0700 (Sat, 05 Mar 2005) $
- Author:
- Frank Thelen, Arnaud Blandin
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newFieldInfoFactory
instance.FieldInfoFactory
(boolean useOldFieldNaming) Creates a newFieldInfoFactory
instance.FieldInfoFactory
(String collectionName) Creates a newFieldInfoFactory
of the given collection type.FieldInfoFactory
(String collectionName, boolean useOldFieldNaming) Creates a new FieldInfoFactory of the given collection type. -
Method Summary
Modifier and TypeMethodDescriptioncreateCollection
(XSType contentType, String name, String elementName, String collectionName, JavaNaming javaNaming, boolean useJava50) Creates aCollectionInfo
instance based upon the various parameters provided.createCollection
(XSType contentType, String name, String elementName, JavaNaming javaNaming, boolean usejava50) Creates aCollectionInfo
instance based upon the various parameters provided.createFieldInfo
(XSType type, String name) createIdentity
(String name) Creates anIdentityInfo
instance for the given name.final void
setBoundProperties
(boolean bound) Sets whether or not the fields should be bound properties.final void
setCreateExtraMethods
(boolean extraMethods) Sets whether or not to create extra collection methods for accessing the actual collection.final void
setReferenceMethodSuffix
(String suffix) Sets the method suffix (ending) to use when creating the extra collection methods.
-
Constructor Details
-
FieldInfoFactory
public FieldInfoFactory()Creates a newFieldInfoFactory
instance. The default collection used will be Java 1 type. -
FieldInfoFactory
public FieldInfoFactory(boolean useOldFieldNaming) Creates a newFieldInfoFactory
instance. The default collection used will be Java 1 type.- Parameters:
useOldFieldNaming
- True to indicate that old Java naming conventions should be used.
-
FieldInfoFactory
Creates a newFieldInfoFactory
of the given collection type.- Parameters:
collectionName
- The type for the FieldInfoFactory.
-
FieldInfoFactory
Creates a new FieldInfoFactory of the given collection type.- Parameters:
collectionName
- The type for the FieldInfoFactory.useOldFieldNaming
- True to indicate that old Java naming conventions should be used.
-
-
Method Details
-
createIdentity
Creates anIdentityInfo
instance for the given name.- Parameters:
name
- Identity field name.- Returns:
- The
IdentityInfo
instance just created.
-
createCollection
public CollectionInfo createCollection(XSType contentType, String name, String elementName, JavaNaming javaNaming, boolean usejava50) Creates aCollectionInfo
instance based upon the various parameters provided.- Parameters:
contentType
- Content type of the collection.name
- Name of the collection member.elementName
- Name of the (content) element.javaNaming
- the Java naming to be usedusejava50
- Whether we are targeting Java 5.0 or above or not- Returns:
- A
CollectionInfo
instance representing a collection typed member. - See Also:
-
-
invalid @see
#createCollection(XSType, String, String, String, boolean)
-
-
createCollection
public CollectionInfo createCollection(XSType contentType, String name, String elementName, String collectionName, JavaNaming javaNaming, boolean useJava50) Creates aCollectionInfo
instance based upon the various parameters provided.- Parameters:
contentType
- Content type of the collection.name
- Name of the collection member.elementName
- Name of the (content) element.collectionName
- Name of the collection.javaNaming
- the Java naming to be useduseJava50
- Whether we are targeting Java 5.0 or above or not- Returns:
- A
CollectionInfo
instance representing a collection typed member.
-
createFieldInfo
-
setBoundProperties
public final void setBoundProperties(boolean bound) Sets whether or not the fields should be bound properties.- Parameters:
bound
- a boolean that when true indicates the FieldInfo should have the bound property enabled.
-
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.- See Also:
-
-
invalid @see
org.exolab.castor.builder.FieldInfoFactory#setReferenceMethodSuffix
-
-
setReferenceMethodSuffix
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 in CollectionInfo will be used.- See Also:
-
-
invalid @see
org.exolab.castor.builder.FieldInfoFactory#setCreateExtraMethods
-
-