Java Doc for CtField.java in  » Byte-Code » Javassist » javassist » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Byte Code » Javassist » javassist 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javassist.CtMember
      javassist.CtField

CtField
public class CtField extends CtMember (Code)
An instance of CtField represents a field.
See Also:   CtClass.getDeclaredFields

Inner Class :abstract public static class Initializer
Inner Class :abstract static class CodeInitializer0 extends Initializer
Inner Class :static class CodeInitializer extends CodeInitializer0
Inner Class :static class PtreeInitializer extends CodeInitializer0
Inner Class :static class ParamInitializer extends Initializer
Inner Class :static class NewInitializer extends Initializer
Inner Class :static class MethodInitializer extends NewInitializer
Inner Class :static class IntInitializer extends Initializer
Inner Class :static class LongInitializer extends Initializer
Inner Class :static class DoubleInitializer extends Initializer
Inner Class :static class StringInitializer extends Initializer
Inner Class :static class ArrayInitializer extends Initializer
Inner Class :static class MultiArrayInitializer extends Initializer

Field Summary
protected  FieldInfofieldInfo
    
final static  StringjavaLangString
    

Constructor Summary
public  CtField(CtClass type, String name, CtClass declaring)
     Creates a CtField object.
public  CtField(CtField src, CtClass declaring)
     Creates a copy of the given field.
 CtField(FieldInfo fi, CtClass clazz)
    

Method Summary
protected  voidextendToString(StringBuffer buffer)
    
public  Object[]getAnnotations()
     Returns the annotations associated with this field.
public  byte[]getAttribute(String name)
     Obtains an attribute with the given name.
public  Object[]getAvailableAnnotations()
     Returns the annotations associated with this field.
public  ObjectgetConstantValue()
     Returns the value of this field if it is a constant field. This method works only if the field type is a primitive type or String type.
public  CtClassgetDeclaringClass()
     Returns the class declaring the field.
public  FieldInfogetFieldInfo()
     Returns the FieldInfo representing the field in the class file.
public  FieldInfogetFieldInfo2()
     Returns the FieldInfo representing the field in the class file (read only). Normal applications do not need calling this method.
 InitializergetInit()
    
protected  ASTreegetInitAST()
    
public  intgetModifiers()
     Returns the encoded modifiers of the field.
public  StringgetName()
     Returns the name of the field.
public  StringgetSignature()
     Returns the character string representing the type of the field.
public  CtClassgetType()
     Returns the type of the field.
public static  CtFieldmake(String src, CtClass declaring)
     Compiles the given source code and creates a field.
public  voidsetAttribute(String name, byte[] data)
     Adds an attribute.
public  voidsetModifiers(int mod)
     Sets the encoded modifiers of the field.
public  voidsetName(String newName)
     Changes the name of the field.
public  voidsetType(CtClass clazz)
     Sets the type of the field.
public  StringtoString()
     Returns a String representation of the object.

Field Detail
fieldInfo
protected FieldInfo fieldInfo(Code)



javaLangString
final static String javaLangString(Code)




Constructor Detail
CtField
public CtField(CtClass type, String name, CtClass declaring) throws CannotCompileException(Code)
Creates a CtField object. The created field must be added to a class with CtClass.addField(). An initial value of the field is specified by a CtField.Initializer object.

If getter and setter methods are needed, call CtNewMethod.getter() and CtNewMethod.setter().
Parameters:
  type - field type
Parameters:
  name - field name
Parameters:
  declaring - the class to which the field will be added.
See Also:   CtClass.addField(CtField)
See Also:   CtNewMethod.getter(StringCtField)
See Also:   CtNewMethod.setter(StringCtField)
See Also:   CtField.Initializer




CtField
public CtField(CtField src, CtClass declaring) throws CannotCompileException(Code)
Creates a copy of the given field. The created field must be added to a class with CtClass.addField(). An initial value of the field is specified by a CtField.Initializer object.

If getter and setter methods are needed, call CtNewMethod.getter() and CtNewMethod.setter().
Parameters:
  src - the original field
Parameters:
  declaring - the class to which the field will be added.
See Also:   CtNewMethod.getter(StringCtField)
See Also:   CtNewMethod.setter(StringCtField)
See Also:   CtField.Initializer




CtField
CtField(FieldInfo fi, CtClass clazz)(Code)




Method Detail
extendToString
protected void extendToString(StringBuffer buffer)(Code)



