Class PlasticInternalUtils
java.lang.Object
org.apache.tapestry5.internal.plastic.PlasticInternalUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
capitalize
(String input) Capitalizes the input string, converting the first character to upper case.static void
static org.apache.tapestry5.internal.plastic.asm.tree.ClassNode
convertBytecodeToClassNode
(byte[] bytecode) static String
dissasembleBytecode
(org.apache.tapestry5.internal.plastic.asm.tree.ClassNode classNode) static Object
getFromInstanceContext
(InstanceContext context, String javaName) static boolean
static boolean
static boolean
Returns true if both objects are the same instance, or both null, or left equals right.static boolean
isNonBlank
(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 String
objectDescriptorToClassName
(String descriptor) Converts an object type descriptor (i.e.static String[]
static byte[]
readBytecodeForClass
(ClassLoader loader, String className, boolean mustExist) static Class
toClass
(ClassLoader loader, String javaName) static String
toClassName
(String internalName) Converts a class's internal name (i.e., using slashes) to Java source code format (i.e., using periods).static String
toClassPath
(String className) static String
toDescriptor
(String className) Converts a primitive type or fully qualified class name (or array form) to a descriptor.static String
toInternalName
(String className) static String
static MethodDescription
toMethodDescription
(org.apache.tapestry5.internal.plastic.asm.tree.MethodNode node) static String
toPropertyName
(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)
-