|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.gen.ClassGenerator
public class ClassGenerator
Class generation engine for ObjEntities based on Velocity templates . Instance of ClassGenerationInfo is available inside Velocity template under the key "classGen".
Field Summary | |
---|---|
protected ClassGenerationInfo |
classGenerationInfo
|
protected org.apache.velocity.Template |
classTemplate
|
protected org.apache.velocity.context.Context |
velCtxt
|
static java.lang.String |
VERSION_1_1
|
static java.lang.String |
VERSION_1_2
|
protected java.lang.String |
versionString
|
Constructor Summary | |
---|---|
ClassGenerator(java.lang.String template)
Deprecated. Since 1.2 use ClassGenerator(String template, String versionString) instead. |
|
ClassGenerator(java.lang.String template,
java.lang.String versionString)
Creates a new ClassGenerationInfo that uses a specified Velocity template. |
|
ClassGenerator(java.lang.String template,
java.lang.String versionString,
foundrylogic.vpp.VPPConfig vppConfig)
Creates a new ClassGenerationInfo that uses a specified Velocity template. |
Method Summary | |
---|---|
static void |
bootstrapVelocity(java.lang.Class cl)
Deprecated. since 1.2, as now Cayenne uses thread ClassLoader. |
java.lang.String |
capitalized(java.lang.String name)
Deprecated. Since 1.2 use getClassGenerationInfo().capitalized(String) |
java.lang.String |
capitalizedAsConstant(java.lang.String name)
Deprecated. Since 1.2 use getClassGenerationInfo().capitalizedAsConstant(String) |
java.lang.String |
formatJavaType(java.lang.String type)
Deprecated. use getClassGenerationInfo().formatJavaType(String) |
java.lang.String |
formatVariableName(java.lang.String variableName)
Deprecated. Since 1.2 use getClassGenerationInfo().formatVariableName(String) |
void |
generateClass(java.io.Writer out,
DataMap dataMap,
ObjEntity entity,
java.lang.String fqnBaseClass,
java.lang.String fqnSuperClass,
java.lang.String fqnSubClass)
Generates Java code for the ObjEntity. |
void |
generateClass(java.io.Writer out,
ObjEntity entity)
Generates Java code for the ObjEntity. |
java.lang.String |
getCappedProp()
Deprecated. Since 1.2 use getClassGenerationInfo().getCappedProp() |
ClassGenerationInfo |
getClassGenerationInfo()
|
java.lang.String |
getClassName()
Deprecated. Since 1.2 use getClassGenerationInfo().getClassName() |
ObjEntity |
getEntity()
Deprecated. Since 1.2 use getClassGenerationInfo().getEntity() |
java.lang.String |
getPackageName()
Deprecated. Since 1.2 use getClassGenerationInfo().getPackageName() |
java.lang.String |
getProp()
Deprecated. Since 1.2 use getClassGenerationInfo().getProp() |
java.lang.String |
getPropAsConstantName()
Deprecated. Since 1.2 use getClassGenerationInfo().getPropAsConstantName() |
java.lang.String |
getSuperClassName()
Deprecated. Since 1.2 use getClassGenerationInfo().getSuperClassName() |
java.lang.String |
getSuperPackageName()
Deprecated. Since 1.2 use getClassGenerationInfo().getSuperPackageName() |
java.lang.String |
getSuperPrefix()
Deprecated. Since 1.2 use getClassGenerationInfo().getSuperPrefix() |
boolean |
isContainingListProperties()
Deprecated. Since 1.2 use getClassGenerationInfo().isContainingListProperties() |
boolean |
isUsingPackage()
Deprecated. Since 1.2 use getClassGenerationInfo().isUsingPackage() |
boolean |
isUsingSuperPackage()
Deprecated. Since 1.2 use getClassGenerationInfo().isUsingSuperPackage() |
void |
setClassName(java.lang.String className)
Deprecated. Since 1.2 use getClassGenerationInfo().setClassName() |
void |
setPackageName(java.lang.String packageName)
Deprecated. Since 1.2 use getClassGenerationInfo().setPackageName() |
void |
setProp(java.lang.String prop)
Deprecated. Since 1.2 use getClassGenerationInfo().setProp(String) |
void |
setSuperClassName(java.lang.String value)
Deprecated. Since 1.2 use getClassGenerationInfo().setSuperClassName() |
void |
setSuperPackageName(java.lang.String superPackageName)
Deprecated. Since 1.2 use getClassGenerationInfo().setSuperPackageName() |
void |
setSuperPrefix(java.lang.String superPrefix)
Deprecated. Since 1.2 use getClassGenerationInfo().setSuperPrefix() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION_1_1
public static final java.lang.String VERSION_1_2
protected java.lang.String versionString
protected org.apache.velocity.Template classTemplate
protected org.apache.velocity.context.Context velCtxt
protected ClassGenerationInfo classGenerationInfo
Constructor Detail |
---|
public ClassGenerator(java.lang.String template) throws java.lang.Exception
java.lang.Exception
public ClassGenerator(java.lang.String template, java.lang.String versionString) throws java.lang.Exception
template
- to useversionString
- of cgen
java.lang.Exception
public ClassGenerator(java.lang.String template, java.lang.String versionString, foundrylogic.vpp.VPPConfig vppConfig) throws java.lang.Exception
template
- to useversionString
- of cgenvppConfig
- for configuring VelocityEngine and VelocityContext
java.lang.Exception
Method Detail |
---|
public static final void bootstrapVelocity(java.lang.Class cl)
public void generateClass(java.io.Writer out, ObjEntity entity) throws java.lang.Exception
java.lang.Exception
public void generateClass(java.io.Writer out, DataMap dataMap, ObjEntity entity, java.lang.String fqnBaseClass, java.lang.String fqnSuperClass, java.lang.String fqnSubClass) throws java.lang.Exception
java.lang.Exception
public ClassGenerationInfo getClassGenerationInfo()
public java.lang.String getPackageName()
public void setPackageName(java.lang.String packageName)
public void setSuperPackageName(java.lang.String superPackageName)
superPackageName
property that defines a superclass's package
name.
public java.lang.String getClassName()
public void setClassName(java.lang.String className)
public void setSuperClassName(java.lang.String value)
public void setSuperPrefix(java.lang.String superPrefix)
public java.lang.String getSuperPackageName()
superPackageName
property that defines a superclass's
package name.
public java.lang.String formatJavaType(java.lang.String type)
public java.lang.String formatVariableName(java.lang.String variableName)
public java.lang.String getSuperPrefix()
public void setProp(java.lang.String prop)
public java.lang.String getProp()
public java.lang.String capitalized(java.lang.String name)
public java.lang.String capitalizedAsConstant(java.lang.String name)
public java.lang.String getCappedProp()
public java.lang.String getPropAsConstantName()
public boolean isContainingListProperties()
public boolean isUsingPackage()
true
if a class associated with this generator is located in
a package.
public boolean isUsingSuperPackage()
true
if a superclass class associated with this generator is
located in a package.
public ObjEntity getEntity()
public java.lang.String getSuperClassName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |