Java Doc for AnnotationReader.java in  » Net » Terracotta » com » tc » backport175 » bytecode » 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 » Net » Terracotta » com.tc.backport175.bytecode 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.tc.backport175.bytecode.AnnotationReader

AnnotationReader
public class AnnotationReader (Code)
Reads Java 5 java.lang.annotation.RetentionPolicy.RUNTIME and java.lang.annotation.RetentionPolicy.CLASS annotations from the class' bytecode.

Can be used with a custom implementation of the org.codehaus.backport175.reader.bytecode.spi.BytecodeProvider interface.

Note: does not handles java.lang.annotation.Inherited feature. This has to be done in the higher level that knows about the class hierarchy (see backport175.Annotations f.e)
author:
   Jonas Bonér
author:
   Alexandre Vasseur


Inner Class :class AnnotationRetrievingVisitor extends EmptyVisitor
Inner Class :final static class AnnotationRetrievingConstructorVisitor extends EmptyVisitor
Inner Class :final static class AnnotationRetrievingMethodVisitor extends EmptyVisitor
Inner Class :final static class AnnotationRetrievingFieldVisitor extends EmptyVisitor
Inner Class :static class AnnotationBuilderVisitor implements AnnotationVisitor
Inner Class :public static class ClassKey
Inner Class :public static class MemberKey



Method Summary
public  AnnotationVisitorcreateAnnotationVisitor(AnnotationElement.Annotation annotation)
     Returns the annotation visitor to use.
public  AnnotationgetAnnotation(String annotationName)
     Returns the class annotation with the name specified.
public  AnnotationgetAnnotation(String annotationName, Constructor constructor)
     Returns the constructor annotation with the name specified for the constructor specified.
Parameters:
  annotationName - the annotation name
Parameters:
  constructor - the java.lang.reflect.Constructor object to find the annotations on.
public  AnnotationgetAnnotation(String annotationName, Method method)
     Returns the method annotation with the name specified for the method specified.
Parameters:
  annotationName - the annotation name
Parameters:
  method - the java.lang.reflect.Method object to find the annotations on.
public  AnnotationgetAnnotation(String annotationName, Field field)
     Returns the field annotation with the name specified for the field specified.
Parameters:
  annotationName - the annotation name
Parameters:
  field - the java.lang.reflect.Field object to find the annotations on.
public  AnnotationElement.AnnotationgetAnnotationElement(String annotationName)
     Returns the class annotation element with the name specified.
public  AnnotationElement.Annotation[]getAnnotationElements()
     Returns all the class annotations.
public  Annotation[]getAnnotations()
     Returns all the class annotations.
public  Annotation[]getAnnotations(Constructor constructor)
     Returns all the constructor annotations.
Parameters:
  constructor - the java.lang.reflect.Constructor object to find the annotations on.
public  Annotation[]getAnnotations(Method method)
     Returns all the method annotations.
Parameters:
  method - the java.lang.reflect.Method object to find the annotations on.
public  Annotation[]getAnnotations(Field field)
     Returns all the field annotations.
Parameters:
  field - the java.lang.reflect.Field object to find the annotations on.
public static  byte[]getBytecodeFor(String className, ClassLoader loader)
     Returns the bytecode for a class.
public static  BytecodeProvidergetBytecodeProviderFor(Class klass)
     Returns the bytecode provider.
public static  BytecodeProvidergetBytecodeProviderFor(String className, ClassLoader loader)
     Returns the bytecode provider.
public  AnnotationgetConstructorAnnotation(String annotationName, String constructorDesc, ClassLoader loader)
     Returns the constructor annotation with the name specified for the constructor specified.
public  AnnotationElement.AnnotationgetConstructorAnnotationElement(String annotationName, String desc)
     Returns the annotation with the name specified for the constructor specified.
public  AnnotationElement.Annotation[]getConstructorAnnotationElements(String desc)
     Returns all the constructor annotation elements.
public static  BytecodeProvidergetDefaultBytecodeProvider()
     Returns the bytecode provider.
public  AnnotationgetFieldAnnotation(String annotationName, String fieldName, String fieldDesc, ClassLoader loader)
     Returns the field annotation with the name specified for the field specified.
public  AnnotationElement.AnnotationgetFieldAnnotationElement(String annotationName, String name, String desc)
     Returns the annotation with the name specified for the field specified.
public  AnnotationElement.Annotation[]getFieldAnnotationElements(String name, String desc)
     Returns all the field annotation elements.
