|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.enhance.EnhanceUtils
public final class EnhanceUtils
Convienience methods needed by various parts of the enhancement subsystem.
Field Summary | |
---|---|
static org.apache.hivemind.service.MethodSignature |
CLEANUP_AFTER_RENDER_SIGNATURE
|
static org.apache.hivemind.service.MethodSignature |
FINISH_LOAD_SIGNATURE
|
static org.apache.hivemind.service.MethodSignature |
PAGE_DETACHED_SIGNATURE
|
Method Summary | |
---|---|
static boolean |
canProxyPropertyType(Class type)
Determines whether or not the specified class type is elligable for proxying. |
static String |
createAccessorMethodName(String propertyName)
|
static String |
createMutatorMethodName(String propertyName)
|
static void |
createSimpleAccessor(EnhancementOperation op,
String fieldName,
String propertyName,
Class propertyType,
org.apache.hivemind.Location location)
|
static void |
createSimpleMutator(EnhancementOperation op,
String fieldName,
String propertyName,
Class propertyType,
org.apache.hivemind.Location location)
|
static String |
createUnwrapExpression(EnhancementOperation op,
String bindingName,
Class valueType)
Builds a Javassist expression for unwrapping a binding's value to a type (either primitive or a class type). |
static Class |
extractPropertyType(EnhancementOperation op,
String propertyName,
String definedTypeName)
Returns the correct class for a property to be enhanced into a class. |
static Class |
extractPropertyType(EnhancementOperation op,
String propertyName,
String definedTypeName,
boolean isGeneric)
Does the same thing as extractPropertyType(EnhancementOperation, String, String) , with the added
knowledge of knowing whether or not the type is generic and thus skips over type validation operations
as generic type checking can't be safely done in this jre 1.4 compatible section of the codebase. |
static String |
getUnwrapperMethodName(Class type)
Returns the name of the static method, within EnhanceUtils, used to unwrap a binding to a primitive type. |
static boolean |
hasEmptyConstructor(Class type)
Checks if the specified class type has an empty constructor. |
static boolean |
toBoolean(IBinding binding)
|
static byte |
toByte(IBinding binding)
|
static char |
toChar(IBinding binding)
|
static double |
toDouble(IBinding binding)
|
static float |
toFloat(IBinding binding)
|
static int |
toInt(IBinding binding)
|
static long |
toLong(IBinding binding)
|
static short |
toShort(IBinding binding)
|
static Class |
verifyPropertyType(EnhancementOperation op,
String propertyName,
Class requiredType)
Verifies that a property type can be assigned a particular type of value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.hivemind.service.MethodSignature FINISH_LOAD_SIGNATURE
public static final org.apache.hivemind.service.MethodSignature PAGE_DETACHED_SIGNATURE
public static final org.apache.hivemind.service.MethodSignature CLEANUP_AFTER_RENDER_SIGNATURE
Method Detail |
---|
public static String createMutatorMethodName(String propertyName)
public static String createAccessorMethodName(String propertyName)
public static void createSimpleAccessor(EnhancementOperation op, String fieldName, String propertyName, Class propertyType, org.apache.hivemind.Location location)
public static void createSimpleMutator(EnhancementOperation op, String fieldName, String propertyName, Class propertyType, org.apache.hivemind.Location location)
public static Class extractPropertyType(EnhancementOperation op, String propertyName, String definedTypeName)
op
- the enhancement operation, which provides most of this logicpropertyName
- the name of the property (the property may or may not exist)definedTypeName
- the type indicated for the property, may be null to make the return value match
the type of an existing property.public static Class extractPropertyType(EnhancementOperation op, String propertyName, String definedTypeName, boolean isGeneric)
extractPropertyType(EnhancementOperation, String, String)
, with the added
knowledge of knowing whether or not the type is generic and thus skips over type validation operations
as generic type checking can't be safely done in this jre 1.4 compatible section of the codebase.
op
- the enhancement operation, which provides most of this logicpropertyName
- the name of the property (the property may or may not exist)definedTypeName
- the type indicated for the property, may be null to make the return value match
the type of an existing property.isGeneric
- Whether or not the type was previously discoverd and found to be generic, if true
type validation is skipped.public static boolean toBoolean(IBinding binding)
public static byte toByte(IBinding binding)
public static char toChar(IBinding binding)
public static short toShort(IBinding binding)
public static int toInt(IBinding binding)
public static long toLong(IBinding binding)
public static float toFloat(IBinding binding)
public static double toDouble(IBinding binding)
public static String getUnwrapperMethodName(Class type)
public static String createUnwrapExpression(EnhancementOperation op, String bindingName, Class valueType)
op
- the enhancement operationbindingName
- the name of the field (or an expression) that will evaluate to the binding from
which a value will be extracted.valueType
- the type of value to be extracted from the binding.public static Class verifyPropertyType(EnhancementOperation op, String propertyName, Class requiredType)
op
- the enhancement operationpropertyName
- the name of the property to checkrequiredType
- the type of value that will be assigned to the property
public static boolean canProxyPropertyType(Class type)
type
- The class to check for proxying elligibility.
public static boolean hasEmptyConstructor(Class type)
type
- The class to check, can't be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |