Package org.exolab.castor.builder
Class SGStateInfo
java.lang.Object
org.exolab.castor.builder.util.ClassInfoResolverImpl
org.exolab.castor.builder.SGStateInfo
- All Implemented Interfaces:
ClassInfoResolver
A class for maintaining state for the SourceGenerator.
- Version:
- $Revision$ $Date: 2005-06-22 22:13:21 -0600 (Wed, 22 Jun 2005) $
- Author:
- Keith Visco
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The SourceGenerator is still generating source.static final int
The SourceGenerator has been stopped by an error or by the user. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SGStateInfo
(Schema schema, SourceGenerator sgen) Creates a new SGStateInfo. -
Method Summary
Modifier and TypeMethodDescriptionvoid
bindSourceCode
(Annotated annotated, JClass[] classes) Binds the given Annotated structure with its generated source classes.getCDRFile
(String filename) Returns the CDRFile (Properties file) associated with the given filename.Returns the set of CDR file names.Returns the current FactoryState that holds information about the classes being generated.Returns the Dialog used for interacting with the user.getImportedSourceCode
(String className) Returns the JClass with the given name or null if no bindings have been specified for a JClass with the name.Returns the sources as generated through XML schema imports.getMapping
(String filename) Returns the Mapping file associated with the given filename.Returns the set of mapping filenames.Get package used when creating new classes.getSourceCode
(String className) Returns the JClass with the given name or null if no bindings have been specified for a JClass with the name.JClass[]
getSourceCode
(Annotated annotated) Returns the array of JClass for the given Annotated structure or null if no bindings have been specified for the given Structure.Returns the SourceGenerator instance being used.Returns the sources as generated through XML schema imports.int
Returns the current status.boolean
Returns true if non-fatal warnings should be suppressed.void
setCDRFile
(String filename, Properties props) Sets the CDR (ClassDescriptorResolver) file associated with the given filename.void
Sets the current FactoryState.void
setMapping
(String filename, MappingRoot mapping) Sets the Mapping file associated with the given filename.protected void
setPackageName
(String packageName) Set package used when creating new classes.void
setStatusCode
(int status) Sets the current status code to the given one.void
storeImportedSourcesByName
(Map<String, JClass> importedSourcesByName) Stores generated sources as processed within an imported schema.boolean
verbose()
Returns the value of the verbose flag.Methods inherited from class org.exolab.castor.builder.util.ClassInfoResolverImpl
bindReference, keys, resolve
-
Field Details
-
NORMAL_STATUS
public static final int NORMAL_STATUSThe SourceGenerator is still generating source.- See Also:
-
STOP_STATUS
public static final int STOP_STATUSThe SourceGenerator has been stopped by an error or by the user.- See Also:
-
-
Constructor Details
-
SGStateInfo
Creates a new SGStateInfo.- Parameters:
schema
- the Schema to generate source forsgen
- the SourceGenerator instance
-
-
Method Details
-
getPackageName
Get package used when creating new classes.- Returns:
- Package used when creating new classes.
-
setPackageName
Set package used when creating new classes.- Parameters:
packageName
- Package used when creating new classes.
-
bindSourceCode
-
storeImportedSourcesByName
-
getSourceCode
-
getSourceCode
-
getImportedSourceCode
Returns the JClass with the given name or null if no bindings have been specified for a JClass with the name. This method consults with JClass instances imported through a Schema import only.- Parameters:
className
- the name of the JClass- Returns:
- the (imported) JClass if found
-
getMapping
Returns the Mapping file associated with the given filename.- Parameters:
filename
- The filename to search for a Mapping File association- Returns:
- the Mapping file.
-
getCDRFile
Returns the CDRFile (Properties file) associated with the given filename.- Parameters:
filename
- filename of the CDR file to be processed- Returns:
- the Properties file.
-
getCDRFilenames
Returns the set of CDR file names.- Returns:
- the set of CDR file names.
-
getMappingFilenames
Returns the set of mapping filenames.- Returns:
- the set of mapping filenames.
-
getStatusCode
public int getStatusCode()Returns the current status.- Returns:
- the current status.
-
getSourceGenerator
Returns the SourceGenerator instance being used.- Returns:
- the SourceGenerator instance being used.
-
getSuppressNonFatalWarnings
public boolean getSuppressNonFatalWarnings()Returns true if non-fatal warnings should be suppressed.- Returns:
- true if non-fatal warnings should be suppressed.
-
setCDRFile
Sets the CDR (ClassDescriptorResolver) file associated with the given filename.- Parameters:
filename
- the filename associated with the CDR fileprops
- the Properties file
-
setMapping
Sets the Mapping file associated with the given filename.- Parameters:
filename
- the filename associated with the Mappingmapping
- the MappingRoot
-
getDialog
Returns the Dialog used for interacting with the user.- Returns:
- the Dialog, or null if none has been set.
-
setStatusCode
public void setStatusCode(int status) Sets the current status code to the given one.- Parameters:
status
- the new status code
-
verbose
public boolean verbose()Returns the value of the verbose flag. A true value indicates that additional messages may be printed during processing.- Returns:
- the value of the verbose flag.
-
getCurrentFactoryState
Returns the current FactoryState that holds information about the classes being generated.- Returns:
- the current FactoryState
-
setCurrentFactoryState
Sets the current FactoryState.- Parameters:
state
- the current FactoryState- See Also:
-
getImportedSourcesByName
-
getSourcesByName
-