de.ispsoft.jaxme.generator
Interface SourceWriter

All Superinterfaces:
Configurable
All Known Implementing Classes:
SourceWriterImpl

public interface SourceWriter
extends Configurable

A SourceWriter is called by the Generator. It's task is creating some sources. Examples are

JavaGenerator Creates Java classes that are responsible for the actual XML mapping.

DtdGenerator Creates a DTD matching the schema.

Author:
Jochen Wiedmann

Method Summary
 java.io.File getDirectory()
          Returns the directory where the SourceWriter will generate files.
 java.lang.String getJavaPackage()
          Returns the default Java package for generated sources.
 void setDirectory(java.io.File pDirectory)
          Sets the directory where the SourceWriter will generate files.
 void setJavaPackage(java.lang.String pPackage)
          Sets the default Java package for generated sources.
 void setSchemaDate(java.util.Date pDate)
          Sets time and date when the schema was created.
 void write(Schema pSchema)
          Called for writing a complete schema.
 void write(SchemaElement pElement)
          Called for writing a single schema element.
 
Methods inherited from interface de.ispsoft.jaxme.generator.Configurable
getOption, getOptions, getOptionValue, setOption
 

Method Detail

getDirectory

public java.io.File getDirectory()

Returns the directory where the SourceWriter will generate files. The actual generation may happen in subdirectories, for example in the case of the JavaGenerator the package structure will be considered.

Returns:
The target directory or null (current directory, default)
See Also:
setDirectory(java.io.File)

setDirectory

public void setDirectory(java.io.File pDirectory)

Sets the directory where the SourceWriter will generate files. The actual generation may happen in subdirectories, for example in the case of the JavaGenerator the package structure will be considered.

Parameters:
pDirectory - The target directory or null (current directory, default)
See Also:
getDirectory()

write

public void write(Schema pSchema)
           throws java.lang.Exception

Called for writing a complete schema.

Throws:
java.lang.Exception

write

public void write(SchemaElement pElement)
           throws java.lang.Exception

Called for writing a single schema element.

Throws:
java.lang.Exception

setJavaPackage

public void setJavaPackage(java.lang.String pPackage)
                    throws java.lang.Exception

Sets the default Java package for generated sources. Probably useful for the JavaSourceWriter only.

Throws:
java.lang.Exception

getJavaPackage

public java.lang.String getJavaPackage()
                                throws java.lang.Exception

Returns the default Java package for generated sources. Probably useful for the JavaSourceWriter only.

Throws:
java.lang.Exception

setSchemaDate

public void setSchemaDate(java.util.Date pDate)

Sets time and date when the schema was created. May be null, if unknown.