Package org.jf.dexlib2.writer.pool
Class ClassPool
- All Implemented Interfaces:
ClassSection<CharSequence,,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue> IndexSection<PoolClassDef>,Markable
public class ClassPool
extends BasePool<String,PoolClassDef>
implements ClassSection<CharSequence,CharSequence,TypeListPool.Key<? extends Collection<? extends CharSequence>>,PoolClassDef,Field,PoolMethod,Set<? extends Annotation>,ArrayEncodedValue>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.common.base.Predicate<MethodParameter> private static final com.google.common.base.Function<MethodParameter, Set<? extends Annotation>> private com.google.common.collect.ImmutableList<PoolClassDef> Fields inherited from class org.jf.dexlib2.writer.pool.BasePool
dexPool, internedItems -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetAccessFlags(PoolClassDef classDef) intgetAnnotationDirectoryOffset(PoolClassDef classDef) intSet<? extends Annotation> getClassAnnotations(PoolClassDef classDef) Map.Entry<? extends PoolClassDef, Integer> intgetCodeItemOffset(PoolMethod method) getDebugItems(PoolMethod method) getExceptionType(ExceptionHandler handler) intgetFieldAccessFlags(Field field) Set<? extends Annotation> getFieldAnnotations(Field field) Iterable<? extends Instruction> getInstructions(PoolMethod method) getInterfaces(PoolClassDef classDef) intgetItemIndex(PoolClassDef classDef) Collection<? extends Map.Entry<PoolClassDef, Integer>> getItems()intgetMethodAccessFlags(PoolMethod method) Set<? extends Annotation> getMethodAnnotations(PoolMethod method) getMethodHiddenApiRestrictions(PoolMethod poolMethod) List<? extends Set<? extends Annotation>> getParameterAnnotations(PoolMethod method) getParameterNames(PoolMethod method) intgetRegisterCount(PoolMethod method) Collection<? extends PoolClassDef> getSortedDirectMethods(PoolClassDef classDef) Collection<? extends Field> getSortedFields(PoolClassDef classDef) Collection<? extends Field> getSortedInstanceFields(PoolClassDef classDef) Collection<? extends PoolMethod> getSortedMethods(PoolClassDef classDef) Collection<? extends Field> getSortedStaticFields(PoolClassDef classDef) getSortedVirtualMethods(PoolClassDef classDef) getSourceFile(PoolClassDef classDef) getStaticInitializers(PoolClassDef classDef) getSuperclass(PoolClassDef classDef) List<? extends TryBlock<? extends ExceptionHandler>> getTryBlocks(PoolMethod method) getType(PoolClassDef classDef) voidprivate voidinternCode(Method method) private voidinternDebug(Method method) makeMutableMethodImplementation(PoolMethod poolMethod) voidsetAnnotationDirectoryOffset(PoolClassDef classDef, int offset) voidsetAnnotationSetRefListOffset(PoolMethod method, int offset) voidsetCodeItemOffset(PoolMethod method, int offset) voidwriteDebugItem(DebugWriter<CharSequence, CharSequence> writer, DebugItem debugItem) Methods inherited from class org.jf.dexlib2.writer.pool.BasePool
getItemCount, mark, resetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jf.dexlib2.writer.IndexSection
getItemCount
-
Field Details
-
sortedClasses
-
HAS_PARAMETER_ANNOTATIONS
-
PARAMETER_ANNOTATIONS
private static final com.google.common.base.Function<MethodParameter,Set<? extends Annotation>> PARAMETER_ANNOTATIONS
-
-
Constructor Details
-
ClassPool
-
-
Method Details
-
intern
-
internCode
-
internDebug
-
getSortedClasses
- Specified by:
getSortedClassesin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getClassEntryByType
@Nullable public Map.Entry<? extends PoolClassDef,Integer> getClassEntryByType(@Nullable CharSequence name) - Specified by:
getClassEntryByTypein interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getType
- Specified by:
getTypein interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getAccessFlags
- Specified by:
getAccessFlagsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getSuperclass
- Specified by:
getSuperclassin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getInterfaces
- Specified by:
getInterfacesin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getSourceFile
- Specified by:
getSourceFilein interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getStaticInitializers
- Specified by:
getStaticInitializersin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getSortedStaticFields
- Specified by:
getSortedStaticFieldsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getSortedInstanceFields
- Specified by:
getSortedInstanceFieldsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getSortedFields
- Specified by:
getSortedFieldsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getSortedDirectMethods
- Specified by:
getSortedDirectMethodsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getSortedVirtualMethods
- Specified by:
getSortedVirtualMethodsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getSortedMethods
- Specified by:
getSortedMethodsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getFieldAccessFlags
- Specified by:
getFieldAccessFlagsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getMethodAccessFlags
- Specified by:
getMethodAccessFlagsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getFieldHiddenApiRestrictions
- Specified by:
getFieldHiddenApiRestrictionsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getMethodHiddenApiRestrictions
@Nonnull public Set<HiddenApiRestriction> getMethodHiddenApiRestrictions(@Nonnull PoolMethod poolMethod) - Specified by:
getMethodHiddenApiRestrictionsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getClassAnnotations
- Specified by:
getClassAnnotationsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getFieldAnnotations
- Specified by:
getFieldAnnotationsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getMethodAnnotations
- Specified by:
getMethodAnnotationsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getParameterAnnotations
@Nullable public List<? extends Set<? extends Annotation>> getParameterAnnotations(@Nonnull PoolMethod method) - Specified by:
getParameterAnnotationsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getDebugItems
- Specified by:
getDebugItemsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getParameterNames
- Specified by:
getParameterNamesin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getRegisterCount
- Specified by:
getRegisterCountin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getInstructions
- Specified by:
getInstructionsin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getTryBlocks
@Nonnull public List<? extends TryBlock<? extends ExceptionHandler>> getTryBlocks(@Nonnull PoolMethod method) - Specified by:
getTryBlocksin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getExceptionType
- Specified by:
getExceptionTypein interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
makeMutableMethodImplementation
@Nonnull public MutableMethodImplementation makeMutableMethodImplementation(@Nonnull PoolMethod poolMethod) - Specified by:
makeMutableMethodImplementationin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
setAnnotationDirectoryOffset
- Specified by:
setAnnotationDirectoryOffsetin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getAnnotationDirectoryOffset
- Specified by:
getAnnotationDirectoryOffsetin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
setAnnotationSetRefListOffset
- Specified by:
setAnnotationSetRefListOffsetin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getAnnotationSetRefListOffset
- Specified by:
getAnnotationSetRefListOffsetin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
setCodeItemOffset
- Specified by:
setCodeItemOffsetin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
getCodeItemOffset
- Specified by:
getCodeItemOffsetin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue>
-
writeDebugItem
public void writeDebugItem(@Nonnull DebugWriter<CharSequence, CharSequence> writer, DebugItem debugItem) throws IOException- Specified by:
writeDebugItemin interfaceClassSection<CharSequence,CharSequence, TypeListPool.Key<? extends Collection<? extends CharSequence>>, PoolClassDef, Field, PoolMethod, Set<? extends Annotation>, ArrayEncodedValue> - Throws:
IOException
-
getItemIndex
- Specified by:
getItemIndexin interfaceIndexSection<PoolClassDef>
-
getItems
- Specified by:
getItemsin interfaceIndexSection<PoolClassDef>
-