|
||||||||||
| 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
| Constructor Summary | |
|---|---|
JavaClassWriterHelper()
|
|
| Method Summary | |
|---|---|
static void |
addFields(String prop,
int modifiers,
JavaClassWriter writer)
Adds fields to a class parsing the multi-String property. |
static void |
addGenericMethod(Method m,
String mname,
String mtype,
String body,
JavaClassWriter writer)
Adds a method to a class parsing the multi-String property. |
static void |
addGenericMethod(String mname,
int modifiers,
String[] body,
JavaClassWriter writer)
Adds a private void no-args method to a class with this method body and modifiers. |
static void |
addGenericMethod(String mname,
int modifiers,
String type,
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(String mname,
String[] body,
JavaClassWriter writer)
Adds a private void no-args method to a class with this method body. |
static void |
addGenericMethod(String mname,
String type,
String[] body,
JavaClassWriter writer)
Adds a private no-args method to a class with this method body and return type. |
static void |
addPrivateField(String prop,
int modifiers,
JavaClassWriter writer)
Adds private fields to a class parsing the multi-String property. |
static String[] |
getBodyAsStrings(String body)
Converts method body into String array. |
static String[] |
getExceptionNames(Method m)
Returns exception type names as String[]. |
static String |
getParametersList(Method m)
Returns list of method parameters in format param0[, param1[,...]] |
static String |
getParametersListWithSeparator(Method m,
String sep)
Returns list of method parameters delimited by specified separator |
static String |
getParameterTypesList(Method m)
Returns list of method parameter types in format type0[,type1[,...]] |
static String |
getPrimitiveType(Class cls)
Returns name of the primitive type corresponding to the Object wrapper Class passed as a parameter. |
static String |
getTypeRepr(Class clazz)
Returns the String representation of the specified class instance. |
static String |
getUnwrapMethodName(Class primitiveType)
Returns the name of the method to access the value of the primitive type of the wrapper class. |
static String |
getWrapperExpr(Class exprType,
String expr)
A helper method which generates an expression to wrap a primitive datatype to its corresponding wrapper class. |
static Class |
getWrapperType(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 String javaExtension_
public static final String void_
public static final String boolean_
public static final String byte_
public static final String byteArray_
public static final String param_
public static final String param0_
public static final String null_
public static final String home_
public static final String delim_
public static final String paramInitializer_
public static final String paramSeparator_
public static final String paramList_
public static final String paramConcatenator_
public static final String space_
public static final String none_
public static final String escapedEmptyString_
public static final String dot_
public static final String parenleft_
public static final String parenright_
public static final String parenthesis_
public static final String new_
public static final String endLine_
public static final String true_
public static final String false_
public static final String Collection_
public static final String Set_
public static final String PersistenceCapable_
public static final String brackets_
public static final String get_
public static final String set_
public static final String Oid_
public static final String Helper_
public static final String returnNull_
public static final String fileName_
public static final String int_
public static final String String_
public static final String Class_
public static final String Date_
public static final String SqlDate_
public static final String SqlTime_
public static final String SqlTimestamp_
public static final String Object_
public static final String[] super_
| Constructor Detail |
|---|
public JavaClassWriterHelper()
| Method Detail |
|---|
public static String[] getBodyAsStrings(String body)
body - as String with each substring separated by "\n"
public static Class getWrapperType(Class cls)
cls - the primitive Class to find Object wrapper for.
public static String getWrapperExpr(Class exprType,
String expr)
exprType - The class of the primitive typeexpr - The expression representing a primtive typevalue
public static String getUnwrapMethodName(Class primitiveType)
primitiveType - the class object of the primitive type.
public static String getPrimitiveType(Class cls)
cls - the Object wrapper Class to find name of
the primitive type for.
public static String[] getExceptionNames(Method m)
m - the Method to identify exception types for.
public static String getParameterTypesList(Method m)
type0[,type1[,...]]
m - the Method to identify list of method parameters for.
public static String getParametersList(Method m)
param0[, param1[,...]]
m - the Method to identify list of method parameters for.
public static String getParametersListWithSeparator(Method m,
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(String prop,
int modifiers,
JavaClassWriter writer)
throws IOException
prop - String to use for field generation.modifiers - other field modifiers for these fields.writer - the Class writer.
IOException - if writer fails to add a field.
public static void addPrivateField(String prop,
int modifiers,
JavaClassWriter writer)
throws IOException
prop - String to use for field generation.modifiers - field modifiers for these fields.
IOException - if writer fails to add a field.
public static void addGenericMethod(String mname,
String[] body,
JavaClassWriter writer)
throws IOException
mname - method namebody - the method body as String[]
IOException - if writer fails to add a field.
public static void addGenericMethod(String mname,
String type,
String[] body,
JavaClassWriter writer)
throws IOException
mname - method nametype - return type of the methodbody - the method body as String[]
IOException - if writer fails to add a field.
public static void addGenericMethod(String mname,
int modifiers,
String[] body,
JavaClassWriter writer)
throws IOException
mname - method namemodifiers - the method modifiersbody - the method body as String[]
IOException - if writer fails to add a field.
public static void addGenericMethod(String mname,
int modifiers,
String type,
String[] body,
JavaClassWriter writer)
throws IOException
mname - method namemodifiers - the method modifierstype - return type of the methodbody - the method body as String[]
IOException - if writer fails to add a field.
public static void addGenericMethod(Method m,
String mname,
String mtype,
String body,
JavaClassWriter writer)
throws 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.
IOException - if writer fails to add a field.public static String getTypeRepr(Class clazz)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||