Java Doc for Navigator.java in  » 6.0-JDK-Modules » jaxb-impl » com » sun » xml » bind » v2 » model » nav » 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 » 6.0 JDK Modules » jaxb impl » com.sun.xml.bind.v2.model.nav 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.xml.bind.v2.model.nav.Navigator

Navigator
public interface Navigator (Code)
Provides unified view of the underlying reflection library, such as java.lang.reflect and/or APT.

This interface provides navigation over the reflection model to decouple the caller from any particular implementation. This allows the JAXB RI to reuse much of the code between the compile time (which works on top of APT) and the run-time (which works on top of java.lang.reflect )

Navigator instances are stateless and immutable.

Parameterization

C

A Java class declaration (not an interface, a class and an enum.)

T

A Java type. This includs declaration, but also includes such things like arrays, primitive types, parameterized types, and etc.
author:
   Kohsuke Kawaguchi (kk@kohsuke.org)



Field Summary
final public static  ReflectionNavigatorREFLECTION
     The singleton instance.


Method Summary
 CasDecl(T type)
     If the given type is an use of class declaration, returns the type casted as C .
 CasDecl(Class c)
     Gets the C representation for the given class.
 Terasure(T contentInMemoryType)
    
 CfindClass(String className, C referencePoint)
     Finds the class/interface/enum/annotation of the given name.
 TgetBaseClass(T type, C baseType)
     Gets the parameterization of the given base type.
 LocationgetClassLocation(C clazz)
     Returns a location of the specified class.
 StringgetClassName(C clazz)
     Gets the fully-qualified name of the class.
 StringgetClassShortName(C clazz)
     Gets the short name of the class ("Object" for Object .) For nested classes, this method should just return the inner name.
 TgetComponentType(T t)
     Gets the component type of the array.
 FgetDeclaredField(C clazz, String fieldName)
     Gets the named field declared on the given class.
 Collection<? extends F>getDeclaredFields(C clazz)
     Gets all the declared fields of the given class.
 Collection<? extends M>getDeclaredMethods(C clazz)
     Gets all the declared methods of the given class (regardless of their access modifiers, regardless of whether they override methods of the base classes.)

Note that this method does not list methods declared on base classes. can be empty but always non-null.

 CgetDeclaringClassForField(F field)
     Gets the class that declares the given field.
 CgetDeclaringClassForMethod(M method)
     Gets the class that declares the given method.
 F[]getEnumConstants(C clazz)
     Gets the enumeration constants from an enum class.
 LocationgetFieldLocation(F field)
    
 StringgetFieldName(F field)
     Gets the name of the field.
 TgetFieldType(F f)
     Gets the type of the field.
 LocationgetMethodLocation(M getter)
    
 StringgetMethodName(M m)
     Gets the name of the method, such as "toString" or "equals".
 T[]getMethodParameters(M method)
     Returns the list of parameters to the method.
 StringgetPackageName(C clazz)
     Gets the package name of the given class. i.e.
 TgetPrimitive(Class primitiveType)
     Returns the representation for the given primitive type.
 TgetReturnType(M m)
     Gets the return type of a method.
 CgetSuperClass(C clazz)
     Gets the base class of the specified class.
 TgetTypeArgument(T t, int i)
     Gets the i-th type argument from a parameterized type.
 StringgetTypeName(T rawType)
    
 TgetVoidType()
     Gets the representation of the primitive "void" type.
 booleanhasDefaultConstructor(C clazz)
     Returns true if the given class has a no-arg default constructor.
 booleanisAbstract(C clazz)
     Returns true if this is an abstract class.
 booleanisArray(T t)
     Checks if the type is an array type.
 booleanisArrayButNotByteArray(T t)
     Checks if the type is an array type but not byte[].
 booleanisBridgeMethod(M method)
     Returns true if this method is a bridge method as defined in JLS.
 booleanisEnum(C clazz)
     Returns true if this is an enum class.
 booleanisFinal(C clazz)
     Returns true if this is a final class.
 booleanisInnerClass(C clazz)
     Returns true if the given class is an inner class.
 booleanisInterface(C clazz)
     Returns true if 'clazz' is an interface.
 booleanisOverriding(M method, C base)
     Returns true if the given method is overriding another one defined in the base class 'base' or its ancestors.
 booleanisParameterizedType(T t)
     Returns true if t is a parameterized type.
 booleanisPrimitive(T t)
     Checks if the given type is a primitive type.
 booleanisPublicField(F field)
     Returns true if the field is public.
 booleanisPublicMethod(M method)
     Returns true if the method is public.
 booleanisStaticField(F field)
     Returns true if the field is static.
 booleanisStaticMethod(M method)
     Returns true if the method is static.
 booleanisSubClassOf(T sub, T sup)
     Checks if sub is a sub-type of sup .
 booleanisTransient(F f)
     Returns true if the field is transient.
 Tref(Class c)
     Gets the representation of the given Java type in T .
 Tuse(C c)
     Gets the T for the given C.

Field Detail
REFLECTION
final public static ReflectionNavigator REFLECTION(Code)
The singleton instance.





Method Detail
asDecl
C asDecl(T type)(Code)
If the given type is an use of class declaration, returns the type casted as C . Otherwise null.

TODO: define the exact semantics.




asDecl
C asDecl(Class c)(Code)
Gets the C representation for the given class. The behavior is undefined if the class object represents primitives, arrays, and other types that are not class declaration.



erasure
T erasure(T contentInMemoryType)(Code)
Computes the erasure



findClass
C findClass(String className, C referencePoint)(Code)
Finds the class/interface/enum/annotation of the given name.
Parameters:
  referencePoint - The class that refers to the specified class.null if not found.



getBaseClass
T getBaseClass(T type, C baseType)(Code)
Gets the parameterization of the given base type.

For example, given the following


 interface Foo<T> extends List<List<T>> {}
 interface Bar extends Foo<String> {}
 
This method works like this:

 getBaseClass( Bar, List ) = List<List<String>
 getBaseClass( Bar, Foo  ) = Foo<String>
 getBaseClass( Foo<? extends Number>, Collection ) = Collection<List<? extends Number>>
 getBaseClass( ArrayList<? extends BigInteger>, List ) = List<? extends BigInteger>
 

Parameters:
  type - The type that derives from baseType
Parameters:
  baseType - The class whose parameterization we are interested in.The use of baseType in type .or null if the type is not assignable to the base type.



getClassLocation
Location getClassLocation(C clazz)(Code)
Returns a location of the specified class.



getClassName
String getClassName(C clazz)(Code)
Gets the fully-qualified name of the class. ("java.lang.Object" for Object )



getClassShortName
String getClassShortName(C clazz)(Code)
Gets the short name of the class ("Object" for Object .) For nested classes, this method should just return the inner name. (for example "Inner" for "com.acme.Outer$Inner".



getComponentType
T getComponentType(T t)(Code)
Gets the component type of the array.
Parameters:
  t - must be an array.



getDeclaredField
F getDeclaredField(C clazz, String fieldName)(Code)
Gets the named field declared on the given class. This method doesn't visit ancestors, but does recognize non-public fields. null if not found



getDeclaredFields
Collection<? extends F> getDeclaredFields(C clazz)(Code)
Gets all the declared fields of the given class.



getDeclaredMethods
Collection<? extends M> getDeclaredMethods(C clazz)(Code)
Gets all the declared methods of the given class (regardless of their access modifiers, regardless of whether they override methods of the base classes.)

Note that this method does not list methods declared on base classes. can be empty but always non-null.




getDeclaringClassForField
C getDeclaringClassForField(F field)(Code)
Gets the class that declares the given field.



getDeclaringClassForMethod
C getDeclaringClassForMethod(M method)(Code)
Gets the class that declares the given method.



getEnumConstants
F[] getEnumConstants(C clazz)(Code)
Gets the enumeration constants from an enum class.
Parameters:
  clazz - must derive from Enum.can be empty but never null.



getFieldLocation
Location getFieldLocation(F field)(Code)



getFieldName
String getFieldName(F field)(Code)
Gets the name of the field.



getFieldType
T getFieldType(F f)(Code)
Gets the type of the field.



getMethodLocation
Location getMethodLocation(M getter)(Code)



getMethodName
String getMethodName(M m)(Code)
Gets the name of the method, such as "toString" or "equals".



getMethodParameters
T[] getMethodParameters(M method)(Code)
Returns the list of parameters to the method.



getPackageName
String getPackageName(C clazz)(Code)
Gets the package name of the given class. i.e. "", "java.lang" but not null.



getPrimitive
T getPrimitive(Class primitiveType)(Code)
Returns the representation for the given primitive type.
Parameters:
  primitiveType - must be Class objects like Integer.TYPE.



getReturnType
T getReturnType(M m)(Code)
Gets the return type of a method.



getSuperClass
C getSuperClass(C clazz)(Code)
Gets the base class of the specified class. null if the parameter represents Object.



getTypeArgument
T getTypeArgument(T t, int i)(Code)
Gets the i-th type argument from a parameterized type. For example, getTypeArgument([Map],0)=Integer
throws:
  IllegalArgumentException - If t is not a parameterized type
throws:
  IndexOutOfBoundsException - If i is out of range.
See Also:   Navigator.isParameterizedType(Object)



getTypeName
String getTypeName(T rawType)(Code)
Gets the display name of the type object a human-readable name that the type represents.



getVoidType
T getVoidType()(Code)
Gets the representation of the primitive "void" type.



hasDefaultConstructor
boolean hasDefaultConstructor(C clazz)(Code)
Returns true if the given class has a no-arg default constructor. The constructor does not need to be public.



isAbstract
boolean isAbstract(C clazz)(Code)
Returns true if this is an abstract class.



isArray
boolean isArray(T t)(Code)
Checks if the type is an array type.



isArrayButNotByteArray
boolean isArrayButNotByteArray(T t)(Code)
Checks if the type is an array type but not byte[].



isBridgeMethod
boolean isBridgeMethod(M method)(Code)
Returns true if this method is a bridge method as defined in JLS.



isEnum
boolean isEnum(C clazz)(Code)
Returns true if this is an enum class.



isFinal
boolean isFinal(C clazz)(Code)
Returns true if this is a final class.



isInnerClass
boolean isInnerClass(C clazz)(Code)
Returns true if the given class is an inner class. This is only used to improve the error diagnostics, so it's OK to fail to detect some inner classes as such. Note that this method should return false for nested classes (static classes.)



isInterface
boolean isInterface(C clazz)(Code)
Returns true if 'clazz' is an interface.



isOverriding
boolean isOverriding(M method, C base)(Code)
Returns true if the given method is overriding another one defined in the base class 'base' or its ancestors.



isParameterizedType
boolean isParameterizedType(T t)(Code)
Returns true if t is a parameterized type.



isPrimitive
boolean isPrimitive(T t)(Code)
Checks if the given type is a primitive type.



isPublicField
boolean isPublicField(F field)(Code)
Returns true if the field is public.



isPublicMethod
boolean isPublicMethod(M method)(Code)
Returns true if the method is public.



isStaticField
boolean isStaticField(F field)(Code)
Returns true if the field is static.



isStaticMethod
boolean isStaticMethod(M method)(Code)
Returns true if the method is static.



isSubClassOf
boolean isSubClassOf(T sub, T sup)(Code)
Checks if sub is a sub-type of sup . TODO: should this method take T or C?



isTransient
boolean isTransient(F f)(Code)
Returns true if the field is transient.



ref
T ref(Class c)(Code)
Gets the representation of the given Java type in T .
Parameters:
  c - can be a primitive, array, class, or anything.(therefore the return type has to be T, not C)



use
T use(C c)(Code)
Gets the T for the given C.



w___w_w_.__j___av___a___2s___.__com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.