Methods Summary |
---|
public int | access()Return the access flags for the method - see VMConstants
/* public accessors */
return accessFlags;
|
public AttributeVector | attributes()Return the attributes associated with the method
return methodAttributes;
|
public void | changeName(ConstUtf8 name)Change the name of the method
methodName = name;
|
public void | changeSignature(ConstUtf8 newSig)Change the type signature of the method
methodSignature = newSig;
|
public CodeAttribute | codeAttribute()Returns the CodeAttribute associated with this method (if any)
Enumeration e = methodAttributes.elements();
while (e.hasMoreElements()) {
ClassAttribute attr = (ClassAttribute) e.nextElement();
if (attr instanceof CodeAttribute)
return (CodeAttribute) attr;
}
return null;
|
int | codeSize()Returns the size of the method byteCode (if any)
CodeAttribute codeAttr = codeAttribute();
return (codeAttr == null) ? 0 : codeAttr.codeSize();
|
public boolean | isAbstract()Is the method abstract?
return (accessFlags & ACCAbstract) != 0;
|
public boolean | isNative()Is the method native?
return (accessFlags & ACCNative) != 0;
|
public ConstUtf8 | name()Return the name of the method
return methodName;
|
void | print(java.io.PrintStream out, int indent)
ClassPrint.spaces(out, indent);
out.print("'" + methodName.asString() + "'");//NOI18N
out.print(" sig = " + methodSignature.asString());//NOI18N
out.print(" accessFlags = " + Integer.toString(accessFlags));//NOI18N
out.println(" attributes:");//NOI18N
methodAttributes.print(out, indent+2);
|
static com.sun.jdo.api.persistence.enhancer.classfile.ClassMethod | read(java.io.DataInputStream data, ConstantPool pool)
int accessFlags = data.readUnsignedShort();
int nameIndex = data.readUnsignedShort();
int sigIndex = data.readUnsignedShort();
ClassMethod f =
new ClassMethod(accessFlags,
(ConstUtf8) pool.constantAt(nameIndex),
(ConstUtf8) pool.constantAt(sigIndex),
null);
f.methodAttributes = AttributeVector.readAttributes(data, pool);
return f;
|
public void | setAccess(int newFlags)Update the access flags for the field - see VMConstants
accessFlags = newFlags;
|
public ConstUtf8 | signature()Return the type signature of the method
return methodSignature;
|
void | write(java.io.DataOutputStream data)
CodeAttribute codeAttr = codeAttribute();
data.writeShort(accessFlags);
data.writeShort(methodName.getIndex());
data.writeShort(methodSignature.getIndex());
methodAttributes.write(data);
|