getAnnotations
public Object[] getAnnotations() throws ClassNotFoundException(Code)
Returns the annotations associated with this field. an array of annotation-type objects.
See Also:   CtField.getAvailableAnnotations()
since:
   3.1



getAttribute
public byte[] getAttribute(String name)(Code)
Obtains an attribute with the given name. If that attribute is not found in the class file, this method returns null.

Note that an attribute is a data block specified by the class file format. See javassist.bytecode.AttributeInfo .
Parameters:
  name - attribute name




getAvailableAnnotations
public Object[] getAvailableAnnotations()(Code)
Returns the annotations associated with this field. If any annotations are not on the classpath, they are not included in the returned array. an array of annotation-type objects.
See Also:   CtField.getAnnotations()
since:
   3.3



getConstantValue
public Object getConstantValue()(Code)
Returns the value of this field if it is a constant field. This method works only if the field type is a primitive type or String type. Otherwise, it returns null. A constant field is static and final. a Integer, Long, Float,Double, Boolean,or String objectrepresenting the constant value. null if it is not a constant fieldor if the field type is not a primitive typeor String.



getDeclaringClass
public CtClass getDeclaringClass()(Code)
Returns the class declaring the field.



getFieldInfo
public FieldInfo getFieldInfo()(Code)
Returns the FieldInfo representing the field in the class file.



getFieldInfo2
public FieldInfo getFieldInfo2()(Code)
Returns the FieldInfo representing the field in the class file (read only). Normal applications do not need calling this method. Use getFieldInfo().

The FieldInfo object obtained by this method is read only. Changes to this object might not be reflected on a class file generated by toBytecode(), toClass(), etc in CtClass.

This method is available even if the CtClass containing this field is frozen. However, if the class is frozen, the FieldInfo might be also pruned.
See Also:   CtField.getFieldInfo()
See Also:   CtClass.isFrozen
See Also:   CtClass.prune




getInit
Initializer getInit()(Code)



getInitAST
protected ASTree getInitAST()(Code)



getModifiers
public int getModifiers()(Code)
Returns the encoded modifiers of the field.
See Also:   Modifier



getName
public String getName()(Code)
Returns the name of the field.



getSignature
public String getSignature()(Code)
Returns the character string representing the type of the field. If two fields have the same type, getSignature() returns the same string.



getType
public CtClass getType() throws NotFoundException(Code)
Returns the type of the field.



make
public static CtField make(String src, CtClass declaring) throws CannotCompileException(Code)
Compiles the given source code and creates a field. Examples of the source code are:
     "public String name;"
     "public int k = 3;"

Note that the source code ends with ';' (semicolon).
Parameters:
  src - the source text.
Parameters:
  declaring - the class to which the created field is added.




setAttribute
public void setAttribute(String name, byte[] data)(Code)
Adds an attribute. The attribute is saved in the class file.

Note that an attribute is a data block specified by the class file format. See javassist.bytecode.AttributeInfo .
Parameters:
  name - attribute name
Parameters:
  data - attribute value




setModifiers
public void setModifiers(int mod)(Code)
Sets the encoded modifiers of the field.
See Also:   Modifier



setName
public void setName(String newName)(Code)
Changes the name of the field.



setType
public void setType(CtClass clazz)(Code)
Sets the type of the field.



toString
public String toString()(Code)
Returns a String representation of the object.



Fields inherited from javassist.CtMember
protected CtClass declaringClass(Code)(Java Doc)
protected CtMember next(Code)(Java Doc)

Methods inherited from javassist.CtMember
static CtMember append(CtMember list, CtMember previousTail, CtMember tail)(Code)(Java Doc)
static CtMember append(CtMember list, CtMember tail)(Code)(Java Doc)
static int count(CtMember f)(Code)(Java Doc)
abstract protected void extendToString(StringBuffer buffer)(Code)(Java Doc)
abstract public Object[] getAnnotations() throws ClassNotFoundException(Code)(Java Doc)
abstract public byte[] getAttribute(String name)(Code)(Java Doc)
abstract public Object[] getAvailableAnnotations() throws ClassNotFoundException(Code)(Java Doc)
public CtClass getDeclaringClass()(Code)(Java Doc)
abstract public int getModifiers()(Code)(Java Doc)
abstract public String getName()(Code)(Java Doc)
abstract public String getSignature()(Code)(Java Doc)
static CtMember remove(CtMember list, CtMember m)(Code)(Java Doc)
abstract public void setAttribute(String name, byte[] data)(Code)(Java Doc)
abstract public void setModifiers(int mod)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public boolean visibleFrom(CtClass clazz)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.