Java Doc for Types.java in  » 6.0-JDK-Modules-sun » javac-compiler » javax » lang » model » util » 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 sun » javac compiler » javax.lang.model.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.lang.model.util.Types

All known Subclasses:   com.sun.tools.javac.model.JavacTypes,
Types
public interface Types (Code)
Utility methods for operating on types.

Compatibility Note: Methods may be added to this interface in future releases of the platform.
author:
   Joseph D. Darcy
author:
   Scott Seligman
author:
   Peter von der Ahé
version:
   1.13 07/05/05
See Also:   javax.annotation.processing.ProcessingEnvironment.getTypeUtils
since:
   1.6





Method Summary
 ElementasElement(TypeMirror t)
     Returns the element corresponding to a type.
 TypeMirrorasMemberOf(DeclaredType containing, Element element)
     Returns the type of an element when that element is viewed as a member of, or otherwise directly contained by, a given type.
 TypeElementboxedClass(PrimitiveType p)
     Returns the class of a boxed value of a given primitive type.
 TypeMirrorcapture(TypeMirror t)
     Applies capture conversion to a type.
 booleancontains(TypeMirror t1, TypeMirror t2)
     Tests whether one type argument contains another.
 List<? extends TypeMirror>directSupertypes(TypeMirror t)
     Returns the direct supertypes of a type.
 TypeMirrorerasure(TypeMirror t)
     Returns the erasure of a type.
 ArrayTypegetArrayType(TypeMirror componentType)
     Returns an array type with the specified component type.
 DeclaredTypegetDeclaredType(TypeElement typeElem, TypeMirror... typeArgs)
     Returns the type corresponding to a type element and actual type arguments. Given the type element for Set and the type mirror for String , for example, this method may be used to get the parameterized type Set .

The number of type arguments must either equal the number of the type element's formal type parameters, or must be zero.

 DeclaredTypegetDeclaredType(DeclaredType containing, TypeElement typeElem, TypeMirror... typeArgs)
     Returns the type corresponding to a type element and actual type arguments, given a of which it is a member.
 NoTypegetNoType(TypeKind kind)
     Returns a pseudo-type used where no actual type is appropriate.
 NullTypegetNullType()
     Returns the null type.
 PrimitiveTypegetPrimitiveType(TypeKind kind)
     Returns a primitive type.
 WildcardTypegetWildcardType(TypeMirror extendsBound, TypeMirror superBound)
     Returns a new wildcard type argument.
 booleanisAssignable(TypeMirror t1, TypeMirror t2)
     Tests whether one type is assignable to another.
 booleanisSameType(TypeMirror t1, TypeMirror t2)
     Tests whether two TypeMirror objects represent the same type.

Caveat: if either of the arguments to this method represents a wildcard, this method will return false.

 booleanisSubsignature(ExecutableType m1, ExecutableType m2)
     Tests whether the signature of one method is a subsignature of another.
 booleanisSubtype(TypeMirror t1, TypeMirror t2)
     Tests whether one type is a subtype of another.
 PrimitiveTypeunboxedType(TypeMirror t)
     Returns the type (a primitive type) of unboxed values of a given type.



Method Detail
asElement
Element asElement(TypeMirror t)(Code)
Returns the element corresponding to a type. The type may be a DeclaredType or TypeVariable . Returns null if the type is not one with a corresponding element. the element corresponding to the given type



asMemberOf
TypeMirror asMemberOf(DeclaredType containing, Element element)(Code)
Returns the type of an element when that element is viewed as a member of, or otherwise directly contained by, a given type. For example, when viewed as a member of the parameterized type Set , the Set.add method is an ExecutableType whose parameter is of type String .
Parameters:
  containing - the containing type
Parameters:
  element - the element the type of the element as viewed from the containing type
throws:
  IllegalArgumentException - if the element is not a valid onefor the given type



boxedClass
TypeElement boxedClass(PrimitiveType p)(Code)
Returns the class of a boxed value of a given primitive type. That is, boxing conversion is applied.
Parameters:
  p - the primitive type to be converted the class of a boxed value of type p



capture
TypeMirror capture(TypeMirror t)(Code)
Applies capture conversion to a type.
Parameters:
  t - the type to be converted the result of applying capture conversion
throws:
  IllegalArgumentException - if given an executable or package type



contains
boolean contains(TypeMirror t1, TypeMirror t2)(Code)
Tests whether one type argument contains another.
Parameters:
  t1 - the first type
Parameters:
  t2 - the second type true if and only if the first type contains the second
throws:
  IllegalArgumentException - if given an executable or package type



directSupertypes
List<? extends TypeMirror> directSupertypes(TypeMirror t)(Code)
Returns the direct supertypes of a type. The interface types, if any, will appear last in the list.
Parameters:
  t - the type being examined the direct supertypes, or an empty list if none
throws:
  IllegalArgumentException - if given an executable or package type



erasure
TypeMirror erasure(TypeMirror t)(Code)
Returns the erasure of a type.
Parameters:
  t - the type to be erased the erasure of the given type
throws:
  IllegalArgumentException - if given a package type



getArrayType
ArrayType getArrayType(TypeMirror componentType)(Code)
Returns an array type with the specified component type.
Parameters:
  componentType - the component type an array type with the specified component type.
throws:
  IllegalArgumentException - if the component type is not valid foran array



getDeclaredType
DeclaredType getDeclaredType(TypeElement typeElem, TypeMirror... typeArgs)(Code)
Returns the type corresponding to a type element and actual type arguments. Given the type element for Set and the type mirror for String , for example, this method may be used to get the parameterized type Set .

The number of type arguments must either equal the number of the type element's formal type parameters, or must be zero. If zero, and if the type element is generic, then the type element's raw type is returned.

If a parameterized type is being returned, its type element must not be contained within a generic outer class. The parameterized type Outer.Inner , for example, may be constructed by first using this method to get the type Outer , and then invoking Types.getDeclaredType(DeclaredType,TypeElement,TypeMirror) .
Parameters:
  typeElem - the type element
Parameters:
  typeArgs - the actual type arguments the type corresponding to the type element andactual type arguments
throws:
  IllegalArgumentException - if too many or too fewtype arguments are given, or if an inappropriate typeargument or type element is provided




getDeclaredType
DeclaredType getDeclaredType(DeclaredType containing, TypeElement typeElem, TypeMirror... typeArgs)(Code)
Returns the type corresponding to a type element and actual type arguments, given a of which it is a member. The parameterized type Outer.Inner , for example, may be constructed by first using Types.getDeclaredType(TypeElement,TypeMirror) to get the type Outer , and then invoking this method.

If the containing type is a parameterized type, the number of type arguments must equal the number of typeElem 's formal type parameters. If it is not parameterized or if it is null , this method is equivalent to getDeclaredType(typeElem, typeArgs) .
Parameters:
  containing - the containing type, or null if none
Parameters:
  typeElem - the type element
Parameters:
  typeArgs - the actual type arguments the type corresponding to the type element andactual type arguments, contained within the given type
throws:
  IllegalArgumentException - if too many or too fewtype arguments are given, or if an inappropriate typeargument, type element, or containing type is provided




getNoType
NoType getNoType(TypeKind kind)(Code)
Returns a pseudo-type used where no actual type is appropriate. The kind of type to return may be either TypeKind.VOID VOID or TypeKind.NONE NONE . For packages, use Elements.getPackageElement(CharSequence) .asType() instead.
Parameters:
  kind - the kind of type to return a pseudo-type of kind VOID or NONE
throws:
  IllegalArgumentException - if kind is not valid



getNullType
NullType getNullType()(Code)
Returns the null type. This is the type of null . the null type



getPrimitiveType
PrimitiveType getPrimitiveType(TypeKind kind)(Code)
Returns a primitive type.
Parameters:
  kind - the kind of primitive type to return a primitive type
throws:
  IllegalArgumentException - if kind is not a primitive kind



getWildcardType
WildcardType getWildcardType(TypeMirror extendsBound, TypeMirror superBound)(Code)
Returns a new wildcard type argument. Either of the wildcard's bounds may be specified, or neither, but not both.
Parameters:
  extendsBound - the extends (upper) bound, or null if none
Parameters:
  superBound - the super (lower) bound, or null if none a new wildcard
throws:
  IllegalArgumentException - if bounds are not valid



isAssignable
boolean isAssignable(TypeMirror t1, TypeMirror t2)(Code)
Tests whether one type is assignable to another.
Parameters:
  t1 - the first type
Parameters:
  t2 - the second type true if and only if the first type is assignableto the second
throws:
  IllegalArgumentException - if given an executable or package type



isSameType
boolean isSameType(TypeMirror t1, TypeMirror t2)(Code)
Tests whether two TypeMirror objects represent the same type.

Caveat: if either of the arguments to this method represents a wildcard, this method will return false. As a consequence, a wildcard is not the same type as itself. This might be surprising at first, but makes sense once you consider that an example like this must be rejected by the compiler:

 
  List list = new ArrayList();   list.add(list.get(0));  

Parameters:
  t1 - the first type
Parameters:
  t2 - the second type true if and only if the two types are the same



isSubsignature
boolean isSubsignature(ExecutableType m1, ExecutableType m2)(Code)
Tests whether the signature of one method is a subsignature of another.
Parameters:
  m1 - the first method
Parameters:
  m2 - the second method true if and only if the first signature is asubsignature of the second



isSubtype
boolean isSubtype(TypeMirror t1, TypeMirror t2)(Code)
Tests whether one type is a subtype of another. Any type is considered to be a subtype of itself.
Parameters:
  t1 - the first type
Parameters:
  t2 - the second type true if and only if the first type is a subtypeof the second
throws:
  IllegalArgumentException - if given an executable or package type



unboxedType
PrimitiveType unboxedType(TypeMirror t)(Code)
Returns the type (a primitive type) of unboxed values of a given type. That is, unboxing conversion is applied.
Parameters:
  t - the type to be unboxed the type of an unboxed value of type t
throws:
  IllegalArgumentException - if the given type has nounboxing conversion



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