com.caucho.bytecode
Class JavaMethod

java.lang.Object
  extended by com.caucho.bytecode.JAnnotationObject
      extended by com.caucho.bytecode.JAccessibleObject
          extended by com.caucho.bytecode.JMethod
              extended by com.caucho.bytecode.JavaMethod

public class JavaMethod
extends JMethod

Represents a java field.


Constructor Summary
JavaMethod()
           
JavaMethod(JavaClassLoader loader)
           
 
Method Summary
 void addAttribute(Attribute attr)
          Adds an attribute.
 void concatenate(JavaMethod tail)
          Concatenates the method.
 CodeAttribute createCode()
          Create the code attribute.
 CodeWriterAttribute createCodeWriter()
           
 JavaMethod export(JavaClass source, JavaClass target)
          exports the method.
 int getAccessFlags()
          Gets the access flags
 Attribute getAttribute(java.lang.String name)
          Returns the attribute.
 java.util.ArrayList<Attribute> getAttributes()
          Returns the attribute.
 JavaClassLoader getClassLoader()
          Returns the class loader.
 CodeAttribute getCode()
          Returns the code attribute.
 JAnnotation[] getDeclaredAnnotations()
          Returns the declared annotations.
 JClass getDeclaringClass()
          Returns the declaring class.
 java.lang.String getDescriptor()
          Gets the descriptor.
 JClass[] getExceptionTypes()
          Returns the exception types.
 JType getGenericReturnType()
          Returns the return type.
 int getLine()
          Returns the line number.
 java.lang.String getName()
          Gets the name.
 JClass[] getParameterTypes()
          Returns the parameter types.
 JClass getReturnType()
          Returns the return types.
 boolean isAbstract()
          Returns true for an abstract method
 boolean isFinal()
          Returns true for a final method
 boolean isPrivate()
          Returns true for a private method
 boolean isProtected()
          Returns true for a protected method
 boolean isPublic()
          Returns true for a public method
 boolean isStatic()
          Returns true for a static method
 Attribute removeAttribute(java.lang.String name)
          Removes an attribute.
 void setAccessFlags(int flags)
          Sets the access flags
 void setDescriptor(java.lang.String descriptor)
          Sets the descriptor.
 void setExceptionTypes(JClass[] exceptions)
          Sets the exception types
 void setJavaClass(JavaClass jClass)
          Sets the JavaClass.
 void setName(java.lang.String name)
          Sets the name.
 void setWrite(boolean isWrite)
           
 java.lang.String toString()
           
 void write(ByteCodeWriter out)
          Writes the field to the output.
 
Methods inherited from class com.caucho.bytecode.JMethod
equals, getFullName
 
Methods inherited from class com.caucho.bytecode.JAnnotationObject
getAnnotation, getAnnotation, isAnnotationPresent, isAnnotationPresent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaMethod

public JavaMethod(JavaClassLoader loader)

JavaMethod

public JavaMethod()
Method Detail

setJavaClass

public void setJavaClass(JavaClass jClass)
Sets the JavaClass.


setWrite

public void setWrite(boolean isWrite)

setName

public void setName(java.lang.String name)
Sets the name.


getName

public java.lang.String getName()
Gets the name.

Specified by:
getName in class JMethod

getLine

public int getLine()
Returns the line number.

Overrides:
getLine in class JAccessibleObject

getClassLoader

public JavaClassLoader getClassLoader()
Returns the class loader.


setAccessFlags

public void setAccessFlags(int flags)
Sets the access flags


getAccessFlags

public int getAccessFlags()
Gets the access flags


isFinal

public boolean isFinal()
Returns true for a final method

Specified by:
isFinal in class JMethod

isPublic

public boolean isPublic()
Returns true for a public method

Specified by:
isPublic in class JMethod

isProtected

public boolean isProtected()
Returns true for a protected method

Specified by:
isProtected in class JMethod

isPrivate

public boolean isPrivate()
Returns true for a private method

Specified by:
isPrivate in class JMethod

isAbstract

public boolean isAbstract()
Returns true for an abstract method

Specified by:
isAbstract in class JMethod

isStatic

public boolean isStatic()
Returns true for a static method

Specified by:
isStatic in class JMethod

setDescriptor

public void setDescriptor(java.lang.String descriptor)
Sets the descriptor.


getDescriptor

public java.lang.String getDescriptor()
Gets the descriptor.


getDeclaringClass

public JClass getDeclaringClass()
Returns the declaring class.

Specified by:
getDeclaringClass in class JMethod

getReturnType

public JClass getReturnType()
Returns the return types.

Specified by:
getReturnType in class JMethod

getGenericReturnType

public JType getGenericReturnType()
Returns the return type.

Specified by:
getGenericReturnType in class JMethod

getParameterTypes

public JClass[] getParameterTypes()
Returns the parameter types.

Specified by:
getParameterTypes in class JMethod

setExceptionTypes

public void setExceptionTypes(JClass[] exceptions)
Sets the exception types


getExceptionTypes

public JClass[] getExceptionTypes()
Returns the exception types.

Specified by:
getExceptionTypes in class JMethod

addAttribute

public void addAttribute(Attribute attr)
Adds an attribute.


createCodeWriter

public CodeWriterAttribute createCodeWriter()

removeAttribute

public Attribute removeAttribute(java.lang.String name)
Removes an attribute.


getAttributes

public java.util.ArrayList<Attribute> getAttributes()
Returns the attribute.


getAttribute

public Attribute getAttribute(java.lang.String name)
Returns the attribute.


getDeclaredAnnotations

public JAnnotation[] getDeclaredAnnotations()
Returns the declared annotations.

Specified by:
getDeclaredAnnotations in class JMethod

getCode

public CodeAttribute getCode()
Returns the code attribute.


createCode

public CodeAttribute createCode()
Create the code attribute.


write

public void write(ByteCodeWriter out)
           throws java.io.IOException
Writes the field to the output.

Throws:
java.io.IOException

export

public JavaMethod export(JavaClass source,
                         JavaClass target)
exports the method.


concatenate

public void concatenate(JavaMethod tail)
Concatenates the method.


toString

public java.lang.String toString()
Overrides:
toString in class JMethod