Class SourceFactory
java.lang.Object
org.exolab.castor.builder.factory.BaseFactory
org.exolab.castor.builder.factory.SourceFactory
Creates the Java Source classes for Schema components.
- Version:
- $Revision$ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
- Author:
- Keith Visco, Arnaud Blandin
-
Constructor Summary
ConstructorsConstructorDescriptionSourceFactory
(BuilderConfiguration config, FieldInfoFactory infoFactory, GroupNaming groupNaming, SourceGenerator sourceGenerator) Creates a new SourceFactory with the given FieldInfoFactory. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createEqualsMethod
(JClass jclass) Create an 'equals' method on the given JClass.void
createHashCodeMethod
(JClass jclass) Create an "hashCode" method on the given JClass.createSourceCode
(ExtendedBinding binding, SimpleType simpleType, SGStateInfo sgState) Creates the Java source code to support the given Simpletype.JClass[]
createSourceCode
(XMLBindingComponent component, SGStateInfo sgState) Creates a new ClassInfo for the given XMLBindingComponent.void
createTestableMethods
(JClass jclass, FactoryState state) Implement org.castor.xmlctf.CastorTestable im the given JClass.void
setCaseInsensitive
(boolean caseInsensitive) Set to true if enumerated type lookups should be performed in a case insensitive manner.void
setCreateExtraMethods
(boolean extraMethods) Sets whether or not to create extra collection methods for accessing the actual collection.void
setCreateMarshalMethods
(boolean createMarshalMethods) Sets whether or not to create the XML marshaling framework specific methods (marshal, unmarshal, validate) in the generated classes.void
setReferenceMethodSuffix
(String suffix) Sets the method suffix (ending) to use when creating the extra collection methods.void
setSAX1
(boolean sax1) Sets to true if SAX1 should be used in the marshall method.void
setTestable
(boolean testable) Sets whether or not to implement CastorTestable.Methods inherited from class org.exolab.castor.builder.factory.BaseFactory
createComment, extractCommentsFromAnnotations, getConfig, getGroupNaming, getInfoFactory, getJavaNaming, getSourceGenerator, normalize, setGroupNaming
-
Constructor Details
-
SourceFactory
public SourceFactory(BuilderConfiguration config, FieldInfoFactory infoFactory, GroupNaming groupNaming, SourceGenerator sourceGenerator) Creates a new SourceFactory with the given FieldInfoFactory.- Parameters:
config
- the BuilderConfiguration instance (must not be null).infoFactory
- the FieldInfoFactory to usegroupNaming
- Group naming scheme to be used.sourceGenerator
- the calling source generator.
-
-
Method Details
-
setCreateMarshalMethods
public void setCreateMarshalMethods(boolean createMarshalMethods) Sets whether or not to create the XML marshaling framework specific methods (marshal, unmarshal, validate) in the generated classes. By default, these methods are generated.- Parameters:
createMarshalMethods
- a boolean, when true indicates to generated the marshaling framework methods
-
setCreateExtraMethods
public 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:
-
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:
-
setTestable
public void setTestable(boolean testable) Sets whether or not to implement CastorTestable.- Parameters:
testable
- if true, indicates to implement CastorTestable
-
setSAX1
public void setSAX1(boolean sax1) Sets to true if SAX1 should be used in the marshall method.- Parameters:
sax1
- true if SAX1 should be used.
-
setCaseInsensitive
public void setCaseInsensitive(boolean caseInsensitive) Set to true if enumerated type lookups should be performed in a case insensitive manner.- Parameters:
caseInsensitive
- when true
-
createSourceCode
Creates a new ClassInfo for the given XMLBindingComponent.- Parameters:
component
- the XMLBindingComponent that abstracts all XML Schema definition for a XML Schema component.sgState
- The given state of the SourceGenerator.- Returns:
- an array of JClasses reflecting the given XMLBindingComponent.
-
createSourceCode
Creates the Java source code to support the given Simpletype.- Parameters:
binding
- Current XML bindingsimpleType
- the Simpletype to create the Java source forsgState
- the current SGStateInfo (cannot be null).- Returns:
- the JClass representation of the given Simpletype
-
createHashCodeMethod
Create an "hashCode" method on the given JClass.- Parameters:
jclass
- the JClass in wich we create the hashCode method.
-
createEqualsMethod
Create an 'equals' method on the given JClass.- Parameters:
jclass
- the Jclass in which we create the equals method
-
createTestableMethods
Implement org.castor.xmlctf.CastorTestable im the given JClass.- Parameters:
jclass
- The JClass which will implement the CastorTestable Interface.state
- our state, e.g., state of this Factory instance.
-