Java Doc for AnnotationsWriter.java in  » Byte-Code » Javassist » javassist » bytecode » annotation » 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.bytecode.annotation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javassist.bytecode.annotation.AnnotationsWriter

AnnotationsWriter
public class AnnotationsWriter (Code)
A convenience class for constructing a ..Annotations_attribute. See the source code of the AnnotationsAttribute.Copier class.

The following code snippet is an example of use of this class:

     ConstPool pool = ...;
     output = new ByteArrayOutputStream();
     writer = new AnnotationsWriter(output, pool);
     writer.numAnnotations(1);
     writer.annotation("Author", 2);
     writer.memberValuePair("name");
     writer.constValueIndex("chiba");
     writer.memberValuePair("address");
     writer.constValueIndex("tokyo");
     writer.close();
     byte[] attribute_info = output.toByteArray();
     AnnotationsAttribute anno
     = new AnnotationsAttribute(pool, AnnotationsAttribute.visibleTag,
     attribute_info);
     

The code snippet above generates the annotation attribute corresponding to this annotation:

      @Author(name = "chiba", address = "tokyo")
     

See Also:   javassist.bytecode.AnnotationsAttribute
See Also:   javassist.bytecode.ParameterAnnotationsAttribute



Constructor Summary
public  AnnotationsWriter(OutputStream os, ConstPool cp)
     Constructs with the given output stream.

Method Summary
public  voidannotation(String type, int numMemberValuePairs)
     Writes annotation.
public  voidannotation(int typeIndex, int numMemberValuePairs)
     Writes annotation.
public  voidannotationValue()
     Writes tag and annotation_value in member_value.
public  voidarrayValue(int numValues)
     Writes tag and array_value in member_value.
public  voidclassInfoIndex(String name)
     Writes tag and class_info_index in member_value.
public  voidclassInfoIndex(int index)
     Writes tag and class_info_index in member_value.
public  voidclose()
     Closes the output stream.
public  voidconstValueIndex(boolean value)
     Writes tag and const_value_index in member_value.
public  voidconstValueIndex(byte value)
     Writes tag and const_value_index in member_value.
public  voidconstValueIndex(char value)
     Writes tag and const_value_index in member_value.
public  voidconstValueIndex(short value)
     Writes tag and const_value_index in member_value.
public  voidconstValueIndex(int value)
     Writes tag and const_value_index in member_value.
public  voidconstValueIndex(long value)
     Writes tag and const_value_index in member_value.
public  voidconstValueIndex(float value)
     Writes tag and const_value_index in member_value.
public  voidconstValueIndex(double value)
     Writes tag and const_value_index in member_value.
public  voidconstValueIndex(String value)
     Writes tag and const_value_index in member_value.
public  voidconstValueIndex(int tag, int index)
     Writes tag and const_value_index in member_value.
public  voidenumConstValue(String typeName, String constName)
     Writes tag and enum_const_value in member_value.
public  voidenumConstValue(int typeNameIndex, int constNameIndex)
     Writes tag and enum_const_value in member_value.
public  ConstPoolgetConstPool()
     Obtains the constant pool given to the constructor.
public  voidmemberValuePair(String memberName)
     Writes an element of a member_value_pairs array in annotation.
public  voidmemberValuePair(int memberNameIndex)
     Writes an element of a member_value_pairs array in annotation.
public  voidnumAnnotations(int num)
     Writes num_annotations in Runtime(In)VisibleAnnotations_attribute.
public  voidnumParameters(int num)
     Writes num_parameters in Runtime(In)VisibleParameterAnnotations_attribute.


Constructor Detail
AnnotationsWriter
public AnnotationsWriter(OutputStream os, ConstPool cp)(Code)
Constructs with the given output stream.
Parameters:
  os - the output stream.
Parameters:
  cp - the constant pool.




Method Detail
annotation
public void annotation(String type, int numMemberValuePairs) throws IOException(Code)
Writes annotation. This method must be followed by numMemberValuePairs calls to memberValuePair().
Parameters:
  type - the annotation interface name.
Parameters:
  numMemberValuePairs - num_member_value_pairsin annotation.



annotation
public void annotation(int typeIndex, int numMemberValuePairs) throws IOException(Code)
Writes annotation. This method must be followed by numMemberValuePairs calls to memberValuePair().
Parameters:
  typeIndex - type_index in annotation.
Parameters:
  numMemberValuePairs - num_member_value_pairsin annotation.



annotationValue
public void annotationValue() throws IOException(Code)
Writes tag and annotation_value in member_value. This method must be followed by a call to annotation().



arrayValue
public void arrayValue(int numValues) throws IOException(Code)
Writes tag and array_value in member_value. This method must be followed by numValues calls to constValueIndex(), enumConstValue(), etc.
Parameters:
  numValues - num_valuesin array_value.



classInfoIndex
public void classInfoIndex(String name) throws IOException(Code)
Writes tag and class_info_index in member_value.
Parameters:
  name - the class name.



classInfoIndex
public void classInfoIndex(int index) throws IOException(Code)
Writes tag and class_info_index in member_value.
Parameters:
  index - class_info_index



close
public void close() throws IOException(Code)
Closes the output stream.



constValueIndex
public void constValueIndex(boolean value) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  value - the constant value.



constValueIndex
public void constValueIndex(byte value) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  value - the constant value.



constValueIndex
public void constValueIndex(char value) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  value - the constant value.



constValueIndex
public void constValueIndex(short value) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  value - the constant value.



constValueIndex
public void constValueIndex(int value) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  value - the constant value.



constValueIndex
public void constValueIndex(long value) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  value - the constant value.



constValueIndex
public void constValueIndex(float value) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  value - the constant value.



constValueIndex
public void constValueIndex(double value) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  value - the constant value.



constValueIndex
public void constValueIndex(String value) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  value - the constant value.



constValueIndex
public void constValueIndex(int tag, int index) throws IOException(Code)
Writes tag and const_value_index in member_value.
Parameters:
  tag - tag in member_value.
Parameters:
  index - const_value_indexin member_value.



enumConstValue
public void enumConstValue(String typeName, String constName) throws IOException(Code)
Writes tag and enum_const_value in member_value.
Parameters:
  typeName - the type name of the enum constant.
Parameters:
  constName - the simple name of the enum constant.



enumConstValue
public void enumConstValue(int typeNameIndex, int constNameIndex) throws IOException(Code)
Writes tag and enum_const_value in member_value.
Parameters:
  typeNameIndex - type_name_indexin member_value.
Parameters:
  constNameIndex - const_name_indexin member_value.



getConstPool
public ConstPool getConstPool()(Code)
Obtains the constant pool given to the constructor.



memberValuePair
public void memberValuePair(String memberName) throws IOException(Code)
Writes an element of a member_value_pairs array in annotation. This method must be followed by a call to constValueIndex(), enumConstValue(), etc.
Parameters:
  memberName - the name of the annotation type member.



memberValuePair
public void memberValuePair(int memberNameIndex) throws IOException(Code)
Writes an element of a member_value_pairs array in annotation. This method must be followed by a call to constValueIndex(), enumConstValue(), etc.
Parameters:
  memberNameIndex - member_name_indexin member_value_pairs array.



numAnnotations
public void numAnnotations(int num) throws IOException(Code)
Writes num_annotations in Runtime(In)VisibleAnnotations_attribute. This method must be followed by num calls to annotation().



numParameters
public void numParameters(int num) throws IOException(Code)
Writes num_parameters in Runtime(In)VisibleParameterAnnotations_attribute. This method must be followed by num calls to numAnnotations().



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.