Package serp.bytecode
Class Attribute
- java.lang.Object
-
- serp.bytecode.Attributes
-
- serp.bytecode.Attribute
-
- All Implemented Interfaces:
BCEntity
,VisitAcceptor
- Direct Known Subclasses:
Annotations
,BootstrapMethods
,Code
,ConstantValue
,Deprecated
,Exceptions
,InnerClasses
,LineNumberTable
,LocalTable
,SourceFile
,Synthetic
,UnknownAttribute
public abstract class Attribute extends Attributes implements VisitAcceptor
In bytecode attributes are used to represent anything that is not part of the class structure. This includes the source file name, code of methods, the line number table, etc. All attributes contain at a minimum an immutable name that also determines the attribute's type.- Author:
- Abe White
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassLoader
getClassLoader()
Return the class loader to use when loading related classes.java.lang.String
getName()
Return the name of this attribute.int
getNameIndex()
Return the index in theConstantPool
of theUTF8Entry
holding the name of this attribute.Attributes
getOwner()
Return theAttributes
that owns this attribute.ConstantPool
getPool()
Return the constant pool of the current class.Project
getProject()
Return the project of the current class.boolean
isValid()
Return false if this entity has been removed from its parent; in this case the results of any operations on the entity are undefined.-
Methods inherited from class serp.bytecode.Attributes
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, removeAttribute, removeAttribute, setAttributes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface serp.bytecode.visitor.VisitAcceptor
acceptVisit
-
-
-
-
Method Detail
-
getOwner
public Attributes getOwner()
Return theAttributes
that owns this attribute. The entity might be aBCClass
,BCField
,BCMethod
, or other attribute.
-
getNameIndex
public int getNameIndex()
Return the index in theConstantPool
of theUTF8Entry
holding the name of this attribute.
-
getName
public java.lang.String getName()
Return the name of this attribute.
-
getProject
public Project getProject()
Description copied from interface:BCEntity
Return the project of the current class.- Specified by:
getProject
in interfaceBCEntity
-
getPool
public ConstantPool getPool()
Description copied from interface:BCEntity
Return the constant pool of the current class.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Description copied from interface:BCEntity
Return the class loader to use when loading related classes.- Specified by:
getClassLoader
in interfaceBCEntity
-
-