Class Segment

  • All Implemented Interfaces:
    org.objectweb.asm.ClassVisitor

    public class Segment
    extends java.lang.Object
    implements org.objectweb.asm.ClassVisitor
    A Pack200 archive consists of one or more Segments.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  Segment.ArrayVisitor  
      static class  Segment.PassException
      Exception 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.
      class  Segment.SegmentAnnotationVisitor
      SegmentAnnotationVisitor implements AnnotationVisitor to visit Annotations found in a class file.
      class  Segment.SegmentFieldVisitor
      SegmentFieldVisitor implements FieldVisitor to visit the metadata relating to fields in a class file.
      class  Segment.SegmentMethodVisitor
      This class implements MethodVisitor to visit the contents and metadata related to methods in a class file.
    • Constructor Summary

      Constructors 
      Constructor Description
      Segment()  
    • Constructor Detail

    • Method Detail

      • pack

        public void pack​(org.apache.commons.compress.harmony.pack200.Archive.SegmentUnit segmentUnit,
                         java.io.OutputStream out,
                         PackingOptions options)
                  throws java.io.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 - TODO
        out - the OutputStream to write the packed Segment to
        options - packing options
        Throws:
        java.io.IOException - If an I/O error occurs.
        Pack200Exception - TODO
      • visit

        public void visit​(int version,
                          int access,
                          java.lang.String name,
                          java.lang.String signature,
                          java.lang.String superName,
                          java.lang.String[] interfaces)
        Specified by:
        visit in interface org.objectweb.asm.ClassVisitor
      • visitSource

        public void visitSource​(java.lang.String source,
                                java.lang.String debug)
        Specified by:
        visitSource in interface org.objectweb.asm.ClassVisitor
      • visitOuterClass

        public void visitOuterClass​(java.lang.String owner,
                                    java.lang.String name,
                                    java.lang.String desc)
        Specified by:
        visitOuterClass in interface org.objectweb.asm.ClassVisitor
      • visitAnnotation

        public org.objectweb.asm.AnnotationVisitor visitAnnotation​(java.lang.String desc,
                                                                   boolean visible)
        Specified by:
        visitAnnotation in interface org.objectweb.asm.ClassVisitor
      • visitAttribute

        public void visitAttribute​(org.objectweb.asm.Attribute attribute)
        Specified by:
        visitAttribute in interface org.objectweb.asm.ClassVisitor
      • visitInnerClass

        public void visitInnerClass​(java.lang.String name,
                                    java.lang.String outerName,
                                    java.lang.String innerName,
                                    int flags)
        Specified by:
        visitInnerClass in interface org.objectweb.asm.ClassVisitor
      • visitField

        public org.objectweb.asm.FieldVisitor visitField​(int flags,
                                                         java.lang.String name,
                                                         java.lang.String desc,
                                                         java.lang.String signature,
                                                         java.lang.Object value)
        Specified by:
        visitField in interface org.objectweb.asm.ClassVisitor
      • visitMethod

        public org.objectweb.asm.MethodVisitor visitMethod​(int flags,
                                                           java.lang.String name,
                                                           java.lang.String desc,
                                                           java.lang.String signature,
                                                           java.lang.String[] exceptions)
        Specified by:
        visitMethod in interface org.objectweb.asm.ClassVisitor
      • visitEnd

        public void visitEnd()
        Specified by:
        visitEnd in interface org.objectweb.asm.ClassVisitor