public  AnnotationgetMethodAnnotation(String annotationName, String methodName, String methodDesc, ClassLoader loader)
     Returns the method annotation with the name specified for the method specified.
public  AnnotationElement.AnnotationgetMethodAnnotationElement(String annotationName, String name, String desc)
     Returns the method annotation with the name specified for the method specified.
public  AnnotationElement.Annotation[]getMethodAnnotationElements(String name, String desc)
     Returns all the method annotation elements.
public static  AnnotationReadergetReaderFor(Class klass)
     Returns the annotation reader for the class specified.
public static  AnnotationReadergetReaderFor(String className, ClassLoader loader)
     Returns the annotation reader for the class specified.
public static  AnnotationReadergetReaderFor(ClassKey classKey)
     Returns the annotation reader for the class specified.
public  booleanisAnnotationPresent(String annotationName)
     Checks if an annotation is present at a specific class.
public  booleanisAnnotationPresent(String annotationName, Constructor constructor)
     Checks if an annotation is present at a specific constructor.
Parameters:
  annotationName - the annotation name
Parameters:
  constructor - the java.lang.reflect.Constructor object to find the annotations on.
public  booleanisAnnotationPresent(String annotationName, Method method)
     Checks if an annotation is present at a specific method.
Parameters:
  annotationName - the annotation name
Parameters:
  method - the java.lang.reflect.Method object to find the annotations on.
public  booleanisAnnotationPresent(String annotationName, Field field)
     Checks if an annotation is present at a specific field.
Parameters:
  annotationName - the annotation name
Parameters:
  field - the java.lang.reflect.Field object to find the annotations on.
public  booleanisConstructorAnnotationPresent(String annotationName, String desc)
     Checks if an annotation is present at a specific constructor.
public  booleanisFieldAnnotationPresent(String annotationName, String name, String desc)
     Checks if an annotation is present at a specific field.
public  booleanisMethodAnnotationPresent(String annotationName, String name, String desc)
     Checks if an annotation is present at a specific method.
public static  voidrefresh(Class klass)
     Resets the annotation reader for the class specified and triggers a new parsing of the newly read bytecode.
public static  voidrefresh(String className, ClassLoader loader)
     Resets the annotation reader for the class specified and triggers a new parsing of the newly read bytecode.
public static  voidrefreshAll()
     Resets *all* the annotation reader and triggers a new parsing of the newly read bytecode.
public static  voidsetBytecodeProviderFor(Class klass, BytecodeProvider bytecodeProvider)
     Sets the bytecode provider.
public static  voidsetBytecodeProviderFor(String className, ClassLoader loader, BytecodeProvider bytecodeProvider)
     Sets the bytecode provider.
public static  voidsetDefaultBytecodeProvider(BytecodeProvider bytecodeProvider)
     Sets the bytecode provider.
public static  StringtoJavaName(String desc)
     Converts the annotion class description to a Java class name.



Method Detail
createAnnotationVisitor
public AnnotationVisitor createAnnotationVisitor(AnnotationElement.Annotation annotation)(Code)
Returns the annotation visitor to use.

Swap to the 'tracing' visitor for simple debugging.
Parameters:
  annotation -




getAnnotation
public Annotation getAnnotation(String annotationName)(Code)
Returns the class annotation with the name specified.
Parameters:
  annotationName - the class annotation



getAnnotation
public Annotation getAnnotation(String annotationName, Constructor constructor)(Code)
Returns the constructor annotation with the name specified for the constructor specified.
Parameters:
  annotationName - the annotation name
Parameters:
  constructor - the java.lang.reflect.Constructor object to find the annotations on. the constructor annotation



getAnnotation
public Annotation getAnnotation(String annotationName, Method method)(Code)
Returns the method annotation with the name specified for the method specified.
Parameters:
  annotationName - the annotation name
Parameters:
  method - the java.lang.reflect.Method object to find the annotations on. the method annotation



getAnnotation
public Annotation getAnnotation(String annotationName, Field field)(Code)
Returns the field annotation with the name specified for the field specified.
Parameters:
  annotationName - the annotation name
Parameters:
  field - the java.lang.reflect.Field object to find the annotations on. the field annotation



getAnnotationElement
public AnnotationElement.Annotation getAnnotationElement(String annotationName)(Code)
Returns the class annotation element with the name specified.
Parameters:
  annotationName - the class annotation



