Interface IJavaClass
- All Superinterfaces:
IJavaDecompilableElement,IJavaElement
Java AST interface to represent a Java class or interface. Class elements contain other classes
(inner classes), fields, and methods.
-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
FLAG_BUILT, FLAG_FIELD_REFERENCES_OUTERCLASS, FLAG_LAMBDA_CLASS, FLAG_LAMBDA_IMPL, FLAG_OPTIONAL_RENDERING, FLAG_SECOND_PARAMETER_IS_OUTER_REF, FLAG_STICKY -
Method Summary
Modifier and TypeMethodDescriptionbooleanRegister a class to be imported in the namespace.Duplicate this element.voidgenerate(JavaOutputSink out, List<IJavaExpression> newArgs, int anonStart, boolean bodyOnly) Generate this class.intRetrieve the class access flags.Get the annotations for this type.Retrieve anonymous classes declared by this class.Retrieve the signatures of anonymous classes.This convenience method is used to retrieve the list of fields.Retrieve field signatures declared by this class.Get the implemented or extended interface types.Get an imported class signature from its simple name.This convenience method is used to retrieve the list of inner classes.Retrieve the signatures of inner classes.This convenience method is used to retrieve the list of methods.Retrieve method signatures declared by this class.getName()Get the type name.Get this element's signature.Get the super type.getType()Get the class or interface type.booleanDetermine whether this type is an annotation type.booleanDetermine whether this type is anonymous.booleanDetermine whether this type is an enumeration.booleanisInner()Determine whether this type is an inner class.booleanDetermine whether this type is an interface.booleanisStatic()Determine whether this type is static.booleanDetermine whether this type is synthetic.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaDecompilableElement
getGlobalContext, isBuilt, isExternal, isOptionalRendering, markBuilt, markNotBuilt, markOptionalRenderingMethods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
addFlags, addTag, canCauseException, collectAllPhysicalOffsets, generate, getData, getElementType, getFlags, getOrigin, getPhysicalMethodIndex, getPhysicalOffset, getReconAnon, getReconEnum, getReconEnummap, getReconLambda, getSubElements, getTags, hasFlags, hasPhysicalMethodIndex, hasPhysicalOffset, isReconArtifact, removeFlags, removeTag, replaceSubElement, setData, setFlags, setLambdaRecon, setOrigin, setPhysicalMethodIndex, setPhysicalOffset, setReconAnon, setReconEnum, setReconEnummap, toShortString, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPre, visitDepthPre, visitDepthPre
-
Method Details
-
getAccessFlags
int getAccessFlags()Retrieve the class access flags.- Returns:
- access flags
-
isInner
boolean isInner()Determine whether this type is an inner class.- Returns:
- true if this type is an inner class
-
isAnonymous
boolean isAnonymous()Determine whether this type is anonymous.- Returns:
- true if this type is anonymous
-
isStatic
boolean isStatic()Determine whether this type is static.- Returns:
- true if this type is static
-
isInterface
boolean isInterface()Determine whether this type is an interface.- Returns:
- true if this type is an interface
-
isEnumeration
boolean isEnumeration()Determine whether this type is an enumeration.- Returns:
- true if this type is an enumeration
-
isAnnotation
boolean isAnnotation()Determine whether this type is an annotation type.- Returns:
- true if this type is an annotation type
-
isSynthetic
boolean isSynthetic()Determine whether this type is synthetic.- Returns:
- true if this type is synthetic
-
getName
String getName()Get the type name. The name is a fully-qualified Java name, such as:Lcom/foo/Bar;- Specified by:
getNamein interfaceIJavaDecompilableElement- Returns:
- the class name
-
getType
IJavaType getType()Get the class or interface type.- Returns:
- the type
-
getSignature
String getSignature()Description copied from interface:IJavaDecompilableElementGet this element's signature.- Specified by:
getSignaturein interfaceIJavaDecompilableElement- Returns:
- original internal signature
-
getSupertype
IJavaType getSupertype()Get the super type.- Returns:
- the superclass type, or null if there is none
-
getImplementedInterfaces
Get the implemented or extended interface types.- Returns:
- implemented or extended interface types
-
getAnnotations
List<IJavaAnnotation> getAnnotations()Get the annotations for this type.- Returns:
- type annotations
-
getInnerClassSignatures
Retrieve the signatures of inner classes.- Returns:
- inner class signatures
-
getInnerClasses
List<IJavaClass> getInnerClasses()This convenience method is used to retrieve the list of inner classes.- Returns:
- the list of inner classes
-
getAnonymousClassSignatures
Retrieve the signatures of anonymous classes.- Returns:
- anonymous class signatures
-
getAnonymousClasses
List<IJavaClass> getAnonymousClasses()Retrieve anonymous classes declared by this class.- Returns:
- anonymous classes
-
getFieldSignatures
Retrieve field signatures declared by this class.- Returns:
- field signatures
-
getFields
List<IJavaField> getFields()This convenience method is used to retrieve the list of fields.- Returns:
- the list of fields
-
getMethodsSignatures
Retrieve method signatures declared by this class.- Returns:
- method signatures
-
getMethods
List<IJavaMethod> getMethods()This convenience method is used to retrieve the list of methods.- Returns:
- the list of methods
-
addImport
Register a class to be imported in the namespace.- Parameters:
simplename- simple class namesignature- FQSS class signature- Returns:
- true if the import was registered
-
getImport
Get an imported class signature from its simple name.- Parameters:
simplename- simple class name- Returns:
- FQSS class signature
-
generate
Generate this class.- Parameters:
out- output sinknewArgs- constructor arguments for anonymous class rendering, or nullanonStart- first anonymous-constructor argument to renderbodyOnly- true to generate only the class body
-
duplicate
IJavaClass duplicate()Description copied from interface:IJavaElementDuplicate this element.- Specified by:
duplicatein interfaceIJavaDecompilableElement- Specified by:
duplicatein interfaceIJavaElement- Returns:
- a (possibly) duplicated object of the same type
-