java.lang.Object
org.objectweb.asm.ClassVisitor
kala.compress.harmony.pack200.Segment
public class Segment
extends org.objectweb.asm.ClassVisitor
A Pack200 archive consists of one or more Segments.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic classException indicating that the class currently being visited contains an unknown attribute, which means that by default the class file needs to be passed through as-is in the file_bands rather than being packed with pack200.classSegmentAnnotationVisitor implementsAnnotationVisitorto visit Annotations found in a class file.classSegmentFieldVisitor implementsFieldVisitorto visit the metadata relating to fields in a class file.classThis class implements MethodVisitor to visit the contents and metadata related to methods in a class file. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intSee https://asm.ow2.io/Javadoc/org/objectweb/asm/Opcodes.html#ASM4private AttributeDefinitionBandsprivate BcBandsprivate ClassBandsprivate CpBandsprivate Pack200ClassReaderprivate final Segment.SegmentFieldVisitorprivate FileBandsprivate IcBandsprivate final Segment.SegmentMethodVisitorprivate org.objectweb.asm.Attribute[]private PackingOptionsprivate SegmentHeaderprivate booleanFields inherited from class org.objectweb.asm.ClassVisitor
api, cv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbooleanvoidpack(Archive.SegmentUnit segmentUnit, OutputStream out, PackingOptions options) The main method on Segment.private voidprivate voidprocessClasses(Archive.SegmentUnit segmentUnit, org.objectweb.asm.Attribute[] attributes) voidvisit(int version, int access, String name, String signature, String superName, String[] interfaces) org.objectweb.asm.AnnotationVisitorvisitAnnotation(String desc, boolean visible) voidvisitAttribute(org.objectweb.asm.Attribute attribute) voidvisitEnd()org.objectweb.asm.FieldVisitorvisitField(int flags, String name, String desc, String signature, Object value) voidvisitInnerClass(String name, String outerName, String innerName, int flags) org.objectweb.asm.MethodVisitorvisitMethod(int flags, String name, String desc, String signature, String[] exceptions) voidvisitOuterClass(String owner, String name, String desc) voidvisitSource(String source, String debug) Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate, visitModule, visitNestHost, visitNestMember, visitPermittedSubclass, visitRecordComponent, visitTypeAnnotation
-
Field Details
-
ASM_API
public static int ASM_APISee https://asm.ow2.io/Javadoc/org/objectweb/asm/Opcodes.html#ASM4 -
segmentHeader
-
cpBands
-
attributeDefinitionBands
-
icBands
-
classBands
-
bcBands
-
fileBands
-
fieldVisitor
-
methodVisitor
-
currentClassReader
-
options
-
stripDebug
private boolean stripDebug -
nonStandardAttributePrototypes
private org.objectweb.asm.Attribute[] nonStandardAttributePrototypes
-
-
Constructor Details
-
Segment
public Segment()
-
-
Method Details
-
addValueAndTag
-
getAttrBands
-
getClassBands
-
getCpBands
-
getCurrentClassReader
-
getIcBands
-
getSegmentHeader
-
lastConstantHadWideIndex
public boolean lastConstantHadWideIndex() -
pack
public void pack(Archive.SegmentUnit segmentUnit, OutputStream out, PackingOptions options) throws IOException, Pack200Exception The main method on Segment. Reads in all the class files, packs them and then writes the packed segment out to the given OutputStream.- Parameters:
segmentUnit- TODOout- the OutputStream to write the packed Segment tooptions- packing options- Throws:
IOException- If an I/O error occurs.Pack200Exception- TODO
-
passCurrentClass
private void passCurrentClass() -
processClasses
private void processClasses(Archive.SegmentUnit segmentUnit, org.objectweb.asm.Attribute[] attributes) throws Pack200Exception - Throws:
Pack200Exception
-
visit
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) - Overrides:
visitin classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
- Overrides:
visitAnnotationin classorg.objectweb.asm.ClassVisitor
-
visitAttribute
public void visitAttribute(org.objectweb.asm.Attribute attribute) - Overrides:
visitAttributein classorg.objectweb.asm.ClassVisitor
-
visitEnd
public void visitEnd()- Overrides:
visitEndin classorg.objectweb.asm.ClassVisitor
-
visitField
public org.objectweb.asm.FieldVisitor visitField(int flags, String name, String desc, String signature, Object value) - Overrides:
visitFieldin classorg.objectweb.asm.ClassVisitor
-
visitInnerClass
- Overrides:
visitInnerClassin classorg.objectweb.asm.ClassVisitor
-
visitMethod
public org.objectweb.asm.MethodVisitor visitMethod(int flags, String name, String desc, String signature, String[] exceptions) - Overrides:
visitMethodin classorg.objectweb.asm.ClassVisitor
-
visitOuterClass
- Overrides:
visitOuterClassin classorg.objectweb.asm.ClassVisitor
-
visitSource
- Overrides:
visitSourcein classorg.objectweb.asm.ClassVisitor
-