Class PlasticInternalUtils
java.lang.Object
org.apache.tapestry5.internal.plastic.PlasticInternalUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringcapitalize(String input) Capitalizes the input string, converting the first character to upper case.static voidstatic org.apache.tapestry5.internal.plastic.asm.tree.ClassNodeconvertBytecodeToClassNode(byte[] bytecode) static StringdissasembleBytecode(org.apache.tapestry5.internal.plastic.asm.tree.ClassNode classNode) static ObjectgetFromInstanceContext(InstanceContext context, String javaName) static booleanstatic booleanstatic booleanReturns true if both objects are the same instance, or both null, or left equals right.static booleanisNonBlank(String input) static <K,V> ConcurrentMap<K, V> static <T> List<T>newList()static <K,V> Map<K, V> newMap()static <T> Set<T>newSet()static StringobjectDescriptorToClassName(String descriptor) Converts an object type descriptor (i.e.static String[]static byte[]readBytecodeForClass(ClassLoader loader, String className, boolean mustExist) static ClasstoClass(ClassLoader loader, String javaName) static StringtoClassName(String internalName) Converts a class's internal name (i.e., using slashes) to Java source code format (i.e., using periods).static StringtoClassPath(String className) static StringtoDescriptor(String className) Converts a primitive type or fully qualified class name (or array form) to a descriptor.static StringtoInternalName(String className) static Stringstatic MethodDescriptiontoMethodDescription(org.apache.tapestry5.internal.plastic.asm.tree.MethodNode node) static StringtoPropertyName(String fieldName) Strips out leading and trailing underscores, leaving the real property name.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
PlasticInternalUtils
public PlasticInternalUtils()
-
-
Method Details
-
isEmpty
-
orEmpty
-
isBlank
-
isNonBlank
-
toInternalName
-
toClassPath
-
toMessage
-
close
-
toMethodDescription
public static MethodDescription toMethodDescription(org.apache.tapestry5.internal.plastic.asm.tree.MethodNode node) -
toClassName
Converts a class's internal name (i.e., using slashes) to Java source code format (i.e., using periods). -
toDescriptor
Converts a primitive type or fully qualified class name (or array form) to a descriptor.- boolean --> Z
- java.lang.Integer --> Ljava/lang/Integer;
- char[] --> [C
- java.lang.String[][] --> [[java/lang/String;
-
objectDescriptorToClassName
Converts an object type descriptor (i.e. "Ljava/lang/Object;") to a class name ("java.lang.Object"). -
newMap
-
newConcurrentMap
-
newSet
-
newList
-
dissasembleBytecode
public static String dissasembleBytecode(org.apache.tapestry5.internal.plastic.asm.tree.ClassNode classNode) -
toPropertyName
Strips out leading and trailing underscores, leaving the real property name. In addition, "m_foo" is converted to "foo".- Parameters:
fieldName- to convert- Returns:
- the property name
-
capitalize
Capitalizes the input string, converting the first character to upper case.- Parameters:
input- a non-empty string- Returns:
- the same string if already capitalized, or a capitalized version
-
toClass
- Parameters:
loader- class loader to look up injavaName- java name is Java source format (e.g., "int", "int[]", "java.lang.String", "java.lang.String[]", etc.)- Returns:
- class instance
- Throws:
ClassNotFoundException
-
getFromInstanceContext
-
isEqual
Returns true if both objects are the same instance, or both null, or left equals right. -
readBytecodeForClass
-
convertBytecodeToClassNode
public static org.apache.tapestry5.internal.plastic.asm.tree.ClassNode convertBytecodeToClassNode(byte[] bytecode)
-