org.aspectj.org.eclipse.jdt.internal.core.util
Class CodeAttribute

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileStruct
      extended by org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileAttribute
          extended by org.aspectj.org.eclipse.jdt.internal.core.util.CodeAttribute
All Implemented Interfaces:
IClassFileAttribute, ICodeAttribute

public class CodeAttribute
extends ClassFileAttribute
implements ICodeAttribute

Default implementation of ICodeAttribute.


Field Summary
 
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileAttribute
NO_ATTRIBUTES
 
Method Summary
 IClassFileAttribute[] getAttributes()
          Answer back the collection of all attributes of the field info.
 int getAttributesCount()
          Answer back the attribute number of the code attribute.
 byte[] getBytecodes()
          Answer back the array of bytes, which represents all the opcodes as described in the JVM specifications.
 long getCodeLength()
          Answer back the length of the bytecode contents.
 IExceptionTableEntry[] getExceptionTable()
          Answer back the array of exception entries, if they are present.
 int getExceptionTableLength()
          Answer back the exception table length of the code attribute.
 ILineNumberAttribute getLineNumberAttribute()
          Answer back the line number attribute, if it exists, null otherwise.
 ILocalVariableAttribute getLocalVariableAttribute()
          Answer back the local variable attribute, if it exists, null otherwise.
 int getMaxLocals()
          Answer back the max locals value of the code attribute.
 int getMaxStack()
          Answer back the max stack value of the code attribute.
 void traverse(IBytecodeVisitor visitor)
          Define a Java opcodes walker.
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileAttribute
getAttributeLength, getAttributeName, getAttributeNameIndex
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.util.ClassFileStruct
doubleAt, floatAt, i1At, i2At, i4At, i8At, u1At, u2At, u4At, utf8At
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.util.IClassFileAttribute
getAttributeLength, getAttributeName, getAttributeNameIndex
 

Method Detail

getAttributes

public IClassFileAttribute[] getAttributes()
Description copied from interface: ICodeAttribute
Answer back the collection of all attributes of the field info. It includes the LineNumberAttribute and the LocalVariableTableAttribute. Returns an empty collection if none.

Specified by:
getAttributes in interface ICodeAttribute
Returns:
the collection of all attributes of the field info. It includes the LineNumberAttribute and the LocalVariableTableAttribute. Returns an empty collection if none
See Also:
ICodeAttribute.getAttributes()

getAttributesCount

public int getAttributesCount()
Description copied from interface: ICodeAttribute
Answer back the attribute number of the code attribute.

Specified by:
getAttributesCount in interface ICodeAttribute
Returns:
the attribute number of the code attribute
See Also:
ICodeAttribute.getAttributesCount()

getBytecodes

public byte[] getBytecodes()
Description copied from interface: ICodeAttribute
Answer back the array of bytes, which represents all the opcodes as described in the JVM specifications.

Specified by:
getBytecodes in interface ICodeAttribute
Returns:
the array of bytes, which represents all the opcodes as described in the JVM specifications
See Also:
ICodeAttribute.getBytecodes()

getCodeLength

public long getCodeLength()
Description copied from interface: ICodeAttribute
Answer back the length of the bytecode contents.

Specified by:
getCodeLength in interface ICodeAttribute
Returns:
the length of the bytecode contents
See Also:
ICodeAttribute.getCodeLength()

getExceptionTable

public IExceptionTableEntry[] getExceptionTable()
Description copied from interface: ICodeAttribute
Answer back the array of exception entries, if they are present. An empty array otherwise.

Specified by:
getExceptionTable in interface ICodeAttribute
Returns:
the array of exception entries, if they are present. An empty array otherwise
See Also:
ICodeAttribute.getExceptionTable()

getExceptionTableLength

public int getExceptionTableLength()
Description copied from interface: ICodeAttribute
Answer back the exception table length of the code attribute.

Specified by:
getExceptionTableLength in interface ICodeAttribute
Returns:
the exception table length of the code attribute
See Also:
ICodeAttribute.getExceptionTableLength()

getLineNumberAttribute

public ILineNumberAttribute getLineNumberAttribute()
Description copied from interface: ICodeAttribute
Answer back the line number attribute, if it exists, null otherwise.

Specified by:
getLineNumberAttribute in interface ICodeAttribute
Returns:
the line number attribute, if it exists, null otherwise
See Also:
ICodeAttribute.getLineNumberAttribute()

getLocalVariableAttribute

public ILocalVariableAttribute getLocalVariableAttribute()
Description copied from interface: ICodeAttribute
Answer back the local variable attribute, if it exists, null otherwise.

Specified by:
getLocalVariableAttribute in interface ICodeAttribute
Returns:
the local variable attribute, if it exists, null otherwise
See Also:
ICodeAttribute.getLocalVariableAttribute()

getMaxLocals

public int getMaxLocals()
Description copied from interface: ICodeAttribute
Answer back the max locals value of the code attribute.

Specified by:
getMaxLocals in interface ICodeAttribute
Returns:
the max locals value of the code attribute
See Also:
ICodeAttribute.getMaxLocals()

getMaxStack

public int getMaxStack()
Description copied from interface: ICodeAttribute
Answer back the max stack value of the code attribute.

Specified by:
getMaxStack in interface ICodeAttribute
Returns:
the max stack value of the code attribute
See Also:
ICodeAttribute.getMaxStack()

traverse

public void traverse(IBytecodeVisitor visitor)
              throws ClassFormatException
Description copied from interface: ICodeAttribute
Define a Java opcodes walker. All actions are defined in the visitor.

Specified by:
traverse in interface ICodeAttribute
Parameters:
visitor - The visitor to use to walk the opcodes.
Throws:
ClassFormatException - Exception thrown if the opcodes contain invalid bytes
See Also:
ICodeAttribute.traverse(IBytecodeVisitor visitor)