Class Attribute
java.lang.Object
kala.compress.harmony.unpack200.bytecode.ClassFileEntry
kala.compress.harmony.unpack200.bytecode.Attribute
- Direct Known Subclasses:
AnnotationsAttribute,BCIRenumberedAttribute,ConstantValueAttribute,DeprecatedAttribute,EnclosingMethodAttribute,ExceptionsAttribute,InnerClassesAttribute,SignatureAttribute,SourceFileAttribute
Abstract superclass for class file attributes
-
Field Summary
FieldsFields inherited from class kala.compress.harmony.unpack200.bytecode.ClassFileEntry
NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoWrite(DataOutputStream dos) booleanprotected CPUTF8protected abstract intprotected intAnswer the length of the receiver including its header (the u2 for the attribute name and the u4 for the attribute length).protected ClassFileEntry[]booleanAnswer true if the receiver needs to have BCI renumbering applied to it; otherwise answer false.inthashCode()booleanAnswer true if the receiver is a source file attribute (which gets special handling when the class is built); otherwise answer false.protected voidresolve(ClassConstantPool pool) Allows the constant pool entries to resolve their nested entries.protected abstract voidMethods inherited from class kala.compress.harmony.unpack200.bytecode.ClassFileEntry
objectHashCode, toString, write
-
Field Details
-
attributeName
-
attributeNameIndex
private int attributeNameIndex
-
-
Constructor Details
-
Attribute
-
-
Method Details
-
doWrite
- Specified by:
doWritein classClassFileEntry- Throws:
IOException
-
equals
- Specified by:
equalsin classClassFileEntry
-
getAttributeName
-
getLength
protected abstract int getLength() -
getLengthIncludingHeader
protected int getLengthIncludingHeader()Answer the length of the receiver including its header (the u2 for the attribute name and the u4 for the attribute length). This is relevant when attributes are nested within other attributes - the outer attribute needs to take the inner attribute headers into account when calculating its length.- Returns:
- int adjusted length
-
getNestedClassFileEntries
- Overrides:
getNestedClassFileEntriesin classClassFileEntry
-
hasBCIRenumbering
public boolean hasBCIRenumbering()Answer true if the receiver needs to have BCI renumbering applied to it; otherwise answer false.- Returns:
- boolean BCI renumbering required
-
hashCode
public int hashCode()- Specified by:
hashCodein classClassFileEntry
-
isSourceFileAttribute
public boolean isSourceFileAttribute()Answer true if the receiver is a source file attribute (which gets special handling when the class is built); otherwise answer false.- Returns:
- boolean source file attribute
-
resolve
Description copied from class:ClassFileEntryAllows the constant pool entries to resolve their nested entries.- Overrides:
resolvein classClassFileEntry- Parameters:
pool- TODO
-
writeBody
- Throws:
IOException
-