org.apache.ws.jaxme.generator

Interface Generator

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 {@link SchemaReader} set by calling {@link #setSchemaReader}.

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: Generator.java 358956 2005-12-25 00:43:38Z jochen $

Author: Jochen Wiedmann

Method Summary
voidaddBindings(InputSource pSource)
Sets the external schema bindings.
SchemaSGgenerate(File pFile)

Generates java source from the given File.

SchemaSGgenerate(URL pURL)

Generates java source from the given URL.

SchemaSGgenerate(InputSource pSource)

Generates java source from the given URL.

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

Returns the {@link EntityResolver} being used to import external schemata.

StringgetKey()

Returns a key for getting and setting custom data.

FilegetResourceTargetDirectory()
Sets the directory where resource files are being created.
SchemaReadergetSchemaReader()

Returns the SchemaReader being used.

FilegetTargetDirectory()
Returns the directory where Java source files are being created.
booleanisForcingOverwrite()

Returns whether the generator is forcing an overwrite of files.

booleanisSettingReadOnly()

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

booleanisValidating()

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

voidsetEntityResolver(EntityResolver pEntityResolver)

Sets the {@link EntityResolver} being used to import external schemata.

voidsetForcingOverwrite(boolean pIsForcingOverwrite)

Sets whether the generator is forcing an overwrite of files.

voidsetResourceTargetDirectory(File pDirectory)
Sets the directory where resource files are being created.
voidsetSchemaReader(SchemaReader pSchemaReader)

Sets the SchemaReader to use.

voidsetSettingReadOnly(boolean pIsSettingReadOnly)

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

voidsetTargetDirectory(File pDirectory)
Sets the directory where Java source files are being created.
voidsetValidating(boolean pValidating)

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

Method Detail

addBindings

public void addBindings(InputSource pSource)
Sets the external schema bindings.

generate

public SchemaSG generate(File pFile)

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

generate

public SchemaSG generate(URL pURL)

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

generate

public SchemaSG generate(InputSource pSource)

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

getBindings

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

getEntityResolver

public EntityResolver getEntityResolver()

Returns the {@link 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 {@link 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.