com.caucho.bytecode
Class JavaField

java.lang.Object
  extended by com.caucho.bytecode.JAnnotationObject
      extended by com.caucho.bytecode.JAccessibleObject
          extended by com.caucho.bytecode.JField
              extended by com.caucho.bytecode.JavaField

public class JavaField
extends JField

Represents a java field.


Constructor Summary
JavaField()
           
 
Method Summary
 void addAttribute(Attribute attr)
          Adds an attribute.
 boolean equals(java.lang.Object o)
          Returns true if equals.
 JavaField export(JavaClass cl, JavaClass target)
          exports the field
 int getAccessFlags()
          Gets the access flags
 Attribute getAttribute(java.lang.String name)
          Returns the attribute.
 JavaClassLoader getClassLoader()
          Returns the class loader.
 JAnnotation[] getDeclaredAnnotations()
          Returns the declared annotations.
 JClass getDeclaringClass()
          Returns the declaring class.
 java.lang.String getDescriptor()
          Gets the descriptor.
 JType getGenericType()
          Gets the typename.
 java.lang.String getName()
          Gets the name.
 JClass getType()
          Gets the typename.
 boolean isPrivate()
          Returns true for a private field.
 boolean isStatic()
          Returns true for a static field.
 boolean isTransient()
          Returns true for a transient field.
 void setAccessFlags(int flags)
          Sets the access flags
 void setDescriptor(java.lang.String descriptor)
          Sets the descriptor.
 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.JField
getReturnType
 
Methods inherited from class com.caucho.bytecode.JAccessibleObject
getLine
 
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

JavaField

public JavaField()
Method Detail

setJavaClass

public void setJavaClass(JavaClass jClass)
Sets the JavaClass.


setWrite

public void setWrite(boolean isWrite)

getDeclaringClass

public JClass getDeclaringClass()
Returns the declaring class.

Specified by:
getDeclaringClass in class JField

getClassLoader

public JavaClassLoader getClassLoader()
Returns the class loader.


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 JField

setAccessFlags

public void setAccessFlags(int flags)
Sets the access flags


getAccessFlags

public int getAccessFlags()
Gets the access flags


setDescriptor

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


getDescriptor

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


getType

public JClass getType()
Gets the typename.

Specified by:
getType in class JField

isStatic

public boolean isStatic()
Returns true for a static field.

Specified by:
isStatic in class JField

isPrivate

public boolean isPrivate()
Returns true for a private field.

Specified by:
isPrivate in class JField

isTransient

public boolean isTransient()
Returns true for a transient field.

Specified by:
isTransient in class JField

getGenericType

public JType getGenericType()
Gets the typename.

Specified by:
getGenericType in class JField

addAttribute

public void addAttribute(Attribute attr)
Adds an attribute.


getAttribute

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


getDeclaredAnnotations

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

Overrides:
getDeclaredAnnotations in class JAnnotationObject

write

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

Throws:
java.io.IOException

export

public JavaField export(JavaClass cl,
                        JavaClass target)
exports the field


equals

public boolean equals(java.lang.Object o)
Description copied from class: JField
Returns true if equals.

Overrides:
equals in class JField

toString

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