ClassInfoResolver
public final class SGStateInfo extends ClassInfoResolverImpl
Modifier and Type | Field | Description |
---|---|---|
static int |
NORMAL_STATUS |
The SourceGenerator is still generating source.
|
static int |
STOP_STATUS |
The SourceGenerator has been stopped by an error or by the user.
|
Modifier | Constructor | Description |
---|---|---|
protected |
SGStateInfo(Schema schema,
SourceGenerator sgen) |
Creates a new SGStateInfo.
|
Modifier and Type | Method | Description |
---|---|---|
void |
bindSourceCode(Annotated annotated,
JClass[] classes) |
Binds the given Annotated structure with its generated source classes.
|
java.util.Properties |
getCDRFile(java.lang.String filename) |
Returns the CDRFile (Properties file) associated with the given filename.
|
java.util.Enumeration<java.lang.String> |
getCDRFilenames() |
Returns the set of CDR file names.
|
FactoryState |
getCurrentFactoryState() |
Returns the current FactoryState that holds information about the classes
being generated.
|
Dialog |
getDialog() |
Returns the Dialog used for interacting with the user.
|
JClass |
getImportedSourceCode(java.lang.String className) |
Returns the JClass with the given name or null if no bindings have been
specified for a JClass with the name.
|
java.util.Map<java.lang.String,JClass> |
getImportedSourcesByName() |
Returns the sources as generated through XML schema imports.
|
MappingRoot |
getMapping(java.lang.String filename) |
Returns the Mapping file associated with the given filename.
|
java.util.Enumeration<java.lang.String> |
getMappingFilenames() |
Returns the set of mapping filenames.
|
java.lang.String |
getPackageName() |
Get package used when creating new classes.
|
(package private) JClass |
getProcessed(java.lang.String className) |
Returns the processed JClass with the given name.
|
(package private) Schema |
getSchema() |
Returns a reference to the schema for which we are generating source.
|
JClass |
getSourceCode(java.lang.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.
|
SourceGenerator |
getSourceGenerator() |
Returns the SourceGenerator instance being used.
|
java.util.Map<java.lang.String,JClass> |
getSourcesByName() |
Returns the sources as generated through XML schema imports.
|
int |
getStatusCode() |
Returns the current status.
|
boolean |
getSuppressNonFatalWarnings() |
Returns true if non-fatal warnings should be suppressed.
|
(package private) void |
markAsProcessed(JClass jClass) |
Marks the given JClass as having been processed.
|
(package private) boolean |
processed(java.lang.String className) |
Returns true if a JClass with the given name has been marked as
processed.
|
(package private) boolean |
processed(JClass jClass) |
Returns true if the given JClass has been marked as processed.
|
(package private) boolean |
promptForOverwrite() |
Returns true if existing source files should be prompted before being
overwritten.
|
void |
setCDRFile(java.lang.String filename,
java.util.Properties props) |
Sets the CDR (ClassDescriptorResolver) file associated with the given
filename.
|
void |
setCurrentFactoryState(FactoryState state) |
Sets the current FactoryState.
|
(package private) void |
setDialog(Dialog dialog) |
Sets the Dialog used for interacting with the user.
|
void |
setMapping(java.lang.String filename,
MappingRoot mapping) |
Sets the Mapping file associated with the given filename.
|
protected void |
setPackageName(java.lang.String packageName) |
Set package used when creating new classes.
|
(package private) void |
setPromptForOverwrite(boolean promptForOverwrite) |
Sets whether or not existing source files should be silently overwritten
or whether the user should be prompted first.
|
void |
setStatusCode(int status) |
Sets the current status code to the given one.
|
(package private) void |
setSuppressNonFatalWarnings(boolean suppressNonFatalWarnings) |
Sets whether non-fatal warnings should be supporessed.
|
(package private) void |
setVerbose(boolean verbose) |
Sets whether or not the source code generator prints additional messages
during generating source code.
|
void |
storeImportedSourcesByName(java.util.Map<java.lang.String,JClass> importedSourcesByName) |
Stores generated sources as processed within an imported schema.
|
boolean |
verbose() |
Returns the value of the verbose flag.
|
bindReference, keys, resolve
public static final int NORMAL_STATUS
public static final int STOP_STATUS
protected SGStateInfo(Schema schema, SourceGenerator sgen)
schema
- the Schema to generate source forsgen
- the SourceGenerator instancepublic java.lang.String getPackageName()
protected void setPackageName(java.lang.String packageName)
packageName
- Package used when creating new classes.public void bindSourceCode(Annotated annotated, JClass[] classes)
annotated
- the Annotated structure to add JClass bindings forclasses
- the JClass[] to bindpublic void storeImportedSourcesByName(java.util.Map<java.lang.String,JClass> importedSourcesByName)
importedSourcesByName
- Generated sources as processed within an imported schema.JClass getProcessed(java.lang.String className)
className
- the JClass name to check againstpublic JClass[] getSourceCode(Annotated annotated)
annotated
- the Annotated structure to searchpublic JClass getSourceCode(java.lang.String className)
className
- the name of the JClasspublic JClass getImportedSourceCode(java.lang.String className)
className
- the name of the JClasspublic MappingRoot getMapping(java.lang.String filename)
filename
- The filename to search for a Mapping File associationpublic java.util.Properties getCDRFile(java.lang.String filename)
filename
- filename of the CDR file to be processedpublic java.util.Enumeration<java.lang.String> getCDRFilenames()
public java.util.Enumeration<java.lang.String> getMappingFilenames()
public int getStatusCode()
void markAsProcessed(JClass jClass)
jClass
- the JClass to mark as having been processed.boolean processed(JClass jClass)
jClass
- the JClass to check for being marked as processedboolean processed(java.lang.String className)
className
- the JClass name to check againstboolean promptForOverwrite()
void setPromptForOverwrite(boolean promptForOverwrite)
promptForOverwrite
- true if existing files should not be silently
overwritten.Schema getSchema()
public SourceGenerator getSourceGenerator()
public boolean getSuppressNonFatalWarnings()
void setSuppressNonFatalWarnings(boolean suppressNonFatalWarnings)
suppressNonFatalWarnings
- true if non-fatal warnings should be supporessedpublic void setCDRFile(java.lang.String filename, java.util.Properties props)
filename
- the filename associated with the CDR fileprops
- the Properties filepublic void setMapping(java.lang.String filename, MappingRoot mapping)
filename
- the filename associated with the Mappingmapping
- the MappingRootpublic Dialog getDialog()
void setDialog(Dialog dialog)
dialog
- the Dialog to usepublic void setStatusCode(int status)
status
- the new status codevoid setVerbose(boolean verbose)
verbose
- a boolean, when true indicates to print additional
messagespublic boolean verbose()
public FactoryState getCurrentFactoryState()
public void setCurrentFactoryState(FactoryState state)
state
- the current FactoryStategetCurrentFactoryState()
public java.util.Map<java.lang.String,JClass> getImportedSourcesByName()
public java.util.Map<java.lang.String,JClass> getSourcesByName()
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com