|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jdo.spi.persistence.utility.JavaTypeHelper
com.sun.jdo.spi.persistence.utility.generator.JavaClassWriterHelper
public class JavaClassWriterHelper
| Field Summary | |
|---|---|
static java.lang.String |
boolean_
|
static java.lang.String |
brackets_
|
static java.lang.String |
byte_
|
static java.lang.String |
byteArray_
|
static java.lang.String |
Class_
|
static java.lang.String |
Collection_
|
static java.lang.String |
Date_
|
static java.lang.String |
delim_
|
static java.lang.String |
dot_
|
static java.lang.String |
endLine_
|
static java.lang.String |
escapedEmptyString_
|
static java.lang.String |
false_
|
static java.lang.String |
fileName_
|
static java.lang.String |
get_
|
static java.lang.String |
Helper_
|
static java.lang.String |
home_
|
static java.lang.String |
int_
|
static java.lang.String |
javaExtension_
|
static java.lang.String |
new_
|
static java.lang.String |
none_
|
static java.lang.String |
null_
|
static java.lang.String |
Object_
|
static java.lang.String |
Oid_
|
static java.lang.String |
param_
|
static java.lang.String |
param0_
|
static java.lang.String |
paramConcatenator_
|
static java.lang.String |
paramInitializer_
|
static java.lang.String |
paramList_
|
static java.lang.String |
paramSeparator_
|
static java.lang.String |
parenleft_
|
static java.lang.String |
parenright_
|
static java.lang.String |
parenthesis_
|
static java.lang.String |
PersistenceCapable_
|
static java.lang.String |
returnNull_
|
static java.lang.String |
set_
|
static java.lang.String |
Set_
|
static java.lang.String |
space_
|
static java.lang.String |
SqlDate_
|
static java.lang.String |
SqlTime_
|
static java.lang.String |
SqlTimestamp_
|
static java.lang.String |
String_
|
static java.lang.String[] |
super_
|
static java.lang.String |
true_
|
static java.lang.String |
void_
|
| Constructor Summary | |
|---|---|
JavaClassWriterHelper()
|
|
| Method Summary | |
|---|---|
static void |
addFields(java.lang.String prop,
int modifiers,
JavaClassWriter writer)
Adds fields to a class parsing the multi-String property. |
static void |
addGenericMethod(java.lang.reflect.Method m,
java.lang.String mname,
java.lang.String mtype,
java.lang.String body,
JavaClassWriter writer)
Adds a method to a class parsing the multi-String property. |
static void |
addGenericMethod(java.lang.String mname,
int modifiers,
java.lang.String[] body,
JavaClassWriter writer)
Adds a private void no-args method to a class with this method body and modifiers. |
static void |
addGenericMethod(java.lang.String mname,
int modifiers,
java.lang.String type,
java.lang.String[] body,
JavaClassWriter writer)
Adds a private void no-args method to a class with this method body, modifiers, and return type. |
static void |
addGenericMethod(java.lang.String mname,
java.lang.String[] body,
JavaClassWriter writer)
Adds a private void no-args method to a class with this method body. |
static void |
addGenericMethod(java.lang.String mname,
java.lang.String type,
java.lang.String[] body,
JavaClassWriter writer)
Adds a private no-args method to a class with this method body and return type. |
static void |
addPrivateField(java.lang.String prop,
int modifiers,
JavaClassWriter writer)
Adds private fields to a class parsing the multi-String property. |
static java.lang.String[] |
getBodyAsStrings(java.lang.String body)
Converts method body into String array. |
static java.lang.String[] |
getExceptionNames(java.lang.reflect.Method m)
Returns exception type names as String[]. |
static java.lang.String |
getParametersList(java.lang.reflect.Method m)
Returns list of method parameters in format param0[, param1[,...]] |
static java.lang.String |
getParametersListWithSeparator(java.lang.reflect.Method m,
java.lang.String sep)
Returns list of method parameters delimited by specified separator |
static java.lang.String |
getParameterTypesList(java.lang.reflect.Method m)
Returns list of method parameter types in format type0[,type1[,...]] |
static java.lang.String |
getPrimitiveType(java.lang.Class cls)
Returns name of the primitive type corresponding to the Object wrapper Class passed as a parameter. |
static java.lang.String |
getTypeRepr(java.lang.Class clazz)
Returns the String representation of the specified class instance. |
static java.lang.String |
getUnwrapMethodName(java.lang.Class primitiveType)
Returns the name of the method to access the value of the primitive type of the wrapper class. |
static java.lang.String |
getWrapperExpr(java.lang.Class exprType,
java.lang.String expr)
A helper method which generates an expression to wrap a primitive datatype to its corresponding wrapper class. |
static java.lang.Class |
getWrapperType(java.lang.Class cls)
Returns java Object wrapper Class corresponding to the primitive Class if the passed class represents a primitive. |
| Methods inherited from class com.sun.jdo.spi.persistence.utility.JavaTypeHelper |
|---|
getPackageName, getPrimitiveClass, getPrimitiveName, getShortClassName, getWrapperClass, getWrapperName, valueOf |
| 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 javaExtension_
public static final java.lang.String void_
public static final java.lang.String boolean_
public static final java.lang.String byte_
public static final java.lang.String byteArray_
public static final java.lang.String param_
public static final java.lang.String param0_
public static final java.lang.String null_
public static final java.lang.String home_
public static final java.lang.String delim_
public static final java.lang.String paramInitializer_
public static final java.lang.String paramSeparator_
public static final java.lang.String paramList_
public static final java.lang.String paramConcatenator_
public static final java.lang.String space_
public static final java.lang.String none_
public static final java.lang.String escapedEmptyString_
public static final java.lang.String dot_
public static final java.lang.String parenleft_
public static final java.lang.String parenright_
public static final java.lang.String parenthesis_
public static final java.lang.String new_
public static final java.lang.String endLine_
public static final java.lang.String true_
public static final java.lang.String false_
public static final java.lang.String Collection_
public static final java.lang.String Set_
public static final java.lang.String PersistenceCapable_
public static final java.lang.String brackets_
public static final java.lang.String get_
public static final java.lang.String set_
public static final java.lang.String Oid_
public static final java.lang.String Helper_
public static final java.lang.String returnNull_
public static final java.lang.String fileName_
public static final java.lang.String int_
public static final java.lang.String String_
public static final java.lang.String Class_
public static final java.lang.String Date_
public static final java.lang.String SqlDate_
public static final java.lang.String SqlTime_
public static final java.lang.String SqlTimestamp_
public static final java.lang.String Object_
public static final java.lang.String[] super_
| Constructor Detail |
|---|
public JavaClassWriterHelper()
| Method Detail |
|---|
public static java.lang.String[] getBodyAsStrings(java.lang.String body)
body - as String with each substring separated by "\n"
public static java.lang.Class getWrapperType(java.lang.Class cls)
cls - the primitive Class to find Object wrapper for.
public static java.lang.String getWrapperExpr(java.lang.Class exprType,
java.lang.String expr)
exprType - The class of the primitive typeexpr - The expression representing a primtive typevalue
public static java.lang.String getUnwrapMethodName(java.lang.Class primitiveType)
primitiveType - the class object of the primitive type.
public static java.lang.String getPrimitiveType(java.lang.Class cls)
cls - the Object wrapper Class to find name of
the primitive type for.
public static java.lang.String[] getExceptionNames(java.lang.reflect.Method m)
m - the Method to identify exception types for.
public static java.lang.String getParameterTypesList(java.lang.reflect.Method m)
type0[,type1[,...]]
m - the Method to identify list of method parameters for.
public static java.lang.String getParametersList(java.lang.reflect.Method m)
param0[, param1[,...]]
m - the Method to identify list of method parameters for.
public static java.lang.String getParametersListWithSeparator(java.lang.reflect.Method m,
java.lang.String sep)
m - the Method to identify list of method parameters for.sep - the separator to be used to delimit the parameter names
public static void addFields(java.lang.String prop,
int modifiers,
JavaClassWriter writer)
throws java.io.IOException
prop - String to use for field generation.modifiers - other field modifiers for these fields.writer - the Class writer.
java.io.IOException - if writer fails to add a field.
public static void addPrivateField(java.lang.String prop,
int modifiers,
JavaClassWriter writer)
throws java.io.IOException
prop - String to use for field generation.modifiers - field modifiers for these fields.
java.io.IOException - if writer fails to add a field.
public static void addGenericMethod(java.lang.String mname,
java.lang.String[] body,
JavaClassWriter writer)
throws java.io.IOException
mname - method namebody - the method body as String[]
java.io.IOException - if writer fails to add a field.
public static void addGenericMethod(java.lang.String mname,
java.lang.String type,
java.lang.String[] body,
JavaClassWriter writer)
throws java.io.IOException
mname - method nametype - return type of the methodbody - the method body as String[]
java.io.IOException - if writer fails to add a field.
public static void addGenericMethod(java.lang.String mname,
int modifiers,
java.lang.String[] body,
JavaClassWriter writer)
throws java.io.IOException
mname - method namemodifiers - the method modifiersbody - the method body as String[]
java.io.IOException - if writer fails to add a field.
public static void addGenericMethod(java.lang.String mname,
int modifiers,
java.lang.String type,
java.lang.String[] body,
JavaClassWriter writer)
throws java.io.IOException
mname - method namemodifiers - the method modifierstype - return type of the methodbody - the method body as String[]
java.io.IOException - if writer fails to add a field.
public static void addGenericMethod(java.lang.reflect.Method m,
java.lang.String mname,
java.lang.String mtype,
java.lang.String body,
JavaClassWriter writer)
throws java.io.IOException
m - Method that describes one to be added to the bean.mname - method name if different from Method#getName(). This
will be true for finder/selector/create methods.mtype - return type of the method, that can differ from the
bean's local or remote interface.body - String to use for method body generation.
java.io.IOException - if writer fails to add a field.public static java.lang.String getTypeRepr(java.lang.Class clazz)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||