public class SignatureUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
classToSignature(java.lang.String className)
returns a slashed or dotted class name into a signature, like java/lang/String -- Ljava/lang/String;
|
static boolean |
compareGenericSignature(java.lang.String genericSignature,
java.lang.String regularSignature) |
static int |
getFirstRegisterSlot(org.apache.bcel.classfile.Method m)
returns the first open register slot after parameters
|
static java.lang.String |
getNonAnonymousPortion(java.lang.String className)
returns the class name, discarding any anonymous component
|
static java.lang.String |
getPackageName(java.lang.String className)
parses the package name from a fully qualified class name
|
static java.util.Map<java.lang.Integer,java.lang.String> |
getParameterSignatures(org.apache.bcel.classfile.Method m)
returns a Map that represents the type of the parameter in slot x
|
static int |
getSignatureSize(java.lang.String signature) |
static java.lang.String |
getTypeCodeSignature(int typeCode)
converts a primitive type code to a signature
|
static boolean |
isInheritedMethod(org.apache.bcel.classfile.JavaClass cls,
java.lang.String methodName,
java.lang.String signature) |
static boolean |
similarPackages(java.lang.String packName1,
java.lang.String packName2,
int depth)
returns whether or not the two packages have the same first 'depth' parts, if they exist
|
static java.lang.String |
stripSignature(java.lang.String signature)
converts a signature, like Ljava/lang/String;
into a dotted class name.
|
static java.lang.String |
trimSignature(java.lang.String signature)
converts a signature, like Ljava/lang/String;
into a slashed class name.
|
public static boolean isInheritedMethod(org.apache.bcel.classfile.JavaClass cls, java.lang.String methodName, java.lang.String signature) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static java.lang.String getPackageName(java.lang.String className)
className
- the class in questionpublic static boolean similarPackages(java.lang.String packName1, java.lang.String packName2, int depth)
packName1
- the first package to checkpackName2
- the second package to checkdepth
- the number of package parts to checkpublic static java.lang.String getTypeCodeSignature(int typeCode)
typeCode
- the raw JVM type valuepublic static java.util.Map<java.lang.Integer,java.lang.String> getParameterSignatures(org.apache.bcel.classfile.Method m)
m
- the method for which you want the parameterspublic static int getFirstRegisterSlot(org.apache.bcel.classfile.Method m)
m
- the method for which you want the parameterspublic static boolean compareGenericSignature(java.lang.String genericSignature, java.lang.String regularSignature)
public static int getSignatureSize(java.lang.String signature)
public static java.lang.String stripSignature(java.lang.String signature)
public static java.lang.String trimSignature(java.lang.String signature)
public static java.lang.String classToSignature(java.lang.String className)
clsName
- the class name to convertpublic static java.lang.String getNonAnonymousPortion(java.lang.String className)
Copyright © 2005-2016 MeBigFatGuy.com. All Rights Reserved.