getAnnotationElements
public AnnotationElement.Annotation[] getAnnotationElements()(Code)
Returns all the class annotations. an array with the class annotations



getAnnotations
public Annotation[] getAnnotations()(Code)
Returns all the class annotations. an array with the class annotations



getAnnotations
public Annotation[] getAnnotations(Constructor constructor)(Code)
Returns all the constructor annotations.
Parameters:
  constructor - the java.lang.reflect.Constructor object to find the annotations on. an array with the constructor annotations



getAnnotations
public Annotation[] getAnnotations(Method method)(Code)
Returns all the method annotations.
Parameters:
  method - the java.lang.reflect.Method object to find the annotations on. an array with the method annotations



getAnnotations
public Annotation[] getAnnotations(Field field)(Code)
Returns all the field annotations.
Parameters:
  field - the java.lang.reflect.Field object to find the annotations on. an array with the field annotations



getBytecodeFor
public static byte[] getBytecodeFor(String className, ClassLoader loader) throws Exception(Code)
Returns the bytecode for a class.
Parameters:
  className -
Parameters:
  loader - the bytecode for a class



getBytecodeProviderFor
public static BytecodeProvider getBytecodeProviderFor(Class klass)(Code)
Returns the bytecode provider.
Parameters:
  klass - the bytecode provider



getBytecodeProviderFor
public static BytecodeProvider getBytecodeProviderFor(String className, ClassLoader loader)(Code)
Returns the bytecode provider.
Parameters:
  className -
Parameters:
  loader - the bytecode provider



getConstructorAnnotation
public Annotation getConstructorAnnotation(String annotationName, String constructorDesc, ClassLoader loader)(Code)
Returns the constructor annotation with the name specified for the constructor specified.
Parameters:
  annotationName -
Parameters:
  constructorDesc -
Parameters:
  loader -



getConstructorAnnotationElement
public AnnotationElement.Annotation getConstructorAnnotationElement(String annotationName, String desc)(Code)
Returns the annotation with the name specified for the constructor specified.
Parameters:
  annotationName - the annotation name
Parameters:
  desc - the constructor desc the constructor annotation element



getConstructorAnnotationElements
public AnnotationElement.Annotation[] getConstructorAnnotationElements(String desc)(Code)
Returns all the constructor annotation elements.
Parameters:
  desc - the constructor desc an array with the constructor annotation elements



getDefaultBytecodeProvider
public static BytecodeProvider getDefaultBytecodeProvider()(Code)
Returns the bytecode provider. the bytecode provider



getFieldAnnotation
public Annotation getFieldAnnotation(String annotationName, String fieldName, String fieldDesc, ClassLoader loader)(Code)
Returns the field annotation with the name specified for the field specified.
Parameters:
  annotationName -
Parameters:
  fieldName -
Parameters:
  fieldDesc -
Parameters:
  loader -



getFieldAnnotationElement
public AnnotationElement.Annotation getFieldAnnotationElement(String annotationName, String name, String desc)(Code)
Returns the annotation with the name specified for the field specified.
Parameters:
  annotationName - the annotation name
Parameters:
  name - the field name
Parameters:
  desc - the field desc the field annotation element



getFieldAnnotationElements
public AnnotationElement.Annotation[] getFieldAnnotationElements(String name, String desc)(Code)
Returns all the field annotation elements.
Parameters:
  name - the field name
Parameters:
  desc - the field desc an array with the field annotation elements



getMethodAnnotation
public Annotation getMethodAnnotation(String annotationName, String methodName, String methodDesc, ClassLoader loader)(Code)
Returns the method annotation with the name specified for the method specified.
Parameters:
  annotationName -
Parameters:
  methodName -
Parameters:
  methodDesc -
Parameters:
  loader -



getMethodAnnotationElement
public AnnotationElement.Annotation getMethodAnnotationElement(String annotationName, String name, String desc)(Code)
Returns the method annotation with the name specified for the method specified.
Parameters:
  annotationName - the annotation name
Parameters:
  name - the method name
Parameters:
  desc - the method desc the method annotation element



getMethodAnnotationElements
public AnnotationElement.Annotation[] getMethodAnnotationElements(String name, String desc)(Code)
Returns all the method annotation elements.
Parameters:
  name - the method name
Parameters:
  desc - the method desc an array with the method annotation elements



getReaderFor
public static AnnotationReader getReaderFor(Class klass)(Code)
Returns the annotation reader for the class specified.

The annotation reader is created and cached if non-existant.
Parameters:
  klass - the annotation reader




