Class AttributeLayout
- java.lang.Object
-
- org.apache.commons.compress.harmony.unpack200.AttributeLayout
-
- All Implemented Interfaces:
IMatcher
public class AttributeLayout extends java.lang.Object implements IMatcher
Defines a layout that describes how an attribute will be transmitted.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACC_ABSTRACT"ACC_ABSTRACT"static java.lang.StringACC_ANNOTATION"ACC_ANNOTATION"static java.lang.StringACC_ENUM"ACC_ENUM"static java.lang.StringACC_FINAL"ACC_FINAL"static java.lang.StringACC_INTERFACE"ACC_INTERFACE"static java.lang.StringACC_NATIVE"ACC_NATIVE"static java.lang.StringACC_PRIVATE"ACC_PRIVATE"static java.lang.StringACC_PROTECTED"ACC_PROTECTED"static java.lang.StringACC_PUBLIC"ACC_PUBLIC"static java.lang.StringACC_STATIC"ACC_STATIC"static java.lang.StringACC_STRICT"ACC_STRICT"static java.lang.StringACC_SYNCHRONIZED"ACC_SYNCHRONIZED"static java.lang.StringACC_SYNTHETIC"ACC_SYNTHETIC"static java.lang.StringACC_TRANSIENT"ACC_TRANSIENT"static java.lang.StringACC_VOLATILE"ACC_VOLATILE"static java.lang.StringATTRIBUTE_ANNOTATION_DEFAULT"AnnotationDefault"static java.lang.StringATTRIBUTE_CLASS_FILE_VERSION"class-file version"static java.lang.StringATTRIBUTE_CODE"Code"static java.lang.StringATTRIBUTE_CONSTANT_VALUE"ConstantValue"static java.lang.StringATTRIBUTE_DEPRECATED"Deprecated"static java.lang.StringATTRIBUTE_ENCLOSING_METHOD"EnclosingMethod"static java.lang.StringATTRIBUTE_EXCEPTIONS"Exceptions"static java.lang.StringATTRIBUTE_INNER_CLASSES"InnerClasses"static java.lang.StringATTRIBUTE_LINE_NUMBER_TABLE"LineNumberTable"static java.lang.StringATTRIBUTE_LOCAL_VARIABLE_TABLE"LocalVariableTable"static java.lang.StringATTRIBUTE_LOCAL_VARIABLE_TYPE_TABLE"LocalVariableTypeTable"static java.lang.StringATTRIBUTE_RUNTIME_INVISIBLE_ANNOTATIONS"RuntimeInvisibleAnnotations"static java.lang.StringATTRIBUTE_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS"RuntimeInvisibleParameterAnnotations"static java.lang.StringATTRIBUTE_RUNTIME_VISIBLE_ANNOTATIONS"RuntimeVisibleAnnotations"static java.lang.StringATTRIBUTE_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS"RuntimeVisibleParameterAnnotations"static java.lang.StringATTRIBUTE_SIGNATURE"Signature"static java.lang.StringATTRIBUTE_SOURCE_FILE"SourceFile"static intCONTEXT_CLASS0static intCONTEXT_CODE3static intCONTEXT_FIELD1static intCONTEXT_METHOD2static java.lang.String[]contextNamesContext names.
-
Constructor Summary
Constructors Constructor Description AttributeLayout(java.lang.String name, int context, java.lang.String layout, int index)Constructs a default AttributeLayout (equivalent tonew AttributeLayout(name, context, layout, index, true);)AttributeLayout(java.lang.String name, int context, java.lang.String layout, int index, boolean isDefault)Constructs a default AttributeLayout (equivalent tonew AttributeLayout(name, context, layout, index, true);)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodecgetCodec()Gets the Codec based on the layout.intgetContext()Gets the context.intgetIndex()Gets the index.java.lang.StringgetLayout()Gets the layout.java.lang.StringgetName()Gets the name.ClassFileEntrygetValue(long longIndex, java.lang.String type, SegmentConstantPool pool)Gets the ClassFileEntry for the given input.ClassFileEntrygetValue(long longIndex, SegmentConstantPool pool)Gets the ClassFileEntry for the given input.inthashCode()booleanisDefaultLayout()Tests whether this is the default layout.booleanmatches(long value)intnumBackwardsCallables()Gets the backward call count.voidsetBackwardsCallCount(int backwardsCallCount)Sets the backward call count.java.lang.StringtoString()
-
-
-
Field Detail
-
ACC_ABSTRACT
public static final java.lang.String ACC_ABSTRACT
"ACC_ABSTRACT"- See Also:
- Constant Field Values
-
ACC_ANNOTATION
public static final java.lang.String ACC_ANNOTATION
"ACC_ANNOTATION"- See Also:
- Constant Field Values
-
ACC_ENUM
public static final java.lang.String ACC_ENUM
"ACC_ENUM"- See Also:
- Constant Field Values
-
ACC_FINAL
public static final java.lang.String ACC_FINAL
"ACC_FINAL"- See Also:
- Constant Field Values
-
ACC_INTERFACE
public static final java.lang.String ACC_INTERFACE
"ACC_INTERFACE"- See Also:
- Constant Field Values
-
ACC_NATIVE
public static final java.lang.String ACC_NATIVE
"ACC_NATIVE"- See Also:
- Constant Field Values
-
ACC_PRIVATE
public static final java.lang.String ACC_PRIVATE
"ACC_PRIVATE"- See Also:
- Constant Field Values
-
ACC_PROTECTED
public static final java.lang.String ACC_PROTECTED
"ACC_PROTECTED"- See Also:
- Constant Field Values
-
ACC_PUBLIC
public static final java.lang.String ACC_PUBLIC
"ACC_PUBLIC"- See Also:
- Constant Field Values
-
ACC_STATIC
public static final java.lang.String ACC_STATIC
"ACC_STATIC"- See Also:
- Constant Field Values
-
ACC_STRICT
public static final java.lang.String ACC_STRICT
"ACC_STRICT"- See Also:
- Constant Field Values
-
ACC_SYNCHRONIZED
public static final java.lang.String ACC_SYNCHRONIZED
"ACC_SYNCHRONIZED"- See Also:
- Constant Field Values
-
ACC_SYNTHETIC
public static final java.lang.String ACC_SYNTHETIC
"ACC_SYNTHETIC"- See Also:
- Constant Field Values
-
ACC_TRANSIENT
public static final java.lang.String ACC_TRANSIENT
"ACC_TRANSIENT"- See Also:
- Constant Field Values
-
ACC_VOLATILE
public static final java.lang.String ACC_VOLATILE
"ACC_VOLATILE"- See Also:
- Constant Field Values
-
ATTRIBUTE_ANNOTATION_DEFAULT
public static final java.lang.String ATTRIBUTE_ANNOTATION_DEFAULT
"AnnotationDefault"- See Also:
- Constant Field Values
-
ATTRIBUTE_CLASS_FILE_VERSION
public static final java.lang.String ATTRIBUTE_CLASS_FILE_VERSION
"class-file version"- See Also:
- Constant Field Values
-
ATTRIBUTE_CODE
public static final java.lang.String ATTRIBUTE_CODE
"Code"- See Also:
- Constant Field Values
-
ATTRIBUTE_CONSTANT_VALUE
public static final java.lang.String ATTRIBUTE_CONSTANT_VALUE
"ConstantValue"- See Also:
- Constant Field Values
-
ATTRIBUTE_DEPRECATED
public static final java.lang.String ATTRIBUTE_DEPRECATED
"Deprecated"- See Also:
- Constant Field Values
-
ATTRIBUTE_ENCLOSING_METHOD
public static final java.lang.String ATTRIBUTE_ENCLOSING_METHOD
"EnclosingMethod"- See Also:
- Constant Field Values
-
ATTRIBUTE_EXCEPTIONS
public static final java.lang.String ATTRIBUTE_EXCEPTIONS
"Exceptions"- See Also:
- Constant Field Values
-
ATTRIBUTE_INNER_CLASSES
public static final java.lang.String ATTRIBUTE_INNER_CLASSES
"InnerClasses"- See Also:
- Constant Field Values
-
ATTRIBUTE_LINE_NUMBER_TABLE
public static final java.lang.String ATTRIBUTE_LINE_NUMBER_TABLE
"LineNumberTable"- See Also:
- Constant Field Values
-
ATTRIBUTE_LOCAL_VARIABLE_TABLE
public static final java.lang.String ATTRIBUTE_LOCAL_VARIABLE_TABLE
"LocalVariableTable"- See Also:
- Constant Field Values
-
ATTRIBUTE_LOCAL_VARIABLE_TYPE_TABLE
public static final java.lang.String ATTRIBUTE_LOCAL_VARIABLE_TYPE_TABLE
"LocalVariableTypeTable"- See Also:
- Constant Field Values
-
ATTRIBUTE_RUNTIME_INVISIBLE_ANNOTATIONS
public static final java.lang.String ATTRIBUTE_RUNTIME_INVISIBLE_ANNOTATIONS
"RuntimeInvisibleAnnotations"- See Also:
- Constant Field Values
-
ATTRIBUTE_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS
public static final java.lang.String ATTRIBUTE_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS
"RuntimeInvisibleParameterAnnotations"- See Also:
- Constant Field Values
-
ATTRIBUTE_RUNTIME_VISIBLE_ANNOTATIONS
public static final java.lang.String ATTRIBUTE_RUNTIME_VISIBLE_ANNOTATIONS
"RuntimeVisibleAnnotations"- See Also:
- Constant Field Values
-
ATTRIBUTE_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS
public static final java.lang.String ATTRIBUTE_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS
"RuntimeVisibleParameterAnnotations"- See Also:
- Constant Field Values
-
ATTRIBUTE_SIGNATURE
public static final java.lang.String ATTRIBUTE_SIGNATURE
"Signature"- See Also:
- Constant Field Values
-
ATTRIBUTE_SOURCE_FILE
public static final java.lang.String ATTRIBUTE_SOURCE_FILE
"SourceFile"- See Also:
- Constant Field Values
-
CONTEXT_CLASS
public static final int CONTEXT_CLASS
0- See Also:
- Constant Field Values
-
CONTEXT_CODE
public static final int CONTEXT_CODE
3- See Also:
- Constant Field Values
-
CONTEXT_FIELD
public static final int CONTEXT_FIELD
1- See Also:
- Constant Field Values
-
CONTEXT_METHOD
public static final int CONTEXT_METHOD
2- See Also:
- Constant Field Values
-
contextNames
public static final java.lang.String[] contextNames
Context names.
-
-
Constructor Detail
-
AttributeLayout
public AttributeLayout(java.lang.String name, int context, java.lang.String layout, int index) 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.- Throws:
Pack200Exception- Attribute context out of range.Pack200Exception- Cannot have a null layout.Pack200Exception- Cannot have an unnamed layout.
-
AttributeLayout
public AttributeLayout(java.lang.String name, int context, java.lang.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 Detail
-
getContext
public int getContext()
Gets the context.- Returns:
- the context.
-
getIndex
public int getIndex()
Gets the index.- Returns:
- the index.
-
getLayout
public java.lang.String getLayout()
Gets the layout.- Returns:
- the layout.
-
getName
public java.lang.String getName()
Gets the name.- Returns:
- the name.
-
getValue
public ClassFileEntry getValue(long longIndex, SegmentConstantPool pool) throws Pack200Exception
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, java.lang.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()
- Overrides:
hashCodein classjava.lang.Object
-
isDefaultLayout
public boolean isDefaultLayout()
Tests whether this is the default layout.- Returns:
- whether this is the default layout.
-
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-