org.exolab.castor.builder

Class SGStateInfo

class SGStateInfo extends ClassInfoResolverImpl

A class for maintaining state for the SourceGenerator

Version: $Revision: 1.6 $ $Date: 2005/06/23 04:13:21 $

Author: Keith Visco

Field Summary
static intNORMAL_STATUS
protected StringpackageName
The package used when creating new classes.
static intSTOP_STATUS
Constructor Summary
protected SGStateInfo(Schema schema, SourceGenerator sgen)
Creates a new SGStateInfo
Method Summary
voidbindSourceCode(Annotated annotated, JClass[] classes)
Binds the given Annotated structure with it's generated source classes
PropertiesgetCDRFile(String filename)
Returns the CDRFile (Properties file) associated with the given filename
EnumerationgetCDRFilenames()
Returns the set of CDR file names
FactoryStategetCurrentFactoryState()
Returns the current FactoryState that holds information about the classes being generated.
DialoggetDialog()
Returns the Dialog used for interacting with the user
MappingRootgetMapping(String filename)
Returns the Mapping file associated with the given filename
EnumerationgetMappingFilenames()
Returns the set of mapping filenames
JClassgetProcessed(String className)
Returns the processed JClass with the given name.
SchemagetSchema()
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.
JClassgetSourceCode(String className)
Returns the JClass with the given name or null if no bindings have been specified for a JClass with the name.
SourceGeneratorgetSourceGenerator()
Returns the SourceGenerator instance being used
intgetStatusCode()
Returns the current status
booleangetSuppressNonFatalWarnings()
voidmarkAsProcessed(JClass jClass)
Marks the given JClass as having been processed.
booleanprocessed(JClass jClass)
Returns true if the given JClass has been marked as processed
booleanprocessed(String className)
Returns true if a JClass with the given name has been marked as processed
booleanpromptForOverwrite()
voidsetCDRFile(String filename, Properties props)
Sets the CDR (ClassDescriptorResolver) file associated with the given filename
voidsetCurrentFactoryState(FactoryState state)
Sets the current FactoryState.
voidsetDialog(Dialog dialog)
Sets the Dialog used for interacting with the user
voidsetMapping(String filename, MappingRoot mapping)
Sets the Mapping file associated with the given filename
voidsetPromptForOverwrite(boolean promptForOverwrite)
voidsetStatusCode(int status)
Sets the current status code to the given one
voidsetSuppressNonFatalWarnings(boolean suppressNonFatalWarnings)
voidsetVerbose(boolean verbose)
Sets whether or not the source code generator prints additional messages during generating source code
booleanverbose()
Returns the value of the verbose flag.

Field Detail

NORMAL_STATUS

public static final int NORMAL_STATUS

packageName

protected String packageName
The package used when creating new classes.

STOP_STATUS

public static final int STOP_STATUS

Constructor Detail

SGStateInfo

protected SGStateInfo(Schema schema, SourceGenerator sgen)
Creates a new SGStateInfo

Parameters: schema the Schema to generate source for sgen the SourceGenerator instance

Method Detail

bindSourceCode

public void bindSourceCode(Annotated annotated, JClass[] classes)
Binds the given Annotated structure with it's generated source classes

Parameters: annotated the Annotated structure to add JClass bindings for classes the JClass[] to bind

getCDRFile

public Properties getCDRFile(String filename)
Returns the CDRFile (Properties file) associated with the given filename

Parameters: filename

Returns: the Properties file

getCDRFilenames

public Enumeration getCDRFilenames()
Returns the set of CDR file names

Returns: the set of CDR file names

getCurrentFactoryState

FactoryState getCurrentFactoryState()
Returns the current FactoryState that holds information about the classes being generated.

Returns: the current FactoryState

getDialog

Dialog getDialog()
Returns the Dialog used for interacting with the user

Returns: the Dialog, or null if none has been set.

getMapping

public MappingRoot getMapping(String filename)
Returns the Mapping file associated with the given filename

Returns: the Mapping file

getMappingFilenames

public Enumeration getMappingFilenames()
Returns the set of mapping filenames

Returns: the set of mapping filenames

getProcessed

JClass getProcessed(String className)
Returns the processed JClass with the given name. If no such JClass has been marked as processed, null is returned.

Parameters: className the JClass name to check against

Returns: the JClass with the given name

getSchema

Schema getSchema()

getSourceCode

public 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 JClass array

getSourceCode

public JClass getSourceCode(String className)
Returns the JClass with the given name or null if no bindings have been specified for a JClass with the name.

Parameters: className the name of the JClass

Returns: the JClass if found

getSourceGenerator

SourceGenerator getSourceGenerator()
Returns the SourceGenerator instance being used

getStatusCode

public int getStatusCode()
Returns the current status

Returns: the current status

getSuppressNonFatalWarnings

boolean getSuppressNonFatalWarnings()

markAsProcessed

void markAsProcessed(JClass jClass)
Marks the given JClass as having been processed.

Parameters: jClass the JClass to mark as having been processed.

processed

boolean processed(JClass jClass)
Returns true if the given JClass has been marked as processed

Parameters: jClass the JClass to check for being marked as processed

processed

boolean processed(String className)
Returns true if a JClass with the given name has been marked as processed

Parameters: className the JClass name to check against

promptForOverwrite

boolean promptForOverwrite()

setCDRFile

public void setCDRFile(String filename, Properties props)
Sets the CDR (ClassDescriptorResolver) file associated with the given filename

Parameters: filename the filename associated with the CDR file props the Properties file

setCurrentFactoryState

void setCurrentFactoryState(FactoryState state)
Sets the current FactoryState.

Parameters: state the current FactoryState

See Also: SGStateInfo

setDialog

void setDialog(Dialog dialog)
Sets the Dialog used for interacting with the user

Parameters: dialog the Dialog to use

setMapping

public void setMapping(String filename, MappingRoot mapping)
Sets the Mapping file associated with the given filename

Parameters: filename the filename associated with the Mapping mapping the MappingRoot

setPromptForOverwrite

void setPromptForOverwrite(boolean promptForOverwrite)

setStatusCode

void setStatusCode(int status)
Sets the current status code to the given one

Parameters: status the new status code

setSuppressNonFatalWarnings

void setSuppressNonFatalWarnings(boolean suppressNonFatalWarnings)

setVerbose

void setVerbose(boolean verbose)
Sets whether or not the source code generator prints additional messages during generating source code

Parameters: verbose a boolean, when true indicates to print additional messages

verbose

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.

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