getReaderFor
public static AnnotationReader getReaderFor(String className, ClassLoader loader)(Code)
Returns the annotation reader for the class specified.

The annotation reader is created and cached if non-existant.
Parameters:
  className -
Parameters:
  loader - the annotation reader




getReaderFor
public static AnnotationReader getReaderFor(ClassKey classKey)(Code)
Returns the annotation reader for the class specified.

The annotation reader is created and cached if non-existant.
Parameters:
  classKey - the annotation reader




isAnnotationPresent
public boolean isAnnotationPresent(String annotationName)(Code)
Checks if an annotation is present at a specific class.
Parameters:
  annotationName - the annotation name true if the annotation is present else false



isAnnotationPresent
public boolean isAnnotationPresent(String annotationName, Constructor constructor)(Code)
Checks if an annotation is present at a specific constructor.
Parameters:
  annotationName - the annotation name
Parameters:
  constructor - the java.lang.reflect.Constructor object to find the annotations on. true if the annotation is present else false



isAnnotationPresent
public boolean isAnnotationPresent(String annotationName, Method method)(Code)
Checks if an annotation is present at a specific method.
Parameters:
  annotationName - the annotation name
Parameters:
  method - the java.lang.reflect.Method object to find the annotations on. true if the annotation is present else false



isAnnotationPresent
public boolean isAnnotationPresent(String annotationName, Field field)(Code)
Checks if an annotation is present at a specific field.
Parameters:
  annotationName - the annotation name
Parameters:
  field - the java.lang.reflect.Field object to find the annotations on. true if the annotation is present else false



isConstructorAnnotationPresent
public boolean isConstructorAnnotationPresent(String annotationName, String desc)(Code)
Checks if an annotation is present at a specific constructor.
Parameters:
  annotationName - the annotation name
Parameters:
  desc - the constructor desc true if the annotation is present else false



isFieldAnnotationPresent
public boolean isFieldAnnotationPresent(String annotationName, String name, String desc)(Code)
Checks if an annotation is present at a specific field.
Parameters:
  annotationName - the annotation name
Parameters:
  name - the field name
Parameters:
  desc - the field desc true if the annotation is present else false



isMethodAnnotationPresent
public boolean isMethodAnnotationPresent(String annotationName, String name, String desc)(Code)
Checks if an annotation is present at a specific method.
Parameters:
  annotationName - the annotation name
Parameters:
  name - the method name
Parameters:
  desc - the method desc true if the annotation is present else false



refresh
public static void refresh(Class klass)(Code)
Resets the annotation reader for the class specified and triggers a new parsing of the newly read bytecode.

This method calls parse and is therefore all the is needed to invoke to get a fully updated reader.
Parameters:
  klass -




refresh
public static void refresh(String className, ClassLoader loader)(Code)
Resets the annotation reader for the class specified and triggers a new parsing of the newly read bytecode.

This method calls parse and is therefore all the is needed to invoke to get a fully updated reader.
Parameters:
  className -
Parameters:
  loader -




refreshAll
public static void refreshAll()(Code)
Resets *all* the annotation reader and triggers a new parsing of the newly read bytecode.

This method will force parsing of all classes bytecode which might be very time consuming, use with care.

This method calls parse and is therefore all the is needed to invoke to get a fully updated reader.




setBytecodeProviderFor
public static void setBytecodeProviderFor(Class klass, BytecodeProvider bytecodeProvider)(Code)
Sets the bytecode provider.

If a custom provider is not set then a default impl will be used (which reads the bytecode from disk).
Parameters:
  klass -
Parameters:
  bytecodeProvider -




setBytecodeProviderFor
public static void setBytecodeProviderFor(String className, ClassLoader loader, BytecodeProvider bytecodeProvider)(Code)
Sets the bytecode provider.

If a custom provider is not set then a default impl will be used (which reads the bytecode from disk).
Parameters:
  className -
Parameters:
  loader -
Parameters:
  bytecodeProvider -




setDefaultBytecodeProvider
public static void setDefaultBytecodeProvider(BytecodeProvider bytecodeProvider)(Code)
Sets the bytecode provider.

If a custom provider is not set then a default impl will be used (which reads the bytecode from disk).
Parameters:
  bytecodeProvider -




toJavaName
public static String toJavaName(String desc)(Code)
Converts the annotion class description to a Java class name. Caution: Does not handles array type or primitive.
Parameters:
  desc -



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.