org.apache.ws.jaxme.generator.impl

Class GeneratorImpl

Implemented Interfaces:
Generator, PropertySource

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 Summary

GeneratorImpl()
Creates a new GeneratorImpl

Method Summary

void
addBindings(InputSource pSource)
SchemaSG
generate(File pFile)
Opens the given file, calls the specified SchemaReaders () method and SourceWriters write() method.
SchemaSG
generate(InputSource pSource)
SchemaSG
generate(java.net.URL pURL)
Opens the given URL, calls the specified SchemaReaders () method and SourceWriters write() method.
Document[]
getBindings()
EntityResolver
getEntityResolver()
Returns the EntityResolver being used to import external schemata.
String
getKey()
String
getProperty(String pName)
Returns the given property value or null, if the property is not set.
String
getProperty(String pName, String pDefault)
Returns the given property value.
File
getResourceTargetDirectory()
SchemaReader
getSchemaReader()
Returns the SchemaReader.
File
getTargetDirectory()
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()
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
setProperty(String pName, String pValue)
Sets the given property value.
void
setResourceTargetDirectory(File pDirectory)
void
setSchemaReader(SchemaReader pReader)
Sets the SchemaReader.
void
setSettingReadOnly(boolean pIsSettingReadOnly)
Sets whether the generator will create files in read-only mode.
void
setTargetDirectory(File pDirectory)
void
setValidating(boolean pIsValidating)

Constructor Details

GeneratorImpl

public GeneratorImpl()
Creates a new GeneratorImpl

Method Details

addBindings

public void addBindings(InputSource pSource)
            throws ParserConfigurationException,
                   SAXException,
                   IOException
Specified by:
addBindings in interface Generator

generate

public SchemaSG generate(File pFile)
            throws Exception
Opens the given file, calls the specified SchemaReaders () method and SourceWriters write() method.
Specified by:
generate in interface Generator

generate

public SchemaSG generate(InputSource pSource)
            throws Exception
Specified by:
generate in interface Generator

generate

public SchemaSG generate(java.net.URL pURL)
            throws Exception
Opens the given URL, calls the specified SchemaReaders () method and SourceWriters write() method.

getBindings

public Document[] getBindings()
Specified by:
getBindings in interface Generator

getEntityResolver

public EntityResolver getEntityResolver()
Returns the EntityResolver being used to import external schemata.
Specified by:
getEntityResolver in interface Generator

getKey

public String getKey()
Specified by:
getKey in interface Generator

getProperty

public String getProperty(String pName)
Returns the given property value or null, if the property is not set.
Specified by:
getProperty in interface PropertySource

getProperty

public String getProperty(String pName,
                          String pDefault)
Returns the given property value. If the property is not set, returns the given default value.
Specified by:
getProperty in interface PropertySource

getResourceTargetDirectory

public File getResourceTargetDirectory()
Specified by:
getResourceTargetDirectory in interface Generator

getSchemaReader

public SchemaReader getSchemaReader()
Returns the SchemaReader.
Specified by:
getSchemaReader in interface Generator

getTargetDirectory

public File getTargetDirectory()
Specified by:
getTargetDirectory in interface Generator

isForcingOverwrite

public boolean isForcingOverwrite()
Returns whether the generator is forcing an overwrite of files.
Specified by:
isForcingOverwrite in interface Generator

isSettingReadOnly

public boolean isSettingReadOnly()
Returns whether the generator will create files in read-only mode.
Specified by:
isSettingReadOnly in interface Generator

isValidating

public boolean isValidating()
Specified by:
isValidating in interface Generator

setEntityResolver

public void setEntityResolver(EntityResolver pEntityResolver)
Sets the EntityResolver being used to import external schemata.
Specified by:
setEntityResolver in interface Generator

setForcingOverwrite

public void setForcingOverwrite(boolean pIsForcingOverwrite)
Sets whether the generator is forcing an overwrite of files.
Specified by:
setForcingOverwrite in interface Generator

setProperty

public void setProperty(String pName,
                        String pValue)
Sets the given property value.
Specified by:
setProperty in interface PropertySource

setResourceTargetDirectory

public void setResourceTargetDirectory(File pDirectory)
Specified by:
setResourceTargetDirectory in interface Generator

setSchemaReader

public void setSchemaReader(SchemaReader pReader)
Sets the SchemaReader.
Specified by:
setSchemaReader in interface Generator

setSettingReadOnly

public void setSettingReadOnly(boolean pIsSettingReadOnly)
Sets whether the generator will create files in read-only mode.
Specified by:
setSettingReadOnly in interface Generator

setTargetDirectory

public void setTargetDirectory(File pDirectory)
Specified by:
setTargetDirectory in interface Generator

setValidating

public void setValidating(boolean pIsValidating)
Specified by:
setValidating in interface Generator