Package org.exolab.castor.builder
Class FactoryState
java.lang.Object
org.exolab.castor.builder.FactoryState
- All Implemented Interfaces:
ClassInfoResolver
A class used to save State information for the SourceFactory.
- Author:
- Keith Visco
-
Constructor Summary
ConstructorsConstructorDescriptionFactoryState
(String className, SGStateInfo sgState, String packageName, XMLBindingComponent component) Constructs a new FactoryState.FactoryState
(String className, SGStateInfo sgState, String packageName, XMLBindingComponent component, boolean enumeration) Constructs a factory state with the option of choosing between JClass and JEnum. -
Method Summary
Modifier and TypeMethodDescriptionvoid
bindReference
(Object key, ClassInfo classInfoRef) Adds the given Reference to this ClassInfo resolver.final ClassInfo
Get ClassInfo for_jClass
.final FieldInfo
Get FieldInfo used to handlexsd:choice
.final JClass
Get JClass for which we are currently generating code.final String
Get package for the class currently being generated.(package private) FactoryState
Returns the parent of this FactoryState.Returns the SGStateInfo.boolean
Returns true if any bound properties have been found.boolean
Returns true if we are currently in the state of creating a group item class.void
markAsProcessed
(Annotated annotated) Marks the given Annotated XML Schema structure as having been processed.boolean
Returns true if the given Annotated XML Schema structure has been marked as processed.Returns the ClassInfo which has been bound to the given key.void
setBoundProperties
(boolean bound) Allows setting the bound properties flag.void
setCreateGroupItem
(boolean createGroupItem) Sets to true if we are currently generating a class to represent items in a group.final void
setFieldInfoForChoice
(FieldInfo fieldInfoForChoice) Set FieldInfo used to handlexsd:choice
.void
setParent
(FactoryState parent) Sets the parent of this FactoryState.
-
Constructor Details
-
FactoryState
public FactoryState(String className, SGStateInfo sgState, String packageName, XMLBindingComponent component) Constructs a new FactoryState.- Parameters:
className
- Class name of the class currently being generated.sgState
- Source Generator State objectpackageName
- package name for generated code.component
- TODO
-
FactoryState
public FactoryState(String className, SGStateInfo sgState, String packageName, XMLBindingComponent component, boolean enumeration) Constructs a factory state with the option of choosing between JClass and JEnum.- Parameters:
className
- Class name of the class currently being generated.sgState
- Source Generator State objectpackageName
- package name for generated code.component
- TODOenumeration
- use a JEnum instead if a JClass
-
-
Method Details
-
getJClass
Get JClass for which we are currently generating code.- Returns:
- JClass for which we are currently generating code.
-
getClassInfo
Get ClassInfo for_jClass
.- Returns:
- ClassInfo for
_jClass
.
-
getFieldInfoForChoice
Get FieldInfo used to handlexsd:choice
.- Returns:
- FieldInfo used to handle
xsd:choice
.
-
setFieldInfoForChoice
Set FieldInfo used to handlexsd:choice
.- Parameters:
fieldInfoForChoice
- FieldInfo used to handlexsd:choice
.
-
getPackageName
Get package for the class currently being generated.- Returns:
- Package for the class currently being generated.
-
bindReference
Adds the given Reference to this ClassInfo resolver.- Specified by:
bindReference
in interfaceClassInfoResolver
- Parameters:
key
- the key to bind a reference toclassInfoRef
- the ClassInfo which is being referenced
-
getSGStateInfo
Returns the SGStateInfo.- Returns:
- the SGStateInfo.
-
markAsProcessed
Marks the given Annotated XML Schema structure as having been processed.- Parameters:
annotated
- the Annotated XML Schema structure to mark as having been processed.
-
processed
Returns true if the given Annotated XML Schema structure has been marked as processed.- Parameters:
annotated
- the Annotated XML Schema structure to check for being marked as processed- Returns:
- true if the given Annotated XML Schema structure has been marked as processed
-
hasBoundProperties
public boolean hasBoundProperties()Returns true if any bound properties have been found.- Returns:
- true if any bound properties have been found.
-
setBoundProperties
public void setBoundProperties(boolean bound) Allows setting the bound properties flag.- Parameters:
bound
- the new value of the bound properties flag- See Also:
-
resolve
Returns the ClassInfo which has been bound to the given key.- Specified by:
resolve
in interfaceClassInfoResolver
- Parameters:
key
- the object to which the ClassInfo has been bound- Returns:
- the ClassInfo which has been bound to the given key
-
isCreateGroupItem
public boolean isCreateGroupItem()Returns true if we are currently in the state of creating a group item class.- Returns:
- true if we are currently in the state of creating a group item class.
-
setCreateGroupItem
public void setCreateGroupItem(boolean createGroupItem) Sets to true if we are currently generating a class to represent items in a group.- Parameters:
createGroupItem
- true if we are currently generating a class to represent items in a group.
-
getParent
FactoryState getParent()Returns the parent of this FactoryState. The parent of a factory state is the previous item of the list that contained all the created factory states.- Returns:
- the parent of this FactoryState.
-
setParent
Sets the parent of this FactoryState.- Parameters:
parent
- the parent FactoryState- See Also:
-