public class GeneratorImpl extends java.lang.Object implements Generator
The Generator is reading an input schema. The schema is converted into a DOM tree. Finally one or more source writers are executed.
Constructor and Description |
---|
GeneratorImpl()
Creates a new GeneratorImpl
|
Modifier and Type | Method and Description |
---|---|
void |
addBindings(org.xml.sax.InputSource pSource)
Sets the external schema bindings.
|
SchemaSG |
generate(java.io.File pFile)
Opens the given file, calls the specified SchemaReaders
() method and SourceWriters write() method.
|
SchemaSG |
generate(org.xml.sax.InputSource pSource)
Generates java source from the given
URL . |
SchemaSG |
generate(java.net.URL pURL)
Opens the given URL, calls the specified SchemaReaders
() method and SourceWriters write() method.
|
org.w3c.dom.Document[] |
getBindings()
Returns the external schema bindings, if any, or null.
|
org.xml.sax.EntityResolver |
getEntityResolver()
Returns the
EntityResolver being used to import external
schemata. |
java.lang.String |
getKey()
Returns a key for getting and setting custom data.
|
java.lang.String |
getProperty(java.lang.String pName)
Returns the given property value or null, if the property is not
set.
|
java.lang.String |
getProperty(java.lang.String pName,
java.lang.String pDefault)
Returns the given property value.
|
java.io.File |
getResourceTargetDirectory()
Sets the directory where resource files are being
created.
|
SchemaReader |
getSchemaReader()
Returns the SchemaReader.
|
java.io.File |
getTargetDirectory()
Returns the directory where Java source files are being
created.
|
boolean |
isForcingOverwrite()
Returns whether the generator is forcing an overwrite of files.
|
boolean |
isSettingReadOnly()
Returns whether the generator will create files in read-only mode.
|
boolean |
isValidating()
Returns whether the generator is using a validating XML
schema parser.
|
void |
setEntityResolver(org.xml.sax.EntityResolver pEntityResolver)
Sets the
EntityResolver being used to import external
schemata. |
void |
setForcingOverwrite(boolean pIsForcingOverwrite)
Sets whether the generator is forcing an overwrite of files.
|
void |
setProperty(java.lang.String pName,
java.lang.String pValue)
Sets the given property value.
|
void |
setResourceTargetDirectory(java.io.File pDirectory)
Sets the directory where resource files are being
created.
|
void |
setSchemaReader(SchemaReader pReader)
Sets the SchemaReader.
|
void |
setSettingReadOnly(boolean pIsSettingReadOnly)
Sets whether the generator will create files in read-only mode.
|
void |
setTargetDirectory(java.io.File pDirectory)
Sets the directory where Java source files are being
created.
|
void |
setValidating(boolean pIsValidating)
Sets whether the generator is using a validating XML
schema parser.
|
public void setEntityResolver(org.xml.sax.EntityResolver pEntityResolver)
Sets the EntityResolver
being used to import external
schemata.
setEntityResolver
in interface Generator
public org.xml.sax.EntityResolver getEntityResolver()
Returns the EntityResolver
being used to import external
schemata.
getEntityResolver
in interface Generator
public boolean isForcingOverwrite()
Returns whether the generator is forcing an overwrite of files.
isForcingOverwrite
in interface Generator
public void setForcingOverwrite(boolean pIsForcingOverwrite)
Sets whether the generator is forcing an overwrite of files.
setForcingOverwrite
in interface Generator
public boolean isSettingReadOnly()
Returns whether the generator will create files in read-only mode.
isSettingReadOnly
in interface Generator
public void setSettingReadOnly(boolean pIsSettingReadOnly)
Sets whether the generator will create files in read-only mode.
setSettingReadOnly
in interface Generator
public boolean isValidating()
Generator
Returns whether the generator is using a validating XML schema parser. Defaults to false.
isValidating
in interface Generator
public void setValidating(boolean pIsValidating)
Generator
Sets whether the generator is using a validating XML schema parser. Defaults to false.
setValidating
in interface Generator
public void setSchemaReader(SchemaReader pReader)
Sets the SchemaReader.
setSchemaReader
in interface Generator
public SchemaReader getSchemaReader()
Returns the SchemaReader.
getSchemaReader
in interface Generator
public void setTargetDirectory(java.io.File pDirectory)
Generator
setTargetDirectory
in interface Generator
public java.io.File getTargetDirectory()
Generator
getTargetDirectory
in interface Generator
public void setResourceTargetDirectory(java.io.File pDirectory)
Generator
setResourceTargetDirectory
in interface Generator
public java.io.File getResourceTargetDirectory()
Generator
getResourceTargetDirectory
in interface Generator
public SchemaSG generate(org.xml.sax.InputSource pSource) throws java.lang.Exception
Generator
Generates java source from the given URL
.
public SchemaSG generate(java.io.File pFile) throws java.lang.Exception
Opens the given file, calls the specified SchemaReaders () method and SourceWriters write() method.
public SchemaSG generate(java.net.URL pURL) throws java.lang.Exception
Opens the given URL, calls the specified SchemaReaders () method and SourceWriters write() method.
public java.lang.String getProperty(java.lang.String pName)
PropertySource
Returns the given property value or null, if the property is not set.
getProperty
in interface PropertySource
public java.lang.String getProperty(java.lang.String pName, java.lang.String pDefault)
PropertySource
Returns the given property value. If the property is not set, returns the given default value.
getProperty
in interface PropertySource
public void setProperty(java.lang.String pName, java.lang.String pValue)
PropertySource
Sets the given property value.
setProperty
in interface PropertySource
public java.lang.String getKey()
Generator
Returns a key for getting and setting custom data.
public void addBindings(org.xml.sax.InputSource pSource) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
Generator
addBindings
in interface Generator
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public org.w3c.dom.Document[] getBindings()
Generator
getBindings
in interface Generator