Class AttributeLayout
java.lang.Object
org.apache.commons.compress.harmony.unpack200.AttributeLayout
- All Implemented Interfaces:
IMatcher
Defines a layout that describes how an attribute will be transmitted.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String"ACC_ABSTRACT"static final String"ACC_ANNOTATION"static final String"ACC_ENUM"static final String"ACC_FINAL"static final String"ACC_INTERFACE"static final String"ACC_NATIVE"static final String"ACC_PRIVATE"static final String"ACC_PROTECTED"static final String"ACC_PUBLIC"static final String"ACC_STATIC"static final String"ACC_STRICT"static final String"ACC_SYNCHRONIZED"static final String"ACC_SYNTHETIC"static final String"ACC_TRANSIENT"static final String"ACC_VOLATILE"static final String"AnnotationDefault"static final String"class-file version"static final String"Code"static final String"ConstantValue"static final String"Deprecated"static final String"EnclosingMethod"static final String"Exceptions"static final String"InnerClasses"static final String"LineNumberTable"static final String"LocalVariableTable"static final String"LocalVariableTypeTable"static final String"RuntimeInvisibleAnnotations"static final String"RuntimeInvisibleParameterAnnotations"static final String"RuntimeVisibleAnnotations"static final String"RuntimeVisibleParameterAnnotations"static final String"Signature"static final String"SourceFile"private intprivate final intstatic final int0static final int3static final int1static final int2static final String[]Context names.private final intprivate final booleanprivate final Stringprivate longprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionAttributeLayout(String name, int context, String layout, int index) Constructs a default AttributeLayout (equivalent tonew AttributeLayout(name, context, layout, index, true);)AttributeLayout(String name, int context, String layout, int index, boolean isDefault) Constructs a default AttributeLayout (equivalent tonew AttributeLayout(name, context, layout, index, true);) -
Method Summary
Modifier and TypeMethodDescriptiongetCodec()Gets the Codec based on the layout.intGets the context.intgetIndex()Gets the index.Gets the layout.getName()Gets the name.getValue(long longIndex, String type, SegmentConstantPool pool) Gets the ClassFileEntry for the given input.getValue(long longIndex, SegmentConstantPool pool) Gets the ClassFileEntry for the given input.private static ClassFileEntrygetValue(String layout, long longIndex, SegmentConstantPool pool) inthashCode()booleanTests whether this is the default layout.booleanmatches(long value) intGets the backward call count.voidsetBackwardsCallCount(int backwardsCallCount) Sets the backward call count.toString()
-
Field Details
-
ACC_ABSTRACT
"ACC_ABSTRACT"- See Also:
-
ACC_ANNOTATION
"ACC_ANNOTATION"- See Also:
-
ACC_ENUM
"ACC_ENUM"- See Also:
-
ACC_FINAL
"ACC_FINAL"- See Also:
-
ACC_INTERFACE
"ACC_INTERFACE"- See Also:
-
ACC_NATIVE
"ACC_NATIVE"- See Also:
-
ACC_PRIVATE
"ACC_PRIVATE"- See Also:
-
ACC_PROTECTED
"ACC_PROTECTED"- See Also:
-
ACC_PUBLIC
"ACC_PUBLIC"- See Also:
-
ACC_STATIC
"ACC_STATIC"- See Also:
-
ACC_STRICT
"ACC_STRICT"- See Also:
-
ACC_SYNCHRONIZED
"ACC_SYNCHRONIZED"- See Also:
-
ACC_SYNTHETIC
"ACC_SYNTHETIC"- See Also:
-
ACC_TRANSIENT
"ACC_TRANSIENT"- See Also:
-
ACC_VOLATILE
"ACC_VOLATILE"- See Also:
-
ATTRIBUTE_ANNOTATION_DEFAULT
"AnnotationDefault"- See Also:
-
ATTRIBUTE_CLASS_FILE_VERSION
"class-file version"- See Also:
-
ATTRIBUTE_CODE
"Code"- See Also:
-
ATTRIBUTE_CONSTANT_VALUE
"ConstantValue"- See Also:
-
ATTRIBUTE_DEPRECATED
"Deprecated"- See Also:
-
ATTRIBUTE_ENCLOSING_METHOD
"EnclosingMethod"- See Also:
-
ATTRIBUTE_EXCEPTIONS
"Exceptions"- See Also:
-
ATTRIBUTE_INNER_CLASSES
"InnerClasses"- See Also:
-
ATTRIBUTE_LINE_NUMBER_TABLE
"LineNumberTable"- See Also:
-
ATTRIBUTE_LOCAL_VARIABLE_TABLE
"LocalVariableTable"- See Also:
-
ATTRIBUTE_LOCAL_VARIABLE_TYPE_TABLE
"LocalVariableTypeTable"- See Also:
-
ATTRIBUTE_RUNTIME_INVISIBLE_ANNOTATIONS
"RuntimeInvisibleAnnotations"- See Also:
-
ATTRIBUTE_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS
"RuntimeInvisibleParameterAnnotations"- See Also:
-
ATTRIBUTE_RUNTIME_VISIBLE_ANNOTATIONS
"RuntimeVisibleAnnotations"- See Also:
-
ATTRIBUTE_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS
"RuntimeVisibleParameterAnnotations"- See Also:
-
ATTRIBUTE_SIGNATURE
"Signature"- See Also:
-
ATTRIBUTE_SOURCE_FILE
"SourceFile"- See Also:
-
CONTEXT_CLASS
public static final int CONTEXT_CLASS0- See Also:
-
CONTEXT_CODE
public static final int CONTEXT_CODE3- See Also:
-
CONTEXT_FIELD
public static final int CONTEXT_FIELD1- See Also:
-
CONTEXT_METHOD
public static final int CONTEXT_METHOD2- See Also:
-
contextNames
Context names. -
context
private final int context -
index
private final int index -
layout
-
mask
private long mask -
name
-
isDefault
private final boolean isDefault -
backwardsCallCount
private int backwardsCallCount
-
-
Constructor Details
-
AttributeLayout
Constructs a default AttributeLayout (equivalent tonew AttributeLayout(name, context, layout, index, true);)- Parameters:
name- The layout name.context- One ofCONTEXT_CLASS,CONTEXT_CODE,CONTEXT_FIELD,CONTEXT_METHOD.layout- The layout.index- The index, currently used as part of computing the hash code.- Throws:
Pack200Exception- Attribute context out of range.Pack200Exception- Cannot have a null layout.Pack200Exception- Cannot have an unnamed layout.
-
AttributeLayout
public AttributeLayout(String name, int context, String layout, int index, boolean isDefault) throws Pack200Exception Constructs a default AttributeLayout (equivalent tonew AttributeLayout(name, context, layout, index, true);)- Parameters:
name- The layout name.context- One ofCONTEXT_CLASS,CONTEXT_CODE,CONTEXT_FIELD,CONTEXT_METHOD.layout- The layout.index- The index, currently used as part of computing the hash code.isDefault- Whether this is the default layout.- Throws:
Pack200Exception- Attribute context out of range.Pack200Exception- Cannot have a null layout.Pack200Exception- Cannot have an unnamed layout.
-
-
Method Details
-
getValue
private static ClassFileEntry getValue(String layout, long longIndex, SegmentConstantPool pool) throws Pack200Exception - Throws:
Pack200Exception
-
getCodec
Gets the Codec based on the layout.- Returns:
- the Codec.
-
getContext
public int getContext()Gets the context.- Returns:
- the context.
-
getIndex
public int getIndex()Gets the index.- Returns:
- the index.
-
getLayout
Gets the layout.- Returns:
- the layout.
-
getName
Gets the name.- Returns:
- the name.
-
getValue
Gets the ClassFileEntry for the given input.- Parameters:
longIndex- An index into the segment constant pool.pool- the segment constant pool.- Returns:
- the matching ClassFileEntry.
- Throws:
Pack200Exception- if the input is invalid.
-
getValue
public ClassFileEntry getValue(long longIndex, String type, SegmentConstantPool pool) throws Pack200Exception Gets the ClassFileEntry for the given input.- Parameters:
longIndex- An index into the segment constant pool.type- the Java type signature.pool- the segment constant pool.- Returns:
- the matching ClassFileEntry.
- Throws:
Pack200Exception- if the input is invalid.
-
hashCode
public int hashCode() -
isDefaultLayout
public boolean isDefaultLayout()Tests whether this is the default layout.- Returns:
- whether this is the default layout.
-
matches
public boolean matches(long value) -
numBackwardsCallables
public int numBackwardsCallables()Gets the backward call count.- Returns:
- the backward call count.
-
setBackwardsCallCount
public void setBackwardsCallCount(int backwardsCallCount) Sets the backward call count.- Parameters:
backwardsCallCount- the backward call count.
-
toString
-