Top Description Inners Fields Constructors Methods
org.apache.commons.compress.harmony.pack200

public Class Segment

extends ClassVisitor
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, java.util.ArrayList, .List, org.apache.commons.compress.harmony.pack200.Archive.PackingFile, .Archive.SegmentUnit, org.objectweb.asm.AnnotationVisitor, .Attribute, .ClassReader, .ClassVisitor, .FieldVisitor, .Label, .MethodVisitor, .Opcodes, .Type

A Pack200 archive consists of one or more Segments.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
public 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.

public class
Segment.SegmentAnnotationVisitor

SegmentAnnotationVisitor implements AnnotationVisitor to visit Annotations found in a class file.

public class
Segment.SegmentFieldVisitor

SegmentFieldVisitor implements FieldVisitor to visit the metadata relating to fields in a class file.

public class
Segment.SegmentMethodVisitor

This class implements MethodVisitor to visit the contents and metadata related to methods in a class file.

Field Summary

Modifier and TypeField and Description
public static int
ASM_API

See https://asm.ow2.io/Javadoc/org/objectweb/asm/Opcodes.html#ASM4

private AttributeDefinitionBands
private BcBands
private ClassBands
private CpBands
private Pack200ClassReader
private final Segment.SegmentFieldVisitor
private FileBands
private IcBands
private final Segment.SegmentMethodVisitor
private Attribute[]
private PackingOptions
private SegmentHeader
private boolean
Inherited from org.objectweb.asm.ClassVisitor:
apicv

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addValueAndTag(final Object value, final List<String> tags, final List<Object> values)

public AttributeDefinitionBands
public ClassBands
public CpBands
public Pack200ClassReader
public IcBands
public SegmentHeader
public boolean
public void
pack(final Archive.SegmentUnit
TODO
segmentUnit
,
final OutputStream
the OutputStream to write the packed Segment to
out
,
final PackingOptions
packing options
options
)

The main method on Segment.

private void
private void
processClasses(final Archive.SegmentUnit segmentUnit, final Attribute[] attributes)

public void
visit(final int
the class version. The minor version is stored in the 16 most significant bits, and the major version in the 16 least significant bits.
version
,
final int
the class's access flags (see Opcodes). This parameter also indicates if the class is deprecated Opcodes#ACC_DEPRECATED or a record Opcodes#ACC_RECORD.
access
,
final String
the internal name of the class (see Type#getInternalName()).
name
,
final String
the signature of this class. May be null if the class is not a generic one, and does not extend or implement generic classes or interfaces.
signature
,
final String
the internal of name of the super class (see Type#getInternalName()). For interfaces, the super class is Object. May be null, but only for the Object class.
superName
,
final String[]
the internal names of the class's interfaces (see Type#getInternalName()). May be null.
interfaces
)

Overrides org.objectweb.asm.ClassVisitor.visit.

Visits the header of the class.
public AnnotationVisitor
visitAnnotation(final String
the class descriptor of the annotation class.
desc
,
final boolean
true if the annotation is visible at runtime.
visible
)

Overrides org.objectweb.asm.ClassVisitor.visitAnnotation.

Visits an annotation of the class.
public void
visitAttribute(final Attribute
an attribute.
attribute
)

Overrides org.objectweb.asm.ClassVisitor.visitAttribute.

Visits a non standard attribute of the class.
public void
visitEnd()

Overrides org.objectweb.asm.ClassVisitor.visitEnd.

Visits the end of the class.
public FieldVisitor
visitField(final int
the field's access flags (see Opcodes). This parameter also indicates if the field is synthetic and/or deprecated.
flags
,
final String
the field's name.
name
,
final String
the field's descriptor (see Type).
desc
,
final String
the field's signature. May be null if the field's type does not use generic types.
signature
,
final Object
the field's initial value. This parameter, which may be null if the field does not have an initial value, must be an Integer, a Float, a Long, a Double or a String (for int, float, long or String fields respectively). This parameter is only used for static fields. Its value is ignored for non static fields, which must be initialized through bytecode instructions in constructors or methods.
value
)

Overrides org.objectweb.asm.ClassVisitor.visitField.

Visits a field of the class.
public void
visitInnerClass(final String
the internal name of C (see Type#getInternalName()).
name
,
final String
the internal name of the class or interface C is a member of (see Type#getInternalName()). Must be null if C is not the member of a class or interface (e.g. for local or anonymous classes).
outerName
,
final String
the (simple) name of C. Must be null for anonymous inner classes.
innerName
,
final int
the access flags of C originally declared in the source code from which this class was compiled.
flags
)

Overrides org.objectweb.asm.ClassVisitor.visitInnerClass.

Visits information about an inner class.
public MethodVisitor
visitMethod(final int
the method's access flags (see Opcodes). This parameter also indicates if the method is synthetic and/or deprecated.
flags
,
final String
the method's name.
name
,
final String
the method's descriptor (see Type).
desc
,
final String
the method's signature. May be null if the method parameters, return type and exceptions do not use generic types.
signature
,
final String[]
the internal names of the method's exception classes (see Type#getInternalName()). May be null.
exceptions
)

Overrides org.objectweb.asm.ClassVisitor.visitMethod.

Visits a method of the class.
public void
visitOuterClass(final String
internal name of the enclosing class of the class (see Type#getInternalName()).
owner
,
final String
the name of the method that contains the class, or null if the class is not enclosed in a method or constructor of its enclosing class (e.g. if it is enclosed in an instance initializer, static initializer, instance variable initializer, or class variable initializer).
name
,
final String
the descriptor of the method that contains the class, or null if the class is not enclosed in a method or constructor of its enclosing class (e.g. if it is enclosed in an instance initializer, static initializer, instance variable initializer, or class variable initializer).
desc
)

Overrides org.objectweb.asm.ClassVisitor.visitOuterClass.

Visits the enclosing class of the class.
public void
visitSource(final String
the name of the source file from which the class was compiled. May be null.
source
,
final String
additional debug information to compute the correspondence between source and compiled elements of the class. May be null.
debug
)

Overrides org.objectweb.asm.ClassVisitor.visitSource.

Visits the source of the class.
Inherited from org.objectweb.asm.ClassVisitor:
getDelegatevisitModulevisitNestHostvisitNestMembervisitPermittedSubclassvisitRecordComponentvisitTypeAnnotation