|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.generator.ConfigurableImpl de.ispsoft.jaxme.generator.SourceWriterImpl
A base class for implementing SourceWriters.
Field Summary | |
protected java.io.File |
directory
|
protected Generator |
generator
|
protected java.lang.String |
javaPackage
|
Constructor Summary | |
SourceWriterImpl()
Creates a new instance of SourceWriterImpl. |
Method Summary | |
java.io.File |
getDirectory()
Returns the directory where the SourceWriter will generate files. |
Generator |
getGenerator()
Returns the generator. |
java.lang.String |
getJavaPackage()
Sets the default Java package for generated sources. |
java.lang.String |
getOption(SchemaElement pElement,
java.lang.String pName)
Returns a value for an option. |
java.util.Date |
getSchemaDate()
Returns the time and date when the schema was created. |
JavaSource |
newJavaSource(SchemaComplexElement pElement,
java.lang.String pPackage,
java.lang.String pClass,
java.lang.String pProtection)
Creates a new JavaSource object. |
void |
setDirectory(java.io.File pDirectory)
Sets the directory where the SourceWriter will generate files. |
void |
setGenerator(Generator g)
Sets the generator. |
void |
setJavaPackage(java.lang.String pPackage)
Sets the default Java package for generated sources. |
void |
setSchemaDate(java.util.Date pDate)
Sets the time and date when the schema was created, May be null, if unknown. |
void |
write(Schema pSchema)
Called for writing a complete schema. |
abstract void |
write(SchemaElement pElement)
Called for writing a single schema element. |
void |
writeFile(java.io.File pDir,
java.lang.String pFileName,
java.lang.String pContents)
Writes a text file. |
void |
writeJavaSourceFile(java.io.File pDir,
JavaSource pJs)
Writes a JavaSource file. |
Methods inherited from class de.ispsoft.jaxme.generator.ConfigurableImpl |
getOption, getOptions, getOptionValue, setOption |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.ispsoft.jaxme.generator.Configurable |
getOption, getOptions, getOptionValue, setOption |
Field Detail |
protected java.io.File directory
protected java.lang.String javaPackage
protected Generator generator
Constructor Detail |
public SourceWriterImpl()
Method Detail |
public void write(Schema pSchema) throws java.lang.Exception
Called for writing a complete schema.
write
in interface SourceWriter
java.lang.Exception
public abstract void write(SchemaElement pElement) throws java.lang.Exception
Called for writing a single schema element. Concrete subclasses must implement this method.
write
in interface SourceWriter
java.lang.Exception
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.
getDirectory
in interface SourceWriter
setDirectory(java.io.File)
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.
setDirectory
in interface SourceWriter
pDirectory
- The target directory or null (current directory, default)getDirectory()
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.
setJavaPackage
in interface SourceWriter
java.lang.Exception
public java.lang.String getJavaPackage() throws java.lang.Exception
Sets the default Java package for generated sources. Probably useful for the JavaSourceWriter only.
getJavaPackage
in interface SourceWriter
java.lang.Exception
public java.lang.String getOption(SchemaElement pElement, java.lang.String pName)
Returns a value for an option.
public JavaSource newJavaSource(SchemaComplexElement pElement, java.lang.String pPackage, java.lang.String pClass, java.lang.String pProtection)
Creates a new JavaSource object.
public void setSchemaDate(java.util.Date pDate)
Sets the time and date when the schema was created, May be null, if unknown.
setSchemaDate
in interface SourceWriter
public java.util.Date getSchemaDate()
Returns the time and date when the schema was created. May be null, if unknown.
public void setGenerator(Generator g)
Sets the generator.
public Generator getGenerator()
Returns the generator.
public void writeFile(java.io.File pDir, java.lang.String pFileName, java.lang.String pContents) throws java.io.IOException
Writes a text file.
java.io.IOException
public void writeJavaSourceFile(java.io.File pDir, JavaSource pJs) throws java.io.IOException
Writes a JavaSource file.
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |