Java Doc for TypeOracle.java in  » Ajax » GWT » com » google » gwt » core » ext » typeinfo » 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 » Ajax » GWT » com.google.gwt.core.ext.typeinfo 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.google.gwt.core.ext.typeinfo.TypeOracle

TypeOracle
public class TypeOracle (Code)
Provides type-related information about a set of source files, including doc comment metadata.

All type objects exposed, such as com.google.gwt.core.ext.typeinfo.JClassType and others, have a stable identity relative to this type oracle instance. Consequently, you can reliably compare object identity of any objects this type oracle produces. For example, the following code relies on this stable identity guarantee:

 JClassType o = typeOracle.getJavaLangObject();
 JClassType s1 = typeOracle.getType("java.lang.String");
 JClassType s2 = typeOracle.getType("java.lang.String");
 assert(s1 == s2);
 assert(o == s1.getSuperclass());
 JParameterizedType ls = typeOracle.parse("java.util.List<java.lang.String>");
 assert(ls.getTypeArgs()[0] == s1);
 



Field Summary
final static  intMOD_ABSTRACT
    
final static  intMOD_FINAL
    
final static  intMOD_NATIVE
    
final static  intMOD_PRIVATE
    
final static  intMOD_PROTECTED
    
final static  intMOD_PUBLIC
    
final static  intMOD_STATIC
    
final static  intMOD_TRANSIENT
    
final static  intMOD_VOLATILE
    
final static  Annotation[]NO_ANNOTATIONS
    
final static  JClassType[]NO_JCLASSES
    
final static  JConstructor[]NO_JCTORS
    
final static  JField[]NO_JFIELDS
    
final static  JMethod[]NO_JMETHODS
    
final static  JPackage[]NO_JPACKAGES
    
final static  JParameter[]NO_JPARAMS
    
final static  JType[]NO_JTYPES
    
final static  String[]NO_STRINGS
    
final static  String[][]NO_STRING_ARR_ARR
    
final public static  StringTAG_TYPEARGS
     A reserved metadata tag to indicates that a field type, method return type or method parameter type is intended to be parameterized.

Constructor Summary
public  TypeOracle()
    

Method Summary
static  Stringcombine(String[] strings, int startIndex)
    
public  JPackagefindPackage(String pkgName)
     Attempts to find a package by name.
public  JClassTypefindType(String name)
     Finds a class or interface given its fully-qualified name.
public  JClassTypefindType(String pkgName, String typeName)
     Finds a type given its package-relative name.
public  JArrayTypegetArrayType(JType componentType)
     Gets the type object that represents an array of the specified type.
public  JClassTypegetJavaLangObject()
     Gets a reference to the type object representing java.lang.Object.
public  JPackagegetOrCreatePackage(String name)
     Ensure that a package with the specified name exists as well as its parent packages.
public  JPackagegetPackage(String pkgName)
     Gets a package by name.
public  JPackage[]getPackages()
     Gets an array of all packages known to this type oracle.
public  JParameterizedTypegetParameterizedType(JGenericType genericType, JClassType enclosingType, JClassType[] typeArgs)
     Gets the parameterized type object that represents the combination of a specified raw type and a set of type arguments.
public  JParameterizedTypegetParameterizedType(JGenericType genericType, JClassType[] typeArgs)
     Gets the parameterized type object that represents the combination of a specified raw type and a set of type arguments.
public  longgetReloadCount()
    
public  JClassTypegetType(String name)
     Finds a type given its fully qualified name.
public  JClassTypegetType(String pkgName, String topLevelTypeSimpleName)
     Finds a type given its package-relative name.
public  JClassType[]getTypes()
     Gets all types, both top-level and nested.
public  JClassType[]getTypesInCompilationUnit(CompilationUnitProvider cup)
    
public  JWildcardTypegetWildcardType(JBound bounds)
    
 voidincrementReloadCount()
    
 voidinvalidateTypesInCompilationUnit(CompilationUnitProvider cup)
     Note, this method is called reflectively from the CacheManager.invalidateOnRefresh(TypeOracle) .
static  String[]modifierBitsToNames(int bits)
    
public  JTypeparse(String type)
     Parses the string form of a type to produce the corresponding type object.
 voidrecordTypeInCompilationUnit(CompilationUnitProvider cup, JClassType type)
    
 voidrefresh(TreeLogger logger)
     Updates relationships within this type oracle.
public  voidsort(JClassType[] types)
     Convenience method to sort class types in a consistent way.
public  voidsort(JConstructor[] ctors)
     Convenience method to sort constructors in a consistent way.
public  voidsort(JField[] fields)
     Convenience method to sort fields in a consistent way.
public  voidsort(JMethod[] methods)
     Convenience method to sort methods in a consistent way.

Field Detail
MOD_ABSTRACT
final static int MOD_ABSTRACT(Code)



MOD_FINAL
final static int MOD_FINAL(Code)



MOD_NATIVE
final static int MOD_NATIVE(Code)



MOD_PRIVATE
final static int MOD_PRIVATE(Code)



MOD_PROTECTED
final static int MOD_PROTECTED(Code)



MOD_PUBLIC
final static int MOD_PUBLIC(Code)



MOD_STATIC
final static int MOD_STATIC(Code)



MOD_TRANSIENT
final static int MOD_TRANSIENT(Code)



MOD_VOLATILE
final static int MOD_VOLATILE(Code)



NO_ANNOTATIONS
final static Annotation[] NO_ANNOTATIONS(Code)



NO_JCLASSES
final static JClassType[] NO_JCLASSES(Code)



NO_JCTORS
final static JConstructor[] NO_JCTORS(Code)



NO_JFIELDS
final static JField[] NO_JFIELDS(Code)



NO_JMETHODS
final static JMethod[] NO_JMETHODS(Code)



NO_JPACKAGES
final static JPackage[] NO_JPACKAGES(Code)



NO_JPARAMS
final static JParameter[] NO_JPARAMS(Code)



NO_JTYPES
final static JType[] NO_JTYPES(Code)



NO_STRINGS
final static String[] NO_STRINGS(Code)



NO_STRING_ARR_ARR
final static String[][] NO_STRING_ARR_ARR(Code)



TAG_TYPEARGS
final public static String TAG_TYPEARGS(Code)
A reserved metadata tag to indicates that a field type, method return type or method parameter type is intended to be parameterized. Note that constructor type parameters are not supported at present.




Constructor Detail
TypeOracle
public TypeOracle()(Code)




Method Detail
combine
static String combine(String[] strings, int startIndex)(Code)



findPackage
public JPackage findPackage(String pkgName)(Code)
Attempts to find a package by name. All requests for the same package return the same package object. null if the package could not be found



findType
public JClassType findType(String name)(Code)
Finds a class or interface given its fully-qualified name. For nested classes, use its source name rather than its binary name (that is, use a "." rather than a "$"). null if the type is not found



findType
public JClassType findType(String pkgName, String typeName)(Code)
Finds a type given its package-relative name. For nested classes, use its source name rather than its binary name (that is, use a "." rather than a "$"). null if the type is not found



getArrayType
public JArrayType getArrayType(JType componentType)(Code)
Gets the type object that represents an array of the specified type. The returned type always has a stable identity so as to guarantee that all calls to this method with the same argument return the same object.
Parameters:
  componentType - the component type of the array, which can itself bean array type a type object representing an array of the component type



getJavaLangObject
public JClassType getJavaLangObject()(Code)
Gets a reference to the type object representing java.lang.Object.



getOrCreatePackage
public JPackage getOrCreatePackage(String name)(Code)
Ensure that a package with the specified name exists as well as its parent packages.



getPackage
public JPackage getPackage(String pkgName) throws NotFoundException(Code)
Gets a package by name. All requests for the same package return the same package object. the package object associated with the specified name



getPackages
public JPackage[] getPackages()(Code)
Gets an array of all packages known to this type oracle. an array of packages, possibly of zero-length



getParameterizedType
public JParameterizedType getParameterizedType(JGenericType genericType, JClassType enclosingType, JClassType[] typeArgs)(Code)
Gets the parameterized type object that represents the combination of a specified raw type and a set of type arguments. The returned type always has a stable identity so as to guarantee that all calls to this method with the same arguments return the same object.
Parameters:
  genericType - a generic base class
Parameters:
  enclosingType -
Parameters:
  typeArgs - the type arguments bound to the specified generic type a type object representing this particular binding of typearguments to the specified generic
throws:
  IllegalArgumentException - if the parameterization of a non-staticmember type does not specify an enclosing type or if not enougharguments were specified to parameterize the generic type
throws:
  NullPointerException - if genericType is null



getParameterizedType
public JParameterizedType getParameterizedType(JGenericType genericType, JClassType[] typeArgs)(Code)
Gets the parameterized type object that represents the combination of a specified raw type and a set of type arguments. The returned type always has a stable identity so as to guarantee that all calls to this method with the same arguments return the same object.
Parameters:
  genericType - a generic base class
Parameters:
  typeArgs - the type arguments bound to the specified generic type a type object representing this particular binding of typearguments to the specified generic
throws:
  IllegalArgumentException - if the generic type is a non-static membertype or if not enough arguments were specified to parameterizethe generic type
throws:
  NullPointerException - if genericType is null



getReloadCount
public long getReloadCount()(Code)



getType
public JClassType getType(String name) throws NotFoundException(Code)
Finds a type given its fully qualified name. For nested classes, use its source name rather than its binary name (that is, use a "." rather than a "$"). the specified type



getType
public JClassType getType(String pkgName, String topLevelTypeSimpleName) throws NotFoundException(Code)
Finds a type given its package-relative name. For nested classes, use its source name rather than its binary name (that is, use a "." rather than a "$"). the specified type



getTypes
public JClassType[] getTypes()(Code)
Gets all types, both top-level and nested. an array of types, possibly of zero length



getTypesInCompilationUnit
public JClassType[] getTypesInCompilationUnit(CompilationUnitProvider cup)(Code)



getWildcardType
public JWildcardType getWildcardType(JBound bounds)(Code)



incrementReloadCount
void incrementReloadCount()(Code)



invalidateTypesInCompilationUnit
void invalidateTypesInCompilationUnit(CompilationUnitProvider cup)(Code)
Note, this method is called reflectively from the CacheManager.invalidateOnRefresh(TypeOracle) .
Parameters:
  cup - compilation unit whose types will be invalidated



modifierBitsToNames
static String[] modifierBitsToNames(int bits)(Code)



parse
public JType parse(String type) throws TypeOracleException(Code)
Parses the string form of a type to produce the corresponding type object. The types that can be parsed include primitives, class and interface names, simple parameterized types (those without wildcards or bounds), and arrays of the preceding.

Examples of types that can be parsed by this method.

  • int
  • java.lang.Object
  • java.lang.String[]
  • char[][]
  • void
  • List<Shape>
  • List<List<Shape>>


Parameters:
  type - a type signature to be parsed the type object corresponding to the parse type



recordTypeInCompilationUnit
void recordTypeInCompilationUnit(CompilationUnitProvider cup, JClassType type)(Code)



refresh
void refresh(TreeLogger logger) throws NotFoundException(Code)
Updates relationships within this type oracle. Should be called after any changes are made.

Throws TypeOracleException thrown if fundamental baseline correctness criteria are violated, most notably the absence of "java.lang.Object"




sort
public void sort(JClassType[] types)(Code)
Convenience method to sort class types in a consistent way. Note that the order is subject to change and is intended to generate an "aesthetically pleasing" order rather than a computationally reliable order.



sort
public void sort(JConstructor[] ctors)(Code)
Convenience method to sort constructors in a consistent way. Note that the order is subject to change and is intended to generate an "aesthetically pleasing" order rather than a computationally reliable order.



sort
public void sort(JField[] fields)(Code)
Convenience method to sort fields in a consistent way. Note that the order is subject to change and is intended to generate an "aesthetically pleasing" order rather than a computationally reliable order.



sort
public void sort(JMethod[] methods)(Code)
Convenience method to sort methods in a consistent way. Note that the order is subject to change and is intended to generate an "aesthetically pleasing" order rather than a computationally reliable order.



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.