|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cruxframework.crux.core.utils.JClassUtils
public class JClassUtils
| Nested Class Summary | |
|---|---|
static class |
JClassUtils.PropertyInfo
|
| Constructor Summary | |
|---|---|
JClassUtils()
|
|
| Method Summary | |
|---|---|
static com.google.gwt.core.ext.typeinfo.JType |
buildGetValueExpression(StringBuilder out,
com.google.gwt.core.ext.typeinfo.JClassType dtoType,
String propertyPath,
String objectVariable,
boolean finishCommand)
|
static com.google.gwt.core.ext.typeinfo.JType |
buildSetValueExpression(AbstractProxyCreator.SourcePrinter out,
com.google.gwt.core.ext.typeinfo.JClassType dtoType,
String propertyPath,
String objectVariable,
String value)
|
static JClassUtils.PropertyInfo[] |
extractBeanPropertiesInfo(com.google.gwt.core.ext.typeinfo.JClassType type)
|
static com.google.gwt.core.ext.typeinfo.JMethod[] |
findMethods(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String methodName)
|
static com.google.gwt.core.ext.typeinfo.JMethod[] |
findSetterMethods(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String propertyName)
|
static void |
generateFieldValueSet(com.google.gwt.core.ext.typeinfo.JClassType voClass,
com.google.gwt.core.ext.typeinfo.JField field,
String parentVariable,
String valueVariable,
AbstractProxyCreator.SourcePrinter sourceWriter,
boolean allowProtected)
Generates a property set block. |
static com.google.gwt.core.ext.typeinfo.JClassType[] |
getActualParameterTypes(com.google.gwt.core.ext.typeinfo.JClassType baseType,
com.google.gwt.core.ext.typeinfo.JClassType desiredInterfaceType)
|
static com.google.gwt.core.ext.typeinfo.JField |
getDeclaredField(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String name)
|
static com.google.gwt.core.ext.typeinfo.JField[] |
getDeclaredFields(com.google.gwt.core.ext.typeinfo.JClassType clazz)
|
static String |
getEmptyValueForType(com.google.gwt.core.ext.typeinfo.JType objectType)
|
static com.google.gwt.core.ext.typeinfo.JField |
getField(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String fieldName)
Retrieve a field from class. |
static String |
getFieldValueGet(com.google.gwt.core.ext.typeinfo.JClassType voClass,
com.google.gwt.core.ext.typeinfo.JField field,
String parentVariable,
boolean allowProtected)
Deprecated. |
static String |
getFieldValueGet(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String propertyName,
String parentVariable,
boolean allowProtected)
Generates a property get block. |
static String |
getGenericDeclForType(com.google.gwt.core.ext.typeinfo.JType type)
Returns a string to be used in generic code block, according with the given type |
static String |
getGetterMethod(String propertyName,
com.google.gwt.core.ext.typeinfo.JClassType baseClass)
|
static List<com.google.gwt.core.ext.typeinfo.JMethod> |
getGetterMethods(com.google.gwt.core.ext.typeinfo.JClassType objectType)
|
static com.google.gwt.core.ext.typeinfo.JMethod |
getMethod(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String methodName,
com.google.gwt.core.ext.typeinfo.JType[] params)
|
static String |
getMethodDescription(com.google.gwt.core.ext.typeinfo.JMethod method)
|
static String |
getParsingExpressionForSimpleType(String valueVariable,
com.google.gwt.core.ext.typeinfo.JType expectedType)
|
static String |
getPropertyForGetterOrSetterMethod(com.google.gwt.core.ext.typeinfo.JMethod method)
|
static com.google.gwt.core.ext.typeinfo.JType |
getPropertyType(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String propertyName)
Retrieve the property type on the given class |
static com.google.gwt.core.ext.typeinfo.JType |
getReturnTypeFromMethodClass(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String methodName,
com.google.gwt.core.ext.typeinfo.JType[] params)
|
static String |
getSetterMethod(String propertyName,
com.google.gwt.core.ext.typeinfo.JClassType baseClass,
com.google.gwt.core.ext.typeinfo.JType propertyType)
|
static List<com.google.gwt.core.ext.typeinfo.JMethod> |
getSetterMethods(com.google.gwt.core.ext.typeinfo.JClassType objectType)
|
static com.google.gwt.core.ext.typeinfo.JClassType |
getType(com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle,
String className)
|
static com.google.gwt.core.ext.typeinfo.JClassType |
getType(com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle,
String className,
String viewName)
|
static com.google.gwt.core.ext.typeinfo.JClassType |
getTypeArgForGenericType(com.google.gwt.core.ext.typeinfo.JClassType type)
|
static com.google.gwt.core.ext.typeinfo.JType |
getTypeForProperty(String property,
com.google.gwt.core.ext.typeinfo.JClassType objectType)
|
static boolean |
hasGetAndSetMethods(com.google.gwt.core.ext.typeinfo.JField field,
com.google.gwt.core.ext.typeinfo.JClassType clazz)
Returns true is the given field has both a "get" and a "set" methods. |
static boolean |
hasGetMethod(com.google.gwt.core.ext.typeinfo.JField field,
com.google.gwt.core.ext.typeinfo.JClassType clazz)
Returns true is the given field has an associated public "get" method. |
static boolean |
hasSetMethod(com.google.gwt.core.ext.typeinfo.JField field,
com.google.gwt.core.ext.typeinfo.JClassType clazz)
Returns true is the given field has an associated public "set" method. |
static boolean |
isFullAccessibleField(com.google.gwt.core.ext.typeinfo.JField field,
com.google.gwt.core.ext.typeinfo.JClassType clazz)
Verify if the given field is fully accessible. |
static boolean |
isPropertyVisibleToRead(com.google.gwt.core.ext.typeinfo.JClassType voClass,
com.google.gwt.core.ext.typeinfo.JField field,
boolean allowProtected)
Verify if the given field is a visible property |
static boolean |
isPropertyVisibleToWrite(com.google.gwt.core.ext.typeinfo.JClassType voClass,
com.google.gwt.core.ext.typeinfo.JField field,
boolean allowProtected)
Verify if the given field is a visible property |
static boolean |
isSimpleType(com.google.gwt.core.ext.typeinfo.JType type)
|
static boolean |
isValidGetterMethod(com.google.gwt.core.ext.typeinfo.JMethod method)
|
static boolean |
isValidSetterMethod(com.google.gwt.core.ext.typeinfo.JMethod method)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JClassUtils()
| Method Detail |
|---|
public static com.google.gwt.core.ext.typeinfo.JType buildGetValueExpression(StringBuilder out,
com.google.gwt.core.ext.typeinfo.JClassType dtoType,
String propertyPath,
String objectVariable,
boolean finishCommand)
throws NoSuchFieldException
NoSuchFieldException
public static com.google.gwt.core.ext.typeinfo.JClassType getType(com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle,
String className)
throws com.google.gwt.core.ext.typeinfo.NotFoundException
com.google.gwt.core.ext.typeinfo.NotFoundException
public static com.google.gwt.core.ext.typeinfo.JClassType getType(com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle,
String className,
String viewName)
throws com.google.gwt.core.ext.typeinfo.NotFoundException
com.google.gwt.core.ext.typeinfo.NotFoundException
public static com.google.gwt.core.ext.typeinfo.JType buildSetValueExpression(AbstractProxyCreator.SourcePrinter out,
com.google.gwt.core.ext.typeinfo.JClassType dtoType,
String propertyPath,
String objectVariable,
String value)
throws NoSuchFieldException
NoSuchFieldException
public static String getGetterMethod(String propertyName,
com.google.gwt.core.ext.typeinfo.JClassType baseClass)
propertyName - baseClass -
public static String getSetterMethod(String propertyName,
com.google.gwt.core.ext.typeinfo.JClassType baseClass,
com.google.gwt.core.ext.typeinfo.JType propertyType)
propertyName - baseClass -
public static com.google.gwt.core.ext.typeinfo.JType getReturnTypeFromMethodClass(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String methodName,
com.google.gwt.core.ext.typeinfo.JType[] params)
methodName -
public static com.google.gwt.core.ext.typeinfo.JMethod getMethod(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String methodName,
com.google.gwt.core.ext.typeinfo.JType[] params)
clazz - methodName - params -
public static com.google.gwt.core.ext.typeinfo.JField getField(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String fieldName)
clazz - class to search the fieldfieldName - field name
public static com.google.gwt.core.ext.typeinfo.JMethod[] findMethods(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String methodName)
clazz - methodName -
public static com.google.gwt.core.ext.typeinfo.JMethod[] findSetterMethods(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String propertyName)
clazz - propertyName -
public static String getParsingExpressionForSimpleType(String valueVariable,
com.google.gwt.core.ext.typeinfo.JType expectedType)
throws com.google.gwt.core.ext.typeinfo.NotFoundException
valueVariable - expectedType -
com.google.gwt.core.ext.typeinfo.NotFoundException
public static com.google.gwt.core.ext.typeinfo.JField getDeclaredField(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String name)
throws NoSuchFieldException
clazz - name -
NoSuchFieldExceptionpublic static com.google.gwt.core.ext.typeinfo.JField[] getDeclaredFields(com.google.gwt.core.ext.typeinfo.JClassType clazz)
clazz -
public static String getMethodDescription(com.google.gwt.core.ext.typeinfo.JMethod method)
method -
public static String getGenericDeclForType(com.google.gwt.core.ext.typeinfo.JType type)
type -
public static boolean isSimpleType(com.google.gwt.core.ext.typeinfo.JType type)
type -
public static boolean hasGetAndSetMethods(com.google.gwt.core.ext.typeinfo.JField field,
com.google.gwt.core.ext.typeinfo.JClassType clazz)
true is the given field has both a "get" and a "set" methods.
clazz - field -
public static boolean hasGetMethod(com.google.gwt.core.ext.typeinfo.JField field,
com.google.gwt.core.ext.typeinfo.JClassType clazz)
true is the given field has an associated public "get" method.
clazz - field -
public static boolean hasSetMethod(com.google.gwt.core.ext.typeinfo.JField field,
com.google.gwt.core.ext.typeinfo.JClassType clazz)
true is the given field has an associated public "set" method.
field - clazz -
public static boolean isFullAccessibleField(com.google.gwt.core.ext.typeinfo.JField field,
com.google.gwt.core.ext.typeinfo.JClassType clazz)
field - clazz -
true if the field is public or has associated "get" and "set" methods.
public static boolean isPropertyVisibleToRead(com.google.gwt.core.ext.typeinfo.JClassType voClass,
com.google.gwt.core.ext.typeinfo.JField field,
boolean allowProtected)
voClass - field - allowProtected -
public static boolean isPropertyVisibleToWrite(com.google.gwt.core.ext.typeinfo.JClassType voClass,
com.google.gwt.core.ext.typeinfo.JField field,
boolean allowProtected)
voClass - field - allowProtected -
public static void generateFieldValueSet(com.google.gwt.core.ext.typeinfo.JClassType voClass,
com.google.gwt.core.ext.typeinfo.JField field,
String parentVariable,
String valueVariable,
AbstractProxyCreator.SourcePrinter sourceWriter,
boolean allowProtected)
logger - voClass - field - parentVariable - valueVariable - sourceWriter -
public static com.google.gwt.core.ext.typeinfo.JType getPropertyType(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String propertyName)
clazz - base classpropertyName - property name
public static String getFieldValueGet(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String propertyName,
String parentVariable,
boolean allowProtected)
clazz - class where the property will be searched.propertyName - property nameparentVariable - the name of the parent variable to use in generated expressionallowProtected - if this expression allow protected fields and methods access
<parentVar>.<propertyAccessor>
@Deprecated
public static String getFieldValueGet(com.google.gwt.core.ext.typeinfo.JClassType voClass,
com.google.gwt.core.ext.typeinfo.JField field,
String parentVariable,
boolean allowProtected)
voClass - field - parentVariable - allowProtected - public static boolean isValidSetterMethod(com.google.gwt.core.ext.typeinfo.JMethod method)
public static boolean isValidGetterMethod(com.google.gwt.core.ext.typeinfo.JMethod method)
public static String getPropertyForGetterOrSetterMethod(com.google.gwt.core.ext.typeinfo.JMethod method)
public static List<com.google.gwt.core.ext.typeinfo.JMethod> getSetterMethods(com.google.gwt.core.ext.typeinfo.JClassType objectType)
public static List<com.google.gwt.core.ext.typeinfo.JMethod> getGetterMethods(com.google.gwt.core.ext.typeinfo.JClassType objectType)
public static JClassUtils.PropertyInfo[] extractBeanPropertiesInfo(com.google.gwt.core.ext.typeinfo.JClassType type)
public static com.google.gwt.core.ext.typeinfo.JType getTypeForProperty(String property,
com.google.gwt.core.ext.typeinfo.JClassType objectType)
public static String getEmptyValueForType(com.google.gwt.core.ext.typeinfo.JType objectType)
public static com.google.gwt.core.ext.typeinfo.JClassType getTypeArgForGenericType(com.google.gwt.core.ext.typeinfo.JClassType type)
public static com.google.gwt.core.ext.typeinfo.JClassType[] getActualParameterTypes(com.google.gwt.core.ext.typeinfo.JClassType baseType,
com.google.gwt.core.ext.typeinfo.JClassType desiredInterfaceType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||