Interface IJavaField
- All Superinterfaces:
IJavaDecompilableElement,IJavaElement
Java AST interface to represent a Java field.
-
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 TypeMethodDescriptionDuplicate this element.voidgenerateName(JavaOutputSink out, boolean definition) voidgenerateName(JavaOutputSink out, boolean definition, String alternateName, boolean generated) intGet the static initialization value, if any.getName()Get the original field name.Get the field signature.getType()Get the field type.booleanisStatic()Determine whether or not this field is static.booleanMethods 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()- Returns:
-
isStatic
boolean isStatic()Determine whether or not this field is static.- Returns:
- true if static
-
isSynthetic
boolean isSynthetic()- Returns:
-
getClassType
IJavaType getClassType()- Returns:
-
getType
IJavaType getType()Get the field type.- Returns:
- the type string
-
getName
String getName()Get the original field name.- Specified by:
getNamein interfaceIJavaDecompilableElement- Returns:
- the name
-
getSignature
String getSignature()Get the field signature. Convenience routine.Format:
classSignature->fieldName:type- Specified by:
getSignaturein interfaceIJavaDecompilableElement- Returns:
- the field signature, or null for the pseudo-fields "[].length" and "Class.class"
-
getInitialValue
IJavaExpression getInitialValue()Get the static initialization value, if any. Only for static fields.- Returns:
- the initial value, or null if none
-
getAnnotations
List<IJavaAnnotation> getAnnotations()- Returns:
-
generateName
- Parameters:
out-definition-
-
generateName
- Parameters:
out-definition-alternateName- alternate name (AST only, dynamically provided by the caller, not persisted) to be used if and only if the DCM cannot provide a better name (eg, the field was renamed at the DEX level)generated- true to render the field name withItemClassIdentifiers.FIELD_NAME_GENERATEDinstead ofItemClassIdentifiers.FIELD_NAME
-
duplicate
IJavaField 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
-