java.lang.Object
org.apache.commons.compress.harmony.pack200.BandSet
org.apache.commons.compress.harmony.pack200.ClassBands

public class ClassBands extends BandSet
Class bands (corresponds to the class_bands set of bands in the pack200 specification)
  • Field Details

    • EMPTY_LONG_ARRAY

      private static final long[] EMPTY_LONG_ARRAY
    • cpBands

      private final CpBands cpBands
    • attrBands

      private final AttributeDefinitionBands attrBands
    • class_this

      private final CPClass[] class_this
    • class_super

      private final CPClass[] class_super
    • class_interface

      private final CPClass[][] class_interface
    • class_interface_count

      private final int[] class_interface_count
    • major_versions

      private final int[] major_versions
    • class_flags

      private final long[] class_flags
    • class_attr_calls

      private int[] class_attr_calls
    • classSourceFile

      private final List<CPUTF8> classSourceFile
    • classEnclosingMethodClass

      private final List<ConstantPoolEntry> classEnclosingMethodClass
    • classEnclosingMethodDesc

      private final List<ConstantPoolEntry> classEnclosingMethodDesc
    • classSignature

      private final List<CPSignature> classSignature
    • classFileVersionMinor

      private final IntList classFileVersionMinor
    • classFileVersionMajor

      private final IntList classFileVersionMajor
    • class_field_count

      private final int[] class_field_count
    • field_descr

      private final CPNameAndType[][] field_descr
    • field_flags

      private final long[][] field_flags
    • field_attr_calls

      private int[] field_attr_calls
    • fieldConstantValueKQ

      private final List<CPConstant<?>> fieldConstantValueKQ
    • fieldSignature

      private final List<CPSignature> fieldSignature
    • class_method_count

      private final int[] class_method_count
    • method_descr

      private final CPNameAndType[][] method_descr
    • method_flags

      private final long[][] method_flags
    • method_attr_calls

      private int[] method_attr_calls
    • methodSignature

      private final List<CPSignature> methodSignature
    • methodExceptionNumber

      private final IntList methodExceptionNumber
    • methodExceptionClasses

      private final List<CPClass> methodExceptionClasses
    • codeHeaders

      private int[] codeHeaders
    • codeMaxStack

      private final IntList codeMaxStack
    • codeMaxLocals

      private final IntList codeMaxLocals
    • codeHandlerCount

      private final IntList codeHandlerCount
    • codeHandlerStartP

      private final List codeHandlerStartP
    • codeHandlerEndPO

      private final List codeHandlerEndPO
    • codeHandlerCatchPO

      private final List codeHandlerCatchPO
    • codeHandlerClass

      private final List<CPClass> codeHandlerClass
    • codeFlags

      private final List<Long> codeFlags
    • code_attr_calls

      private int[] code_attr_calls
    • codeLineNumberTableN

      private final IntList codeLineNumberTableN
    • codeLineNumberTableBciP

      private final List codeLineNumberTableBciP
    • codeLineNumberTableLine

      private final IntList codeLineNumberTableLine
    • codeLocalVariableTableN

      private final IntList codeLocalVariableTableN
    • codeLocalVariableTableBciP

      private final List codeLocalVariableTableBciP
    • codeLocalVariableTableSpanO

      private final List codeLocalVariableTableSpanO
    • codeLocalVariableTableNameRU

      private final List<ConstantPoolEntry> codeLocalVariableTableNameRU
    • codeLocalVariableTableTypeRS

      private final List<ConstantPoolEntry> codeLocalVariableTableTypeRS
    • codeLocalVariableTableSlot

      private final IntList codeLocalVariableTableSlot
    • codeLocalVariableTypeTableN

      private final IntList codeLocalVariableTypeTableN
    • codeLocalVariableTypeTableBciP

      private final List codeLocalVariableTypeTableBciP
    • codeLocalVariableTypeTableSpanO

      private final List codeLocalVariableTypeTableSpanO
    • codeLocalVariableTypeTableNameRU

      private final List<ConstantPoolEntry> codeLocalVariableTypeTableNameRU
    • codeLocalVariableTypeTableTypeRS

      private final List<ConstantPoolEntry> codeLocalVariableTypeTableTypeRS
    • codeLocalVariableTypeTableSlot

      private final IntList codeLocalVariableTypeTableSlot
    • class_RVA_bands

      private final MetadataBandGroup class_RVA_bands
    • class_RIA_bands

      private final MetadataBandGroup class_RIA_bands
    • field_RVA_bands

      private final MetadataBandGroup field_RVA_bands
    • field_RIA_bands

      private final MetadataBandGroup field_RIA_bands
    • method_RVA_bands

      private final MetadataBandGroup method_RVA_bands
    • method_RIA_bands

      private final MetadataBandGroup method_RIA_bands
    • method_RVPA_bands

      private final MetadataBandGroup method_RVPA_bands
    • method_RIPA_bands

      private final MetadataBandGroup method_RIPA_bands
    • method_AD_bands

      private final MetadataBandGroup method_AD_bands
    • classAttributeBands

      private final List<NewAttributeBands> classAttributeBands
    • methodAttributeBands

      private final List<NewAttributeBands> methodAttributeBands
    • fieldAttributeBands

      private final List<NewAttributeBands> fieldAttributeBands
    • codeAttributeBands

      private final List<NewAttributeBands> codeAttributeBands
    • tempFieldFlags

      private final List<Long> tempFieldFlags
    • tempFieldDesc

      private final List<CPNameAndType> tempFieldDesc
    • tempMethodFlags

      private final List<Long> tempMethodFlags
    • tempMethodDesc

      private final List<CPNameAndType> tempMethodDesc
    • tempMethodRVPA

      private ClassBands.TempParamAnnotation tempMethodRVPA
    • tempMethodRIPA

      private ClassBands.TempParamAnnotation tempMethodRIPA
    • anySyntheticClasses

      private boolean anySyntheticClasses
    • anySyntheticFields

      private boolean anySyntheticFields
    • anySyntheticMethods

      private boolean anySyntheticMethods
    • segment

      private final Segment segment
    • classReferencesInnerClass

      private final Map<CPClass,Set<CPClass>> classReferencesInnerClass
    • stripDebug

      private final boolean stripDebug
    • index

      private int index
    • numMethodArgs

      private int numMethodArgs
    • class_InnerClasses_N

      private int[] class_InnerClasses_N
    • class_InnerClasses_RC

      private CPClass[] class_InnerClasses_RC
    • class_InnerClasses_F

      private int[] class_InnerClasses_F
    • classInnerClassesOuterRCN

      private List<CPClass> classInnerClassesOuterRCN
    • classInnerClassesNameRUN

      private List<CPUTF8> classInnerClassesNameRUN
  • Constructor Details

  • Method Details

    • countArgs

      protected static int countArgs(String descriptor)
      Counts arguments in a descriptor.
      Parameters:
      descriptor - the descriptor to parse.
      Returns:
      the argument count.
    • addAnnotation

      public void addAnnotation(int context, String desc, boolean visible, List<String> nameRU, List<String> tags, List<Object> values, List<Integer> caseArrayN, List<String> nestTypeRS, List<String> nestNameRU, List<Integer> nestPairN)
    • addAnnotationDefault

      public void addAnnotationDefault(List<String> nameRU, List<String> tags, List<Object> values, List<Integer> caseArrayN, List<String> nestTypeRS, List<String> nestNameRU, List<Integer> nestPairN)
    • addClass

      public void addClass(int major, int flags, String className, String signature, String superName, String[] interfaces)
    • addClassAttribute

      public void addClassAttribute(NewAttribute attribute)
      Adds a new class attribute.
      Parameters:
      attribute - the new class attribute.
    • addCode

      public void addCode()
    • addCodeAttribute

      public void addCodeAttribute(NewAttribute attribute)
      Adds a new code attribute.
      Parameters:
      attribute - the new code attribute.
    • addEnclosingMethod

      public void addEnclosingMethod(String ownerClassName, String name, String signature)
      Adds an enclosing method.
      Parameters:
      ownerClassName - a fully-qualifed class name.
      name - a method name.
      signature - a signature in the constant pool.
    • addField

      public void addField(int flags, String name, String desc, String signature, Object value)
    • addFieldAttribute

      public void addFieldAttribute(NewAttribute attribute)
      Adds a new field attribute.
      Parameters:
      attribute - the new field attribute.
    • addHandler

      public void addHandler(org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.Label handler, String type)
    • addLineNumber

      public void addLineNumber(int line, org.objectweb.asm.Label start)
    • addLocalVariable

      public void addLocalVariable(String name, String desc, String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int indx)
    • addMaxStack

      public void addMaxStack(int maxStack, int maxLocals)
    • addMethod

      public void addMethod(int flags, String name, String desc, String signature, String[] exceptions)
    • addMethodAttribute

      public void addMethodAttribute(NewAttribute attribute)
      Adds a new method attribute.
      Parameters:
      attribute - the new method attribute.
    • addParameterAnnotation

      public void addParameterAnnotation(int parameter, String desc, boolean visible, List<String> nameRU, List<String> tags, List<Object> values, List<Integer> caseArrayN, List<String> nestTypeRS, List<String> nestNameRU, List<Integer> nestPairN)
    • addSourceFile

      public void addSourceFile(String source)
      Adds a source file path.
      Parameters:
      source - a source file path.
    • createNewAttributeBands

      private void createNewAttributeBands() throws IOException
      Throws:
      IOException
    • currentClassReferencesInnerClass

      public void currentClassReferencesInnerClass(CPClass inner)
    • doBciRenumbering

      public void doBciRenumbering(IntList bciRenumbering, Map<org.objectweb.asm.Label,Integer> labelsToOffsets)
    • endOfClass

      public void endOfClass()
      Called when all the data for the current class has been.
      See Also:
    • endOfMethod

      public void endOfMethod()
      Called when all the data for the current method has been.
      See Also:
    • finaliseBands

      public void finaliseBands()
      All input classes for the segment have now been read in, so this method is called so that this class can calculate/complete anything it could not do while classes were being read.
    • getInts

      private int[] getInts(CPClass[] cpClasses)
    • isAnySyntheticClasses

      public boolean isAnySyntheticClasses()
      Tests whether there are any synthetic classes.
      Returns:
      whether there are any synthetic classes.
    • isAnySyntheticFields

      public boolean isAnySyntheticFields()
      Tests whether there are any synthetic fields.
      Returns:
      whether there are any synthetic fields.
    • isAnySyntheticMethods

      public boolean isAnySyntheticMethods()
      Tests whether there are any synthetic methods.
      Returns:
      whether there are any synthetic methods.
    • isInnerClass

      private boolean isInnerClass(String possibleInner)
    • isInnerClassOf

      private boolean isInnerClassOf(String possibleInner, CPClass possibleOuter)
    • numClassesProcessed

      public int numClassesProcessed()
      Gets the number of classes processed.
      Returns:
      the number of classes processed.
    • pack

      public void pack(OutputStream out) throws IOException, Pack200Exception
      Description copied from class: BandSet
      Writes the packed set of bands to the given output stream.
      Specified by:
      pack in class BandSet
      Parameters:
      out - TODO
      Throws:
      IOException - If an I/O error occurs.
      Pack200Exception - If a Pack200 semantic error occurs.
    • removeCurrentClass

      public void removeCurrentClass()
      Remove all entries for the current class
    • renumberBci

      private void renumberBci(List<Integer> list, IntList bciRenumbering, Map<org.objectweb.asm.Label,Integer> labelsToOffsets)
    • renumberDoubleOffsetBci

      private void renumberDoubleOffsetBci(List<Integer> relative, List<Integer> firstOffset, List<Object> list, IntList bciRenumbering, Map<org.objectweb.asm.Label,Integer> labelsToOffsets)
    • renumberOffsetBci

      private void renumberOffsetBci(List<Integer> relative, List<Integer> list, IntList bciRenumbering, Map<org.objectweb.asm.Label,Integer> labelsToOffsets)
    • sum

      private int sum(int[] ints)
    • writeClassAttributeBands

      private void writeClassAttributeBands(OutputStream out) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception
    • writeCodeAttributeBands

      private void writeCodeAttributeBands(OutputStream out) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception
    • writeCodeBands

      private void writeCodeBands(OutputStream out) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception
    • writeFieldAttributeBands

      private void writeFieldAttributeBands(OutputStream out) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception
    • writeMethodAttributeBands

      private void writeMethodAttributeBands(OutputStream out) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception