public class JClassUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JClassUtils.PropertyInfo |
| Constructor and Description |
|---|
JClassUtils() |
| Modifier and Type | Method and Description |
|---|---|
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 com.google.gwt.core.ext.typeinfo.JType |
buildSetValueExpression(StringBuilder 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.
Use getFieldValueGet(JClassType, String, String boolean) instead.
|
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 com.google.gwt.core.ext.typeinfo.JMethod |
getMethodOverInterfaces(com.google.gwt.core.ext.typeinfo.JClassType clazz,
String methodName,
com.google.gwt.core.ext.typeinfo.JType[] params)
Look for methods over the interfaces.
|
static String |
getNullSafeExpression(String widgetExpression,
com.google.gwt.core.ext.typeinfo.JType propertyType,
String widgetVariable) |
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 propertyPath)
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 |
isCollection(com.google.gwt.core.ext.typeinfo.JType type) |
static boolean |
isCompatibleTypes(com.google.gwt.core.ext.typeinfo.JType from,
com.google.gwt.core.ext.typeinfo.JType to)
Check if a type can be assigned to another
|
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 |
isNumeric(com.google.gwt.core.ext.typeinfo.JType widgetPropertyType) |
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) |
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
NoSuchFieldExceptionpublic 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.NotFoundExceptionpublic 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.NotFoundExceptionpublic 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
NoSuchFieldExceptionpublic static com.google.gwt.core.ext.typeinfo.JType buildSetValueExpression(StringBuilder out, com.google.gwt.core.ext.typeinfo.JClassType dtoType, String propertyPath, String objectVariable, String value) throws NoSuchFieldException
NoSuchFieldExceptionpublic 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.JMethod getMethodOverInterfaces(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 namepublic 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.NotFoundExceptionpublic 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 propertyPath)
clazz - base classpropertyPath - property pathpublic 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 getNullSafeExpression(String widgetExpression, com.google.gwt.core.ext.typeinfo.JType propertyType, String widgetVariable)
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)
public static boolean isCompatibleTypes(com.google.gwt.core.ext.typeinfo.JType from,
com.google.gwt.core.ext.typeinfo.JType to)
from - to - public static boolean isCollection(com.google.gwt.core.ext.typeinfo.JType type)
public static boolean isNumeric(com.google.gwt.core.ext.typeinfo.JType widgetPropertyType)
Copyright © 2015. All rights reserved.