public class Clazz extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Clazz.Assoc |
class |
Clazz.ClassConstant |
class |
Clazz.Def |
class |
Clazz.FieldDef |
static class |
Clazz.JAVA |
class |
Clazz.MethodDef |
static class |
Clazz.QUERY |
class |
Clazz.TypeDef |
Modifier and Type | Field and Description |
---|---|
static EnumSet<Clazz.QUERY> |
HAS_ARGUMENT |
static Comparator<Clazz> |
NAME_COMPARATOR |
Constructor and Description |
---|
Clazz(Analyzer analyzer,
String path,
Resource resource) |
Modifier and Type | Method and Description |
---|---|
String |
getAbsolutePath() |
int |
getAccess() |
Set<Descriptors.PackageRef> |
getAPIUses() |
Descriptors.TypeRef |
getClassName() |
String |
getClassSignature() |
Map<String,Object> |
getDefaults() |
Clazz.TypeDef |
getExtends(Descriptors.TypeRef type) |
Clazz.JAVA |
getFormat() |
String |
getFQN() |
Clazz.TypeDef |
getImplements(Descriptors.TypeRef type) |
Descriptors.TypeRef[] |
getInterfaces() |
Clazz.MethodDef |
getMethodDef(int access,
String name,
String descriptor)
To provide an enclosing instance
|
Set<Descriptors.PackageRef> |
getReferred() |
String |
getSourceFile() |
Descriptors.TypeRef |
getSuper() |
boolean |
hasPublicNoArgsConstructor() |
boolean |
is(Clazz.QUERY query,
Instruction instr,
Analyzer analyzer) |
boolean |
isAbstract() |
boolean |
isAnnotation() |
boolean |
isDeprecated() |
boolean |
isEnum() |
boolean |
isFinal() |
boolean |
isInterface() |
boolean |
isModule() |
boolean |
isProtected() |
boolean |
isPublic() |
boolean |
isSynthetic() |
static String |
objectDescriptorToFQN(String string) |
Set<Descriptors.TypeRef> |
parseClassFile() |
Set<Descriptors.TypeRef> |
parseClassFile(InputStream in) |
Set<Descriptors.TypeRef> |
parseClassFile(InputStream in,
ClassDataCollector cd) |
Set<Descriptors.TypeRef> |
parseClassFileWithCollector(ClassDataCollector cd) |
void |
parseDescriptor(String descriptor,
int modifiers)
This method parses a descriptor and adds the package of the descriptor to
the referenced packages.
|
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.
|
void |
setDeprecated(boolean b) |
void |
setInnerAccess(int access) |
String |
toString() |
static String |
unCamel(String id) |
public static final EnumSet<Clazz.QUERY> HAS_ARGUMENT
public static final Comparator<Clazz> NAME_COMPARATOR
public Set<Descriptors.TypeRef> parseClassFile() throws Exception
Exception
public Set<Descriptors.TypeRef> parseClassFile(InputStream in) throws Exception
Exception
public Set<Descriptors.TypeRef> parseClassFileWithCollector(ClassDataCollector cd) throws Exception
Exception
public Set<Descriptors.TypeRef> parseClassFile(InputStream in, ClassDataCollector cd) throws Exception
Exception
public void parseDescriptor(String descriptor, int modifiers)
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 descriptormodifiers
- public Set<Descriptors.PackageRef> getReferred()
public String getAbsolutePath()
public String getSourceFile()
public void reset()
public boolean is(Clazz.QUERY query, Instruction instr, Analyzer analyzer) throws Exception
Exception
public boolean isPublic()
public boolean isProtected()
public boolean isEnum()
public boolean isSynthetic()
public boolean isModule()
public Clazz.JAVA getFormat()
public boolean isInterface()
public boolean isAbstract()
public boolean hasPublicNoArgsConstructor()
public int getAccess()
public Descriptors.TypeRef getClassName()
public Clazz.MethodDef getMethodDef(int access, String name, String descriptor)
access
- name
- descriptor
- public Descriptors.TypeRef getSuper()
public String getFQN()
public Descriptors.TypeRef[] getInterfaces()
public void setInnerAccess(int access)
public boolean isFinal()
public void setDeprecated(boolean b)
public boolean isDeprecated()
public boolean isAnnotation()
public Set<Descriptors.PackageRef> getAPIUses()
public Clazz.TypeDef getExtends(Descriptors.TypeRef type)
public Clazz.TypeDef getImplements(Descriptors.TypeRef type)
public String getClassSignature()
Copyright © 2021 aQute SARL. All rights reserved.