|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.sessions.factories.ProjectClassGenerator
public class ProjectClassGenerator
Purpose: Allow for a class storing a TopLink project's descriptors (meta-data) to be generated. This class can then be used at runtime to deploy the TopLink descriptor's instead of XML files.
Field Summary | |
---|---|
protected java.lang.String |
className
|
protected java.util.Hashtable |
descriptorMethodNames
|
protected java.lang.String |
outputFileName
|
protected java.lang.String |
outputPath
|
protected java.io.Writer |
outputWriter
|
protected java.lang.String |
packageName
|
protected Project |
project
|
Constructor Summary | |
---|---|
ProjectClassGenerator()
PUBLIC: Create a new generator. |
|
ProjectClassGenerator(Project project)
PUBLIC: Create a new generator to output the project. |
|
ProjectClassGenerator(Project project,
java.lang.String projectClassName,
java.lang.String fileName)
PUBLIC: Create a new generator to output to the file. |
|
ProjectClassGenerator(Project project,
java.lang.String projectClassName,
java.io.Writer outputWriter)
PUBLIC: Create a new generator to output to the writer. |
Method Summary | |
---|---|
protected void |
addAggregateCollectionMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
AggregateCollectionMapping mapping)
|
protected void |
addAggregateObjectMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
AggregateObjectMapping mapping)
|
protected void |
addCacheInvalidationPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
ClassDescriptor descriptor)
|
protected void |
addCMPPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
CMPPolicy sourceCMPPolicy)
|
protected void |
addConverterLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String converterName,
Converter converter)
|
protected void |
addDescriptorPropertyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
ClassDescriptor descriptor)
|
protected void |
addDirectCollectionMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
DirectCollectionMapping mapping)
|
protected void |
addDirectMapMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
DirectMapMapping mapping)
|
protected void |
addEventManagerPropertyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
ClassDescriptor descriptor)
|
protected void |
addFetchGroupLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
FetchGroup fetchGroup,
java.lang.String fetchGroupIdentifier)
|
protected void |
addFetchGroupManagerLine(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
ClassDescriptor descriptor)
|
protected void |
addForeignReferenceMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
ForeignReferenceMapping mapping)
|
protected void |
addHistoryPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
ClassDescriptor descriptor)
|
protected void |
addHistoryPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
DirectCollectionMapping mapping,
java.lang.String mappingName)
|
protected void |
addHistoryPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
HistoryPolicy policy,
java.lang.String policyName)
|
protected void |
addHistoryPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
ManyToManyMapping mapping,
java.lang.String mappingName)
|
protected void |
addInheritanceLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
InheritancePolicy policy)
|
protected void |
addInterfaceLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
InterfacePolicy policy)
|
protected void |
addManyToManyMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
ManyToManyMapping mapping)
|
protected void |
addMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
DatabaseMapping mapping)
|
protected void |
addNamedQueryLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
DatabaseQuery query,
DescriptorQueryManager queryManager,
int iteration)
|
protected void |
addObjectTypeConverterLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String converterName,
ObjectTypeConverter converter)
|
protected void |
addOneToManyMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
OneToManyMapping mapping)
|
protected void |
addOneToOneMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
OneToOneMapping mapping)
|
protected void |
addOptimisticLockingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy policy)
|
protected void |
addQueryKeyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
QueryKey queryKey)
|
protected void |
addQueryManagerPropertyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
ClassDescriptor descriptor)
|
protected void |
addReturningPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
ReturningPolicy policy)
|
protected void |
addReturningPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
ReturningPolicy policy,
java.lang.String policyName)
|
protected void |
addTransformationMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
TransformationMapping mapping)
|
protected void |
addTypeConversionConverterLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String converterName,
TypeConversionConverter converter)
|
protected void |
addVariableOneToOneMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String mappingName,
VariableOneToOneMapping mapping)
|
protected void |
addXMLInteractionLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
XMLInteraction interaction,
java.lang.String variableName)
|
protected java.lang.String |
buildBuilderString(java.lang.String builderString,
org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
int iteration,
java.lang.String queryIdentifier)
|
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition |
buildConstructor()
|
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition |
buildDescriptorMethod(ClassDescriptor descriptor)
|
protected void |
buildExpressionString(java.lang.String builderString,
org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method,
java.lang.String queryIdentifier,
Expression exp,
java.lang.String attrString)
|
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition |
buildLoginMethod(Login datasourceLogin)
|
protected void |
computeDescriptorMethodNames()
This figures out the best name for each descriptor, first using the local class name then the qualified one for duplicates. |
void |
generate()
PUBLIC: Generate the project class, output the java source code to the stream or file. |
void |
generate(boolean useUnicode)
PUBLIC: Generate the project class, output the java source code to the stream or file. |
protected org.eclipse.persistence.internal.codegen.ClassDefinition |
generateProjectClass()
Return a class definition object representing the code to be generated for the project and its descriptors. |
java.lang.String |
getClassName()
PUBLIC: Return the name of class to be generated. |
protected java.util.Hashtable |
getDescriptorMethodNames()
|
java.lang.String |
getOutputFileName()
PUBLIC: Return the file name that the generate .java file will be output to. |
java.lang.String |
getOutputPath()
PUBLIC: Return the path that the generate .java file will be output to. |
java.io.Writer |
getOutputWriter()
PUBLIC: Return the writer the output to. |
java.lang.String |
getPackageName()
PUBLIC: Return the package name of class to be generated. |
Project |
getProject()
PUBLIC: Return the project to generate from. |
protected java.lang.String |
printString(java.lang.Object value)
Return the printed version of the primitive value object. |
protected java.lang.String |
removeDots(java.lang.String packageName)
|
void |
setClassName(java.lang.String newClassName)
PUBLIC: Set the name of class to be generated. |
protected java.lang.String |
setDefaultOrAddSequenceString(Sequence sequence,
boolean isSetDefault)
|
protected void |
setDescriptorMethodNames(java.util.Hashtable descriptorMethodNames)
|
void |
setOutputFileName(java.lang.String newOutputFileName)
PUBLIC: Set the file name that the generate .java file will be output to. |
void |
setOutputPath(java.lang.String newOutputPath)
PUBLIC: Set the path that the generate .java file will be output to. |
void |
setOutputWriter(java.io.Writer outputWriter)
PUBLIC: Set the writer the output to. |
void |
setPackageName(java.lang.String newPackageName)
PUBLIC: Set the package name of class to be generated. |
void |
setProject(Project newProject)
PUBLIC: Set the project to generate from. |
protected java.util.Vector |
sortMappings(java.util.Vector mappings)
Short the mappings by type. |
static void |
write(Project project,
java.lang.String projectClassName,
java.lang.String fileName)
PUBLIC: Generate the source code to a project class to the project's descriptor into the file. |
static void |
write(Project project,
java.lang.String projectClassName,
java.io.Writer writer)
PUBLIC: Generate the source code to a project class to the project's descriptor into the writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String className
protected java.lang.String packageName
protected java.lang.String outputPath
protected java.lang.String outputFileName
protected java.io.Writer outputWriter
protected Project project
protected java.util.Hashtable descriptorMethodNames
Constructor Detail |
---|
public ProjectClassGenerator()
public ProjectClassGenerator(Project project)
public ProjectClassGenerator(Project project, java.lang.String projectClassName, java.io.Writer outputWriter)
public ProjectClassGenerator(Project project, java.lang.String projectClassName, java.lang.String fileName)
Method Detail |
---|
protected void addAggregateCollectionMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, AggregateCollectionMapping mapping)
protected void addAggregateObjectMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, AggregateObjectMapping mapping)
protected void addCacheInvalidationPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, ClassDescriptor descriptor)
protected void addCMPPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, CMPPolicy sourceCMPPolicy)
protected void addDescriptorPropertyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, ClassDescriptor descriptor)
protected void addDirectCollectionMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, DirectCollectionMapping mapping)
protected void addDirectMapMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, DirectMapMapping mapping)
protected void addFetchGroupManagerLine(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, ClassDescriptor descriptor)
protected void addFetchGroupLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, FetchGroup fetchGroup, java.lang.String fetchGroupIdentifier)
protected void addEventManagerPropertyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, ClassDescriptor descriptor)
protected void addForeignReferenceMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, ForeignReferenceMapping mapping)
protected void addHistoryPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, ClassDescriptor descriptor)
protected void addHistoryPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, DirectCollectionMapping mapping, java.lang.String mappingName)
protected void addHistoryPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, ManyToManyMapping mapping, java.lang.String mappingName)
protected void addHistoryPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, HistoryPolicy policy, java.lang.String policyName)
protected void addInheritanceLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, InheritancePolicy policy)
protected void addInterfaceLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, InterfacePolicy policy)
protected void addManyToManyMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, ManyToManyMapping mapping)
protected void addMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, DatabaseMapping mapping)
protected void addObjectTypeConverterLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String converterName, ObjectTypeConverter converter)
protected void addOneToManyMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, OneToManyMapping mapping)
protected void addOneToOneMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, OneToOneMapping mapping)
protected void addOptimisticLockingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy policy)
protected void addQueryKeyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, QueryKey queryKey)
protected void addQueryManagerPropertyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, ClassDescriptor descriptor)
protected void addXMLInteractionLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, XMLInteraction interaction, java.lang.String variableName)
protected void addNamedQueryLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, DatabaseQuery query, DescriptorQueryManager queryManager, int iteration)
protected java.lang.String buildBuilderString(java.lang.String builderString, org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, int iteration, java.lang.String queryIdentifier)
protected void buildExpressionString(java.lang.String builderString, org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String queryIdentifier, Expression exp, java.lang.String attrString)
protected void addReturningPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, ReturningPolicy policy)
protected void addReturningPolicyLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, ReturningPolicy policy, java.lang.String policyName)
protected void addTransformationMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, TransformationMapping mapping)
protected void addConverterLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String converterName, Converter converter)
protected void addTypeConversionConverterLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String converterName, TypeConversionConverter converter)
protected void addVariableOneToOneMappingLines(org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition method, java.lang.String mappingName, VariableOneToOneMapping mapping)
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition buildConstructor()
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition buildDescriptorMethod(ClassDescriptor descriptor)
protected org.eclipse.persistence.internal.codegen.NonreflectiveMethodDefinition buildLoginMethod(Login datasourceLogin)
protected java.lang.String setDefaultOrAddSequenceString(Sequence sequence, boolean isSetDefault)
protected void computeDescriptorMethodNames()
public void generate(boolean useUnicode) throws ValidationException
ValidationException
public void generate() throws ValidationException
ValidationException
protected org.eclipse.persistence.internal.codegen.ClassDefinition generateProjectClass()
public java.lang.String getClassName()
protected java.util.Hashtable getDescriptorMethodNames()
public java.lang.String getOutputFileName()
public java.lang.String getOutputPath()
public java.io.Writer getOutputWriter()
public java.lang.String getPackageName()
public Project getProject()
protected java.lang.String printString(java.lang.Object value)
protected java.lang.String removeDots(java.lang.String packageName)
public void setClassName(java.lang.String newClassName)
protected void setDescriptorMethodNames(java.util.Hashtable descriptorMethodNames)
public void setOutputFileName(java.lang.String newOutputFileName)
public void setOutputPath(java.lang.String newOutputPath)
public void setOutputWriter(java.io.Writer outputWriter)
public void setPackageName(java.lang.String newPackageName)
public void setProject(Project newProject)
protected java.util.Vector sortMappings(java.util.Vector mappings)
public static void write(Project project, java.lang.String projectClassName, java.io.Writer writer)
public static void write(Project project, java.lang.String projectClassName, java.lang.String fileName)
|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |