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.
| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected Hashtable | |
| protected String | |
| protected String | |
| protected Writer | |
| protected String | |
| protected Project |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | ProjectClassGenerator(Project project, String projectClassName, Writer outputWriter)
PUBLIC: Create a new generator to output to the writer. |
| public | ProjectClassGenerator(Project project, String projectClassName, String fileName)
PUBLIC: Create a new generator to output to the file. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addAggregateCollectionMappingLines(NonreflectiveMethodDefinition method, String mappingName, AggregateCollectionMapping mapping)
|
| protected void | addAggregateObjectMappingLines(NonreflectiveMethodDefinition method, String mappingName, AggregateObjectMapping mapping)
|
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | addDirectCollectionMappingLines(NonreflectiveMethodDefinition method, String mappingName, DirectCollectionMapping mapping)
|
| protected void | addDirectMapMappingLines(NonreflectiveMethodDefinition method, String mappingName, DirectMapMapping mapping)
|
| protected void | |
| protected void | addFetchGroupLines(NonreflectiveMethodDefinition method, FetchGroup fetchGroup, String fetchGroupIdentifier)
|
| protected void | |
| protected void | addForeignReferenceMappingLines(NonreflectiveMethodDefinition method, String mappingName, ForeignReferenceMapping mapping)
|
| protected void | |
| protected void | addHistoryPolicyLines(NonreflectiveMethodDefinition method, DirectCollectionMapping mapping, String mappingName)
|
| protected void | addHistoryPolicyLines(NonreflectiveMethodDefinition method, ManyToManyMapping mapping, String mappingName)
|
| protected void | addHistoryPolicyLines(NonreflectiveMethodDefinition method, HistoryPolicy policy, String policyName)
|
| protected void | |
| protected void | |
| protected void | addManyToManyMappingLines(NonreflectiveMethodDefinition method, String mappingName, ManyToManyMapping mapping)
|
| protected void | |
| protected void | addNamedQueryLines(NonreflectiveMethodDefinition method, DatabaseQuery query, DescriptorQueryManager queryManager, int iteration)
|
| protected void | addObjectTypeConverterLines(NonreflectiveMethodDefinition method, String converterName, ObjectTypeConverter converter)
|
| protected void | addOneToManyMappingLines(NonreflectiveMethodDefinition method, String mappingName, OneToManyMapping mapping)
|
| protected void | addOneToOneMappingLines(NonreflectiveMethodDefinition method, String mappingName, OneToOneMapping mapping)
|
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | addReturningPolicyLines(NonreflectiveMethodDefinition method, ReturningPolicy policy, String policyName)
|
| protected void | addTransformationMappingLines(NonreflectiveMethodDefinition method, String mappingName, TransformationMapping mapping)
|
| protected void | addTypeConversionConverterLines(NonreflectiveMethodDefinition method, String converterName, TypeConversionConverter converter)
|
| protected void | addVariableOneToOneMappingLines(NonreflectiveMethodDefinition method, String mappingName, VariableOneToOneMapping mapping)
|
| protected void | addXMLInteractionLines(NonreflectiveMethodDefinition method, XMLInteraction interaction, String variableName)
|
| protected String | buildBuilderString(String builderString, NonreflectiveMethodDefinition method, int iteration, String queryIdentifier)
|
| protected NonreflectiveMethodDefinition | |
| protected NonreflectiveMethodDefinition | |
| protected void | buildExpressionString(String builderString, NonreflectiveMethodDefinition method, String queryIdentifier, Expression exp, String attrString)
|
| protected NonreflectiveMethodDefinition | |
| private List | buildSortedListOfDescriptors(List<ClassDescriptor> descriptors)
Take an unsorted list of descriptors and sort it so that the order is maintained. |
| protected void | computeDescriptorMethodNames()
This figures out the best name for each descriptor, first using the local class name then the qualified one for duplicates. |
| private String | |
| public void | generate(boolean useUnicode)
PUBLIC: Generate the project class, output the java source code to the stream or file. |
| public void | |
| protected ClassDefinition | generateProjectClass()
Return a class definition object representing the code to be generated for the project and its descriptors. |
| public String | |
| protected Hashtable | |
| public String | |
| public String | |
| public Writer | |
| public String | |
| public Project | |
| protected String | |
| protected String | |
| public void | |
| protected String | |
| protected void | |
| public void | setOutputFileName(String newOutputFileName)
PUBLIC: Set the file name that the generate .java file will be output to. |
| public void | setOutputPath(String newOutputPath)
PUBLIC: Set the path that the generate .java file will be output to. |
| public void | |
| public void | |
| public void | |
| protected Vector | |
| public static void | |
| public static void |
| className | back to summary |
|---|---|
| protected String className | |
| descriptorMethodNames | back to summary |
|---|---|
| protected Hashtable<ClassDescriptor, String> descriptorMethodNames | |
| outputFileName | back to summary |
|---|---|
| protected String outputFileName | |
| outputPath | back to summary |
|---|---|
| protected String outputPath | |
| outputWriter | back to summary |
|---|---|
| protected Writer outputWriter | |
| packageName | back to summary |
|---|---|
| protected String packageName | |
| project | back to summary |
|---|---|
| protected Project project | |
| ProjectClassGenerator | back to summary |
|---|---|
| public ProjectClassGenerator() PUBLIC: Create a new generator. | |
| ProjectClassGenerator | back to summary |
|---|---|
| public ProjectClassGenerator(Project project) PUBLIC: Create a new generator to output the project. | |
| ProjectClassGenerator | back to summary |
|---|---|
| public ProjectClassGenerator(Project project, String projectClassName, Writer outputWriter) PUBLIC: Create a new generator to output to the writer. | |
| ProjectClassGenerator | back to summary |
|---|---|
| public ProjectClassGenerator(Project project, String projectClassName, String fileName) PUBLIC: Create a new generator to output to the file. | |
| addAggregateCollectionMappingLines | back to summary |
|---|---|
| protected void addAggregateCollectionMappingLines(NonreflectiveMethodDefinition method, String mappingName, AggregateCollectionMapping mapping) | |
| addAggregateObjectMappingLines | back to summary |
|---|---|
| protected void addAggregateObjectMappingLines(NonreflectiveMethodDefinition method, String mappingName, AggregateObjectMapping mapping) | |
| addCacheInvalidationPolicyLines | back to summary |
|---|---|
| protected void addCacheInvalidationPolicyLines(NonreflectiveMethodDefinition method, ClassDescriptor descriptor) | |
| addCMPPolicyLines | back to summary |
|---|---|
| protected void addCMPPolicyLines(NonreflectiveMethodDefinition method, CMPPolicy sourceCMPPolicy) | |
| addConverterLines | back to summary |
|---|---|
| protected void addConverterLines(NonreflectiveMethodDefinition method, String converterName, Converter converter) | |
| addDescriptorPropertyLines | back to summary |
|---|---|
| protected void addDescriptorPropertyLines(NonreflectiveMethodDefinition method, ClassDescriptor descriptor) | |
| addDirectCollectionMappingLines | back to summary |
|---|---|
| protected void addDirectCollectionMappingLines(NonreflectiveMethodDefinition method, String mappingName, DirectCollectionMapping mapping) | |
| addDirectMapMappingLines | back to summary |
|---|---|
| protected void addDirectMapMappingLines(NonreflectiveMethodDefinition method, String mappingName, DirectMapMapping mapping) | |
| addEventManagerPropertyLines | back to summary |
|---|---|
| protected void addEventManagerPropertyLines(NonreflectiveMethodDefinition method, ClassDescriptor descriptor) | |
| addFetchGroupLines | back to summary |
|---|---|
| protected void addFetchGroupLines(NonreflectiveMethodDefinition method, FetchGroup fetchGroup, String fetchGroupIdentifier) | |
| addFetchGroupManagerLine | back to summary |
|---|---|
| protected void addFetchGroupManagerLine(NonreflectiveMethodDefinition method, ClassDescriptor descriptor) | |
| addForeignReferenceMappingLines | back to summary |
|---|---|
| protected void addForeignReferenceMappingLines(NonreflectiveMethodDefinition method, String mappingName, ForeignReferenceMapping mapping) | |
| addHistoryPolicyLines | back to summary |
|---|---|
| protected void addHistoryPolicyLines(NonreflectiveMethodDefinition method, ClassDescriptor descriptor) | |
| addHistoryPolicyLines | back to summary |
|---|---|
| protected void addHistoryPolicyLines(NonreflectiveMethodDefinition method, DirectCollectionMapping mapping, String mappingName) | |
| addHistoryPolicyLines | back to summary |
|---|---|
| protected void addHistoryPolicyLines(NonreflectiveMethodDefinition method, ManyToManyMapping mapping, String mappingName) | |
| addHistoryPolicyLines | back to summary |
|---|---|
| protected void addHistoryPolicyLines(NonreflectiveMethodDefinition method, HistoryPolicy policy, String policyName) | |
| addInheritanceLines | back to summary |
|---|---|
| protected void addInheritanceLines(NonreflectiveMethodDefinition method, InheritancePolicy policy) | |
| addInterfaceLines | back to summary |
|---|---|
| protected void addInterfaceLines(NonreflectiveMethodDefinition method, InterfacePolicy policy) | |
| addManyToManyMappingLines | back to summary |
|---|---|
| protected void addManyToManyMappingLines(NonreflectiveMethodDefinition method, String mappingName, ManyToManyMapping mapping) | |
| addMappingLines | back to summary |
|---|---|
| protected void addMappingLines(NonreflectiveMethodDefinition method, DatabaseMapping mapping) | |
| addNamedQueryLines | back to summary |
|---|---|
| protected void addNamedQueryLines(NonreflectiveMethodDefinition method, DatabaseQuery query, DescriptorQueryManager queryManager, int iteration) | |
| addObjectTypeConverterLines | back to summary |
|---|---|
| protected void addObjectTypeConverterLines(NonreflectiveMethodDefinition method, String converterName, ObjectTypeConverter converter) | |
| addOneToManyMappingLines | back to summary |
|---|---|
| protected void addOneToManyMappingLines(NonreflectiveMethodDefinition method, String mappingName, OneToManyMapping mapping) | |
| addOneToOneMappingLines | back to summary |
|---|---|
| protected void addOneToOneMappingLines(NonreflectiveMethodDefinition method, String mappingName, OneToOneMapping mapping) | |
| addOptimisticLockingLines | back to summary |
|---|---|
| protected void addOptimisticLockingLines(NonreflectiveMethodDefinition method, OptimisticLockingPolicy policy) | |
| addQueryKeyLines | back to summary |
|---|---|
| protected void addQueryKeyLines(NonreflectiveMethodDefinition method, QueryKey queryKey) | |
| addQueryManagerPropertyLines | back to summary |
|---|---|
| protected void addQueryManagerPropertyLines(NonreflectiveMethodDefinition method, ClassDescriptor descriptor) | |
| addReturningPolicyLines | back to summary |
|---|---|
| protected void addReturningPolicyLines(NonreflectiveMethodDefinition method, ReturningPolicy policy) | |
| addReturningPolicyLines | back to summary |
|---|---|
| protected void addReturningPolicyLines(NonreflectiveMethodDefinition method, ReturningPolicy policy, String policyName) | |
| addTransformationMappingLines | back to summary |
|---|---|
| protected void addTransformationMappingLines(NonreflectiveMethodDefinition method, String mappingName, TransformationMapping mapping) | |
| addTypeConversionConverterLines | back to summary |
|---|---|
| protected void addTypeConversionConverterLines(NonreflectiveMethodDefinition method, String converterName, TypeConversionConverter converter) | |
| addVariableOneToOneMappingLines | back to summary |
|---|---|
| protected void addVariableOneToOneMappingLines(NonreflectiveMethodDefinition method, String mappingName, VariableOneToOneMapping mapping) | |
| addXMLInteractionLines | back to summary |
|---|---|
| protected void addXMLInteractionLines(NonreflectiveMethodDefinition method, XMLInteraction interaction, String variableName) | |
| buildBuilderString | back to summary |
|---|---|
| protected String buildBuilderString(String builderString, NonreflectiveMethodDefinition method, int iteration, String queryIdentifier) | |
| buildConstructor | back to summary |
|---|---|
| protected NonreflectiveMethodDefinition buildConstructor() | |
| buildDescriptorMethod | back to summary |
|---|---|
| protected NonreflectiveMethodDefinition buildDescriptorMethod(ClassDescriptor descriptor) | |
| buildExpressionString | back to summary |
|---|---|
| protected void buildExpressionString(String builderString, NonreflectiveMethodDefinition method, String queryIdentifier, Expression exp, String attrString) | |
| buildLoginMethod | back to summary |
|---|---|
| protected NonreflectiveMethodDefinition buildLoginMethod(Login datasourceLogin) | |
| buildSortedListOfDescriptors | back to summary |
|---|---|
| private List Take an unsorted list of descriptors and sort it so that the order is maintained. | |
| computeDescriptorMethodNames | back to summary |
|---|---|
| protected void computeDescriptorMethodNames() This figures out the best name for each descriptor, first using the local class name then the qualified one for duplicates. | |
| constructValidSQLorEJBQLLinesForJavaSource | back to summary |
|---|---|
| private String constructValidSQLorEJBQLLinesForJavaSource(String qlString) | |
| generate | back to summary |
|---|---|
| public void generate(boolean useUnicode) throws ValidationException PUBLIC: Generate the project class, output the java source code to the stream or file. useUnicode determines if unicode escaped characters for non_ASCII charaters will be used. | |
| generate | back to summary |
|---|---|
| public void generate() throws ValidationException PUBLIC: Generate the project class, output the java source code to the stream or file. Unicode escaped characters for non_ASCII charaters will be used. | |
| generateProjectClass | back to summary |
|---|---|
| protected ClassDefinition generateProjectClass() Return a class definition object representing the code to be generated for the project and its descriptors. This class will have one method per descriptor and its toString can be used to convert it to code. | |
| getClassName | back to summary |
|---|---|
| public String getClassName() PUBLIC: Return the name of class to be generated. This is the unqualified name. | |
| getDescriptorMethodNames | back to summary |
|---|---|
| protected Hashtable | |
| getOutputFileName | back to summary |
|---|---|
| public String getOutputFileName() PUBLIC: Return the file name that the generate .java file will be output to. | |
| getOutputPath | back to summary |
|---|---|
| public String getOutputPath() PUBLIC: Return the path that the generate .java file will be output to. | |
| getOutputWriter | back to summary |
|---|---|
| public Writer getOutputWriter() PUBLIC: Return the writer the output to. | |
| getPackageName | back to summary |
|---|---|
| public String getPackageName() PUBLIC: Return the package name of class to be generated. | |
| getProject | back to summary |
|---|---|
| public Project getProject() PUBLIC: Return the project to generate from. | |
| printString | back to summary |
|---|---|
| protected String printString(Object value) Return the printed version of the primitive value object. This must determine the class and use the correct constructor arguments. | |
| removeDots | back to summary |
|---|---|
| protected String removeDots(String packageName) | |
| setClassName | back to summary |
|---|---|
| public void setClassName(String newClassName) PUBLIC: Set the name of class to be generated. This can be qualified or unqualified name and will set the file name to match. | |
| setDefaultOrAddSequenceString | back to summary |
|---|---|
| protected String setDefaultOrAddSequenceString(Sequence sequence, boolean isSetDefault) | |
| setDescriptorMethodNames | back to summary |
|---|---|
| protected void setDescriptorMethodNames(Hashtable<ClassDescriptor, String> descriptorMethodNames) | |
| setOutputFileName | back to summary |
|---|---|
| public void setOutputFileName(String newOutputFileName) PUBLIC: Set the file name that the generate .java file will be output to. If the file does not include .java it will be appended. | |
| setOutputPath | back to summary |
|---|---|
| public void setOutputPath(String newOutputPath) PUBLIC: Set the path that the generate .java file will be output to. | |
| setOutputWriter | back to summary |
|---|---|
| public void setOutputWriter(Writer outputWriter) PUBLIC: Set the writer the output to. | |
| setPackageName | back to summary |
|---|---|
| public void setPackageName(String newPackageName) PUBLIC: Set the package name of class to be generated. | |
| setProject | back to summary |
|---|---|
| public void setProject(Project newProject) PUBLIC: Set the project to generate from. All of the projects descriptors will be stored into the file. | |
| sortMappings | back to summary |
|---|---|
| protected Vector Short the mappings by type. | |
| write | back to summary |
|---|---|
| public static void write(Project project, String projectClassName, Writer writer) PUBLIC: Generate the source code to a project class to the project's descriptor into the writer. | |
| write | back to summary |
|---|---|
| public static void write(Project project, String projectClassName, String fileName) PUBLIC: Generate the source code to a project class to the project's descriptor into the file. | |