org.apache.ws.jaxme.generator
Interface Generator

All Superinterfaces:
PropertySource
All Known Implementing Classes:
GeneratorImpl

public interface Generator
extends PropertySource

The Generator is a frontend for working with the SchemaReaders, SourceWriters and whatever else.

Usage: Generates java source definitions from various inputs:

The inputs are interpreted into schema definitions by the SchemaReader set by calling setSchemaReader(org.apache.ws.jaxme.generator.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:

Version:
$Id$
Author:
Jochen Wiedmann

Method Summary
 void addBindings(org.xml.sax.InputSource pSource)
          Sets the external schema bindings.
 SchemaSG generate(java.io.File pFile)
           Generates java source from the given File.
 SchemaSG generate(org.xml.sax.InputSource pSource)
           Generates java source from the given URL.
 SchemaSG generate(java.net.URL pURL)
           Generates java source from the given URL.
 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.io.File getResourceTargetDirectory()
          Sets the directory where resource files are being created.
 SchemaReader getSchemaReader()
          Returns the SchemaReader being used.
 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 setResourceTargetDirectory(java.io.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(java.io.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.
 
Methods inherited from interface org.apache.ws.jaxme.generator.PropertySource
getProperty, getProperty, setProperty
 

Method Detail

setSchemaReader

void setSchemaReader(SchemaReader pSchemaReader)

Sets the SchemaReader to use.


getSchemaReader

SchemaReader getSchemaReader()

Returns the SchemaReader being used.


setTargetDirectory

void setTargetDirectory(java.io.File pDirectory)
Sets the directory where Java source files are being created.


getTargetDirectory

java.io.File getTargetDirectory()
Returns the directory where Java source files are being created.


setResourceTargetDirectory

void setResourceTargetDirectory(java.io.File pDirectory)
Sets the directory where resource files are being created. By default, this is the Java source directory.


getResourceTargetDirectory

java.io.File getResourceTargetDirectory()
Sets the directory where resource files are being created. By default, this is the Java source directory.


setValidating

void setValidating(boolean pValidating)

Sets whether the generator is using a validating XML schema parser. Defaults to false.


isValidating

boolean isValidating()

Returns whether the generator is using a validating XML schema parser. Defaults to false.


isForcingOverwrite

boolean isForcingOverwrite()

Returns whether the generator is forcing an overwrite of files.


setForcingOverwrite

void setForcingOverwrite(boolean pIsForcingOverwrite)

Sets whether the generator is forcing an overwrite of files.


isSettingReadOnly

boolean isSettingReadOnly()

Returns whether the generator will create files in read-only mode.


setSettingReadOnly

void setSettingReadOnly(boolean pIsSettingReadOnly)

Sets whether the generator will create files in read-only mode.


generate

SchemaSG generate(java.io.File pFile)
                  throws java.lang.Exception

Generates java source from the given File.

Parameters:
pFile - reads the schema (from which the source is to be generated) from the given file.
Returns:
SchemaSG describing the source generated
Throws:
java.lang.Exception

generate

SchemaSG generate(java.net.URL pURL)
                  throws java.lang.Exception

Generates java source from the given URL.

Parameters:
pURL - reads the schema (from which the source is to be generated) from the given URL.
Returns:
SchemaSG describing the source generated
Throws:
java.lang.Exception

generate

SchemaSG generate(org.xml.sax.InputSource pSource)
                  throws java.lang.Exception

Generates java source from the given URL.

Parameters:
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.
Returns:
SchemaSG describing the source generated
Throws:
java.lang.Exception

getKey

java.lang.String getKey()

Returns a key for getting and setting custom data.


setEntityResolver

void setEntityResolver(org.xml.sax.EntityResolver pEntityResolver)

Sets the EntityResolver being used to import external schemata.


getEntityResolver

org.xml.sax.EntityResolver getEntityResolver()

Returns the EntityResolver being used to import external schemata.


addBindings

void addBindings(org.xml.sax.InputSource pSource)
                 throws javax.xml.parsers.ParserConfigurationException,
                        org.xml.sax.SAXException,
                        java.io.IOException
Sets the external schema bindings.

Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

getBindings

org.w3c.dom.Document[] getBindings()
Returns the external schema bindings, if any, or null.