Package org.apache.tapestry5.services
Class TransformUtils
- java.lang.Object
-
- org.apache.tapestry5.services.TransformUtils
-
public final class TransformUtils extends java.lang.Object
Support code for generating code (used when transforming component classes).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getDefaultValue(java.lang.String type)
Returns the default value for a type.static java.lang.String
getUnwrapperMethodName(java.lang.String type)
For primitive types, returns the method on the wrapper type that converts back to the primitive.static java.lang.Class
getWrapperType(java.lang.Class type)
Returns the wrapper type for a given input type.static java.lang.String
getWrapperTypeName(java.lang.String type)
Returns the name of wrapper type for a given input type.static boolean
isPrimitive(java.lang.String type)
Returns true if the specified type is a primitive type.
-
-
-
Method Detail
-
isPrimitive
public static boolean isPrimitive(java.lang.String type)
Returns true if the specified type is a primitive type.
-
getWrapperTypeName
public static java.lang.String getWrapperTypeName(java.lang.String type)
Returns the name of wrapper type for a given input type. For primitive types, returns the wrapper type. For other types, returns the input type name.- Parameters:
type
- primitive type name, or fully qualified class name
-
getUnwrapperMethodName
public static java.lang.String getUnwrapperMethodName(java.lang.String type)
For primitive types, returns the method on the wrapper type that converts back to the primitive.- Parameters:
type
- the primitive type- Returns:
- the method of the corresponding wrapper type, or null if type is not a primitive type
-
getWrapperType
public static java.lang.Class getWrapperType(java.lang.Class type)
Returns the wrapper type for a given input type. For primitive types, returns the wrapper type. For other types, returns the type itself.- Parameters:
type
- primitive or object type
-
getDefaultValue
public static java.lang.String getDefaultValue(java.lang.String type)
Returns the default value for a type. This is the string "null" for most types, or a literal value for primitive types.
-
-