|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjef.dna.attributes.impl.GenericAttribute
public abstract class GenericAttribute
Ancestor class for every Attribute class.
About cloning instances extending the GenericAttribute
abstract class:
the clone()
method will return a new instance whose reference to the containing
Dna
instance is set to null
. It is up to you appropriately setting
it to the correct value.
Field Summary | |
---|---|
protected AttribFactory |
attribFactory
|
protected int |
attributeNameIndex
|
protected static java.lang.String |
className
|
protected Dna |
dna
|
protected InstructionFactory |
instrFactory
|
protected int |
length
|
protected static Logger |
logger
|
Constructor Summary | |
---|---|
GenericAttribute()
Constructor. |
Method Summary | |
---|---|
java.lang.Object |
clone()
The clone() method will return a new instance whose reference to the
containing Dna instance is not modified. |
Dna |
getDna()
Get the Dna instance which will contain the current Attribute |
int |
getLength()
Returns the length expressed in bytes of the attribute's payload. |
int |
getNameIndex()
Returns the attribute's name index, |
protected void |
innerValidations(ConstantPoolTable cpt)
|
void |
setDna(Dna dna)
Set the Dna instance which will contain the current Attribute |
void |
setNameIndex(int index)
Set a valid index into the constant pool table. |
abstract void |
updateRefs(int offset)
This method updates all the references pointing to constant pool table's entries this attributes holds. |
boolean |
validate()
This method has to perform a validation process over the Attribute according
to what specified by the JVM Official Specification. |
protected void |
validateNameIndex(ConstantPoolTable cpt)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jef.dna.attributes.Attribute |
---|
fromStream, toStream |
Methods inherited from interface jef.dna.util.BytesCountable |
---|
getBytesCount |
Field Detail |
---|
protected Dna dna
protected int attributeNameIndex
protected int length
protected AttribFactory attribFactory
protected InstructionFactory instrFactory
protected static java.lang.String className
protected static Logger logger
Constructor Detail |
---|
public GenericAttribute()
Method Detail |
---|
public int getNameIndex()
Attribute
getNameIndex
in interface Attribute
public void setNameIndex(int index)
Attribute
Code
attribute, the constant pool table entry at the
provided index would be of type ConstantUtf8, with the string Code
as value.
setNameIndex
in interface Attribute
index
- A valid index in the constant pool tablepublic int getLength()
Attribute
getLength
in interface Attribute
public void setDna(Dna dna)
Dna
instance which will contain the current Attribute
setDna
in interface Attribute
dna
- The "container" Dna
public Dna getDna()
Dna
instance which will contain the current Attribute
getDna
in interface Attribute
Dna
public abstract void updateRefs(int offset)
Attribute
updateRefs
in interface Attribute
offset
- The offsetpublic boolean validate() throws AttributeValidationException, AttributeOutOfRangeException, MissingDnaContainerException, MissingCPTableException
Attribute
according
to what specified by the JVM Official Specification.
validate
in interface Attribute
AttributeValidationException
- Something failed with the validation process; further information are stored
within the raised exception
AttributeOutOfRangeException
- Something failed with the validation process; further information are stored
within the raised exception
MissingDnaContainerException
- The validation process cannot be accomplished since any of the examined entities
is missing its own Dna
container
MissingCPTableException
- The validation process cannot be accomplished since there is no reference to the
ConstantPoolTable
in the current Dna
instanceprotected void innerValidations(ConstantPoolTable cpt) throws AttributeValidationException, AttributeOutOfRangeException, MissingDnaContainerException, MissingCPTableException
AttributeValidationException
AttributeOutOfRangeException
MissingDnaContainerException
MissingCPTableException
protected void validateNameIndex(ConstantPoolTable cpt) throws AttributeValidationException, AttributeOutOfRangeException
AttributeValidationException
AttributeOutOfRangeException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone()
method will return a new instance whose reference to the
containing Dna
instance is not modified.
clone
in interface Attribute
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |