public class TableCreatorClassGenerator extends Object
Purpose: Allow for a class storing a TopLink table creator's tables (meta-data) to be generated. This class can then be used at runtime to (re)create a project's database schema.
Modifier and Type | Field and Description |
---|---|
protected String |
className |
protected String |
outputFileName |
protected String |
outputPath |
protected Writer |
outputWriter |
protected String |
packageName |
protected TableCreator |
tableCreator |
Constructor and Description |
---|
TableCreatorClassGenerator()
PUBLIC:
Create a new generator.
|
TableCreatorClassGenerator(TableCreator tableCreator)
PUBLIC:
Create a new generator to output the table creator.
|
TableCreatorClassGenerator(TableCreator tableCreator,
String projectClassName,
String fileName)
PUBLIC:
Create a new generator to output the table creator.
|
TableCreatorClassGenerator(TableCreator tableCreator,
String projectClassName,
Writer outputWriter)
PUBLIC:
Create a new generator to output the table creator.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addFieldLines(FieldDefinition field,
org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method) |
protected void |
addForeignKeyLines(ForeignKeyConstraint foreignKey,
org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method) |
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition |
buildConstructor() |
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition |
buildLoginMethod(DatabaseLogin login) |
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition |
buildTableMethod(TableDefinition table) |
void |
generate()
PUBLIC:
Generate the project class, output the java source code to the stream or file.
|
void |
generate(boolean useUnicode)
PUBLIC:
Generate the creator class, output the java source code to the stream or file.
|
protected org.eclipse.persistence.internal.codegen.ClassDefinition |
generateCreatorClass()
Return a class definition object representing the code to be generated for the table creator.
|
String |
getClassName()
PUBLIC:
Return the name of class to be generated.
|
String |
getOutputFileName()
PUBLIC:
Return the file name that the generate .java file will be output to.
|
String |
getOutputPath()
PUBLIC:
Return the path that the generate .java file will be output to.
|
Writer |
getOutputWriter()
PUBLIC:
Return the writer the output to.
|
String |
getPackageName()
PUBLIC:
Return the package name of class to be generated.
|
TableCreator |
getTableCreator()
PUBLIC:
Return the table creator to generate from.
|
protected String |
printString(Object value)
Return the printed version of the primitive value object.
|
protected String |
removeDots(String packageName) |
void |
setClassName(String newClassName)
PUBLIC:
Set the name of class to be generated.
|
void |
setOutputFileName(String newOutputFileName)
PUBLIC:
Set the file name that the generate .java file will be output to.
|
void |
setOutputPath(String newOutputPath)
PUBLIC:
Set the path that the generate .java file will be output to.
|
void |
setOutputWriter(Writer outputWriter)
PUBLIC:
Set the writer the output to.
|
void |
setPackageName(String newPackageName)
PUBLIC:
Set the package name of class to be generated.
|
void |
setTableCreator(TableCreator tableCreator)
PUBLIC:
Set the table creator to generate from.
|
static void |
write(TableCreator tableCreator,
String creatorClassName,
String fileName)
PUBLIC:
Generate the source code to a table creator class to the table creator's tables into the file.
|
static void |
write(TableCreator tableCreator,
String creatorClassName,
Writer writer)
PUBLIC:
Generate the source code to a table creator class to the table creator's tables into the writer.
|
protected String className
protected String packageName
protected String outputPath
protected String outputFileName
protected Writer outputWriter
protected TableCreator tableCreator
public TableCreatorClassGenerator()
public TableCreatorClassGenerator(TableCreator tableCreator)
public TableCreatorClassGenerator(TableCreator tableCreator, String projectClassName, Writer outputWriter)
public TableCreatorClassGenerator(TableCreator tableCreator, String projectClassName, String fileName)
protected void addFieldLines(FieldDefinition field, org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method)
protected void addForeignKeyLines(ForeignKeyConstraint foreignKey, org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method)
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition buildConstructor()
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition buildLoginMethod(DatabaseLogin login)
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition buildTableMethod(TableDefinition table)
public void generate(boolean useUnicode) throws ValidationException
ValidationException
public void generate() throws ValidationException
ValidationException
protected org.eclipse.persistence.internal.codegen.ClassDefinition generateCreatorClass()
public String getClassName()
public String getOutputFileName()
public String getOutputPath()
public Writer getOutputWriter()
public String getPackageName()
public TableCreator getTableCreator()
protected String printString(Object value)
public void setClassName(String newClassName)
public void setOutputFileName(String newOutputFileName)
public void setOutputPath(String newOutputPath)
public void setOutputWriter(Writer outputWriter)
public void setPackageName(String newPackageName)
public void setTableCreator(TableCreator tableCreator)
public static void write(TableCreator tableCreator, String creatorClassName, Writer writer)
public static void write(TableCreator tableCreator, String creatorClassName, String fileName)
Copyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.