Package org.benf.cfr.reader.entities
Class ClassFile
java.lang.Object
org.benf.cfr.reader.entities.ClassFile
- All Implemented Interfaces:
Dumpable
,TypeUsageCollectable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<AccessFlag>
private List<ConstructorInvokationAnonymousInner>
private final AttributeMap
private boolean
private BindingSuperContainer
private ClassFileVersion
private final ClassSignature
private final ConstantPool
private DecompilerComments
private ClassFileDumper
private FakeMethods
private final List<ClassFileField>
private Map<String,
Map<JavaTypeInstance, ClassFileField>> private boolean
private final Map<JavaTypeInstance,
Pair<InnerClassAttributeInfo, ClassFile>> private final boolean
private List<ConstructorInvokationSimple>
private static final long
private static final long
private static final long
private static final long
private static final long
private final List<ConstantPoolEntryClass>
private final ConstantPoolEntryClass
private final ConstantPoolEntryClass
private final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComment
(String comment) private void
addComment
(String comment, Exception e) void
addComment
(DecompilerComment comment) addFakeMethod
(Object key, String nameHint, UnaryFunction<String, FakeMethod> methodFactory) private void
private void
analyseMid
(DCCommonState state) private void
private void
private void
analyseSyntheticTags
(Method method, Options options) void
analyseTop
(DCCommonState dcCommonState, TypeUsageCollectingDumper typeUsageCollectingDumper) private void
private void
checkInnerClassAssumption
(AttributeInnerClasses attributeInnerClasses, JavaRefTypeInstance typeInstance, DCCommonState state) private void
collectMethods
(MethodPrototype prototype, List<Method> tgt, Set<JavaTypeInstance> seen) private void
collectTypeMethods
(MethodPrototype prototype, List<Method> tgt, Set<JavaTypeInstance> seen, JavaTypeInstance clazz) void
collectTypeUsages
(TypeUsageCollector collector) void
void
void
dumpReceiverClassIdentity
(List<AnnotationTableTypeEntry> recieverAnnotations, Dumper d) private void
private void
private void
private BindingSuperContainer
private Method
getAccessibleMethodByPrototype
(MethodPrototype prototype, GenericTypeBinder binder, JavaRefTypeInstance accessor) private void
static JavaTypeInstance
getAnonymousTypeBase
(ClassFile classFile) private void
getBoundSuperClasses
(JavaTypeInstance boundGeneric, BoundSuperCollector boundSuperCollector, BindingSuperContainer.Route route, Set<JavaTypeInstance> seen) private void
getBoundSuperClasses2
(JavaTypeInstance base, GenericTypeBinder genericTypeBinder, BoundSuperCollector boundSuperCollector, BindingSuperContainer.Route route, Set<JavaTypeInstance> seen) getFieldByName
(String name, JavaTypeInstance type) private static void
getFormalParametersText
(ClassSignature signature, TypeAnnotationHelper ah, UnaryFunction<Integer, Predicate<AnnotationTableTypeEntry>> typeAnnPredicateFact, UnaryFunction<Integer, Predicate<AnnotationTableTypeEntry>> typeBoundAnnPredicateFact, Dumper d) getGenericTypeBinder
(JavaGenericRefTypeInstance boundGeneric) private List<InnerClassAttributeInfo>
getMethodByName
(String name) getMethodByPrototype
(MethodPrototype prototype) getMethodByPrototypeOrNull
(MethodPrototype prototype) getMethodsByNameOrNull
(String name) getMethodsWithMatchingName
(MethodPrototype prototype) getOverloadMethodSet
(MethodPrototype prototype) private OverloadMethodSet
getOverloadMethodSetInner
(MethodPrototype prototype) private ClassSignature
getSignature
(ConstantPool cp, ConstantPoolEntryClass rawSuperClass, List<ConstantPoolEntryClass> rawInterfaces) boolean
hasAccessibleField
(String name, JavaRefTypeInstance maybeCaller) boolean
boolean
hasLocalField
(String name) private boolean
isInferredAnonymousStatic
(DCCommonState state, JavaTypeInstance thisType, JavaTypeInstance innerType) boolean
boolean
void
loadInnerClasses
(DCCommonState dcCommonState) void
void
noteAnonymousUse
(ConstructorInvokationAnonymousInner anoynmousInner) void
noteMethodUse
(ConstructorInvokationSimple constructorCall) void
private void
void
setDumpHelper
(ClassFileDumper dumpHelper) boolean
testAccessFlag
(AccessFlag accessFlag) private boolean
testIsInnerClass
(DCCommonState dcCommonState) toString()
-
Field Details
-
OFFSET_OF_MAGIC
private static final long OFFSET_OF_MAGIC- See Also:
-
OFFSET_OF_MINOR
private static final long OFFSET_OF_MINOR- See Also:
-
OFFSET_OF_MAJOR
private static final long OFFSET_OF_MAJOR- See Also:
-
OFFSET_OF_CONSTANT_POOL_COUNT
private static final long OFFSET_OF_CONSTANT_POOL_COUNT- See Also:
-
OFFSET_OF_CONSTANT_POOL
private static final long OFFSET_OF_CONSTANT_POOL- See Also:
-
constantPool
-
accessFlags
-
fields
-
fieldsByName
-
methods
-
fakeMethods
-
methodsByName
-
isInnerClass
private final boolean isInnerClass -
innerClassesByTypeInfo
-
attributes
-
thisClass
-
rawSuperClass
-
rawInterfaces
-
classSignature
-
classFileVersion
-
decompilerComments
-
begunAnalysis
private boolean begunAnalysis -
boundSuperClasses
-
dumpHelper
-
usePath
-
anonymousUsages
-
methodUsages
-
-
Constructor Details
-
ClassFile
-
-
Method Details
-
fixConfusingEnumConstructors
private void fixConfusingEnumConstructors() -
elideScala
private void elideScala() -
checkInnerClassAssumption
private void checkInnerClassAssumption(AttributeInnerClasses attributeInnerClasses, JavaRefTypeInstance typeInstance, DCCommonState state) -
getUsePath
-
isInterface
public boolean isInterface() -
addComment
-
addComment
-
addComment
-
getNullableDecompilerComments
-
ensureDecompilerComments
-
addFakeMethod
public FakeMethod addFakeMethod(Object key, String nameHint, UnaryFunction<String, FakeMethod> methodFactory) -
getAllClassTypes
-
collectTypeUsages
- Specified by:
collectTypeUsages
in interfaceTypeUsageCollectable
-
getAllClassTypes
-
setDumpHelper
-
markHiddenInnerClass
public void markHiddenInnerClass() -
getClassFileVersion
-
isInnerClass
public boolean isInnerClass() -
getConstantPool
-
testAccessFlag
-
hasFormalTypeParameters
public boolean hasFormalTypeParameters() -
ensureFieldsByName
private void ensureFieldsByName() -
hasLocalField
-
hasAccessibleField
-
getFieldByName
public ClassFileField getFieldByName(String name, JavaTypeInstance type) throws NoSuchFieldException - Throws:
NoSuchFieldException
-
calculateFieldsByName
private void calculateFieldsByName() -
getFields
-
getMethods
-
getMethodsWithMatchingName
-
collectMethods
private void collectMethods(MethodPrototype prototype, List<Method> tgt, Set<JavaTypeInstance> seen) -
collectTypeMethods
private void collectTypeMethods(MethodPrototype prototype, List<Method> tgt, Set<JavaTypeInstance> seen, JavaTypeInstance clazz) -
getOverloadMethodSet
-
getOverloadMethodSetInner
-
getMethodByPrototype
- Throws:
NoSuchMethodException
-
getMethodByPrototypeOrNull
-
getAccessibleMethodByPrototype
private Method getAccessibleMethodByPrototype(MethodPrototype prototype, GenericTypeBinder binder, JavaRefTypeInstance accessor) throws NoSuchMethodException - Throws:
NoSuchMethodException
-
getSingleMethodByNameOrNull
-
getMethodsByNameOrNull
-
getMethodByName
- Throws:
NoSuchMethodException
-
getConstructors
-
getBootstrapMethods
-
getThisClassConstpoolEntry
-
isInferredAnonymousStatic
private boolean isInferredAnonymousStatic(DCCommonState state, JavaTypeInstance thisType, JavaTypeInstance innerType) -
testIsInnerClass
-
loadInnerClasses
-
getInnerClassAttributeInfos
-
analyseInnerClassesPass1
-
analysePassOuterFirst
-
analyseTop
public void analyseTop(DCCommonState dcCommonState, TypeUsageCollectingDumper typeUsageCollectingDumper) -
analyseSyntheticTags
-
analyseOverrides
private void analyseOverrides() -
analyseMid
-
releaseCode
public void releaseCode() -
getClassType
-
getRefClassType
-
getBaseClassType
-
getClassSignature
-
getAccessFlags
-
sanitiseAccessPermissions
private void sanitiseAccessPermissions() -
getSignature
private ClassSignature getSignature(ConstantPool cp, ConstantPoolEntryClass rawSuperClass, List<ConstantPoolEntryClass> rawInterfaces) -
dumpNamedInnerClasses
-
dump
-
dumpAsInlineClass
-
getFilePath
-
toString
-
getFormalParametersText
private static void getFormalParametersText(ClassSignature signature, TypeAnnotationHelper ah, UnaryFunction<Integer, Predicate<AnnotationTableTypeEntry>> typeAnnPredicateFact, UnaryFunction<Integer, Predicate<AnnotationTableTypeEntry>> typeBoundAnnPredicateFact, Dumper d) -
dumpReceiverClassIdentity
-
dumpClassIdentity
-
getBindingSupers
-
generateBoundSuperClasses
-
getBoundSuperClasses
private void getBoundSuperClasses(JavaTypeInstance boundGeneric, BoundSuperCollector boundSuperCollector, BindingSuperContainer.Route route, Set<JavaTypeInstance> seen) -
getGenericTypeBinder
-
getBoundSuperClasses2
private void getBoundSuperClasses2(JavaTypeInstance base, GenericTypeBinder genericTypeBinder, BoundSuperCollector boundSuperCollector, BindingSuperContainer.Route route, Set<JavaTypeInstance> seen) -
noteAnonymousUse
-
noteMethodUse
-
getAnonymousUsages
-
getMethodUsages
-
getAnonymousTypeBase
-
getAttributes
-
getMethodFakes
-