org.apache.ws.jaxme.generator
Interface Generator
- PropertySource
- GeneratorImpl
public interface Generator
The Generator is a frontend for working with the
SchemaReaders, SourceWriters and whatever else.
Usage: Generates java source definitions
from various inputs:
generate(java.net.URL)
generate(java.io.File)
generate(org.xml.sax.InputSource)
The inputs are interpreted into schema
definitions by the
SchemaReader
set by calling
setSchemaReader(SchemaReader)
.
Other properties give fine grained
control over various aspects of the file generation:
and the processing of the schema:
Implementation note: If you update this interface, you
should consider updating the following files and classes as
well:
$Id: Generator.java 358956 2005-12-25 00:43:38Z jochen $ void | addBindings(InputSource pSource) - Sets the external schema bindings.
|
SchemaSG | generate(File pFile) -
Generates java source from the given
File .
|
SchemaSG | generate(InputSource pSource) -
Generates java source from the given
URL .
|
SchemaSG | generate(URL pURL) -
Generates java source from the given
URL .
|
Document[] | getBindings() - Returns the external schema bindings, if any, or null.
|
EntityResolver | getEntityResolver() - Returns the
EntityResolver being used to import external
schemata.
|
String | getKey() - Returns a key for getting and setting custom data.
|
File | getResourceTargetDirectory() - Sets the directory where resource files are being
created.
|
SchemaReader | getSchemaReader() - Returns the SchemaReader being used.
|
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(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 | setResourceTargetDirectory(File pDirectory) - Sets the directory where resource files are being
created.
|
void | setSchemaReader(SchemaReader pSchemaReader) - Sets the SchemaReader to use.
|
void | setSettingReadOnly(boolean pIsSettingReadOnly) - Sets whether the generator will create files in read-only mode.
|
void | setTargetDirectory(File pDirectory) - Sets the directory where Java source files are being
created.
|
void | setValidating(boolean pValidating) - Sets whether the generator is using a validating XML
schema parser.
|
addBindings
public void addBindings(InputSource pSource)
throws ParserConfigurationException,
SAXException,
IOException
Sets the external schema bindings.
generate
public SchemaSG generate(File pFile)
throws Exception
Generates java source from the given File
.
pFile
- reads the schema (from which the source is to be generated)
from the given file.
SchemaSG
describing the source generated
generate
public SchemaSG generate(InputSource pSource)
throws Exception
Generates java source from the given URL
.
pSource
- reads the schema (from which the source is to be generated)
from the SAX Input Source. The System ID should be (if possible) set.
SchemaSG
describing the source generated
generate
public SchemaSG generate(URL pURL)
throws Exception
Generates java source from the given URL
.
pURL
- reads the schema (from which the source is to be generated)
from the given URL.
SchemaSG
describing the source generated
getBindings
public Document[] getBindings()
Returns the external schema bindings, if any, or null.
getEntityResolver
public EntityResolver getEntityResolver()
Returns the EntityResolver
being used to import external
schemata.
getKey
public String getKey()
Returns a key for getting and setting custom data.
getResourceTargetDirectory
public File getResourceTargetDirectory()
Sets the directory where resource files are being
created. By default, this is the Java source directory.
getSchemaReader
public SchemaReader getSchemaReader()
Returns the SchemaReader being used.
getTargetDirectory
public File getTargetDirectory()
Returns the directory where Java source files are being
created.
isForcingOverwrite
public boolean isForcingOverwrite()
Returns whether the generator is forcing an overwrite of files.
isSettingReadOnly
public boolean isSettingReadOnly()
Returns whether the generator will create files in read-only mode.
isValidating
public boolean isValidating()
Returns whether the generator is using a validating XML
schema parser. Defaults to false.
setEntityResolver
public void setEntityResolver(EntityResolver pEntityResolver)
Sets the EntityResolver
being used to import external
schemata.
setForcingOverwrite
public void setForcingOverwrite(boolean pIsForcingOverwrite)
Sets whether the generator is forcing an overwrite of files.
setResourceTargetDirectory
public void setResourceTargetDirectory(File pDirectory)
Sets the directory where resource files are being
created. By default, this is the Java source directory.
setSchemaReader
public void setSchemaReader(SchemaReader pSchemaReader)
Sets the SchemaReader to use.
setSettingReadOnly
public void setSettingReadOnly(boolean pIsSettingReadOnly)
Sets whether the generator will create files in read-only mode.
setTargetDirectory
public void setTargetDirectory(File pDirectory)
Sets the directory where Java source files are being
created.
setValidating
public void setValidating(boolean pValidating)
Sets whether the generator is using a validating XML
schema parser. Defaults to false.