public class Clazz extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Clazz.Assoc |
class |
Clazz.ClassConstant |
static class |
Clazz.FieldDef |
static class |
Clazz.JAVA |
static class |
Clazz.MethodDef |
static class |
Clazz.QUERY |
Modifier and Type | Field and Description |
---|---|
static EnumSet<Clazz.QUERY> |
HAS_ARGUMENT |
Modifier and Type | Method and Description |
---|---|
protected void |
constantClass(DataInputStream in,
int poolIndex) |
protected void |
constantDouble(DataInputStream in,
int poolIndex) |
protected void |
constantLong(DataInputStream in,
int poolIndex) |
protected void |
constantUtf8(DataInputStream in,
int poolIndex) |
protected void |
crawl(byte[] code)
We must find Class.forName references ...
|
static String |
fqnToBinary(String dotted) |
static String |
fqnToPath(String dotted) |
Clazz.JAVA |
getFormat() |
String |
getFQN() |
static void |
getImplementedPackages(Set<String> implemented,
Analyzer analyzer,
Clazz clazz) |
static String |
getPackage(String clazz) |
String |
getPath() |
Set<String> |
getReferred() |
static String |
getShortName(String cname) |
String |
getSourceFile() |
static String |
internalToFqn(String string) |
boolean |
is(Clazz.QUERY query,
Instruction instr,
Analyzer analyzer) |
boolean |
isEnum() |
boolean |
isPublic() |
protected void |
nameAndType(DataInputStream in,
int poolIndex,
byte tag) |
static String |
objectDescriptorToFQN(String string) |
Set<String> |
parseClassFile() |
Set<String> |
parseClassFile(InputStream in) |
Set<String> |
parseClassFile(InputStream in,
ClassDataCollector cd) |
Set<String> |
parseClassFileWithCollector(ClassDataCollector cd) |
void |
parseDescriptor(String descriptor)
This method parses a descriptor and adds the package of the descriptor to
the referenced packages.
|
static String |
pathToFqn(String path) |
protected void |
pool(Object[] pool,
int[] intPool) |
void |
reset()
.class construct for different compilers
sun 1.1 Detect static variable class$com$acme$MyClass 1.2 " 1.3 " 1.4 "
1.5 ldc_w (class) 1.6 "
eclipse 1.1 class$0, ldc (string), invokestatic Class.forName 1.2 " 1.3 "
1.5 ldc (class) 1.6 "
1.5 and later is not an issue, sun pre 1.5 is easy to detect the static
variable that decodes the class name.
|
static String |
toDescriptor(Class<?> clazz) |
String |
toString() |
static String |
unCamel(String id) |
public static EnumSet<Clazz.QUERY> HAS_ARGUMENT
public Set<String> parseClassFile(InputStream in) throws IOException
IOException
public Set<String> parseClassFileWithCollector(ClassDataCollector cd) throws Exception
Exception
public Set<String> parseClassFile(InputStream in, ClassDataCollector cd) throws IOException
IOException
protected void pool(Object[] pool, int[] intPool)
protected void nameAndType(DataInputStream in, int poolIndex, byte tag) throws IOException
in
- poolIndex
- tag
- IOException
protected void constantClass(DataInputStream in, int poolIndex) throws IOException
in
- poolIndex
- IOException
protected void constantDouble(DataInputStream in, int poolIndex) throws IOException
in
- IOException
protected void constantLong(DataInputStream in, int poolIndex) throws IOException
in
- IOException
protected void constantUtf8(DataInputStream in, int poolIndex) throws IOException
in
- poolIndex
- IOException
protected void crawl(byte[] code)
code
- public void parseDescriptor(String descriptor)
descriptor ::= ( '(' reference * ')' )? reference reference ::= 'L' classname ( '<' references '>' )? ';' | 'B' | 'Z' | ... | '+' | '-' | '['This methods uses heavy recursion to parse the descriptor and a roving pointer to limit the creation of string objects.
descriptor
- The to be parsed descriptorrover
- The pointer to start atpublic String getPath()
public String getSourceFile()
public void reset()
public boolean is(Clazz.QUERY query, Instruction instr, Analyzer analyzer) throws Exception
Exception
public String getFQN()
public static void getImplementedPackages(Set<String> implemented, Analyzer analyzer, Clazz clazz) throws Exception
Exception
public boolean isPublic()
public boolean isEnum()
public Clazz.JAVA getFormat()
Copyright © 2013 aQute SARL. All Rights Reserved.