Home » openjdk-7 » javax.lang » model » type » [javadoc | source]
javax.lang.model.type
public interface: TypeMirror [javadoc | source]

All Known Implementing Classes:
    ExecutableType, NullType, WildcardType, UnionType, TypeVariable, NoType, PrimitiveType, ErrorType, DeclaredType, ArrayType, ReferenceType

Represents a type in the Java programming language. Types include primitive types, declared types (class and interface types), array types, type variables, and the null type. Also represented are wildcard type arguments, the signature and return types of executables, and pseudo-types corresponding to packages and to the keyword {@code void}.

Types should be compared using the utility methods in Types . There is no guarantee that any particular type will always be represented by the same object.

To implement operations based on the class of an {@code TypeMirror} object, either use a {@linkplain TypeVisitor visitor} or use the result of the #getKind method. Using {@code instanceof} is not necessarily a reliable idiom for determining the effective class of an object in this modeling hierarchy since an implementation may choose to have a single object implement multiple {@code TypeMirror} subinterfaces.

Method from javax.lang.model.type.TypeMirror Summary:
accept,   equals,   getKind,   hashCode,   toString
Method from javax.lang.model.type.TypeMirror Detail:
 public R accept(TypeVisitor<R, P> v,
    P p)
    Applies a visitor to this type.
 public boolean equals(Object obj)
    Obeys the general contract of Object.equals . This method does not, however, indicate whether two types represent the same type. Semantic comparisons of type equality should instead use Types#isSameType(TypeMirror, TypeMirror) . The results of {@code t1.equals(t2)} and {@code Types.isSameType(t1, t2)} may differ.
 public TypeKind getKind()
    Returns the {@code kind} of this type.
 public int hashCode()
 public String toString()
    Returns an informative string representation of this type. If possible, the string should be of a form suitable for representing this type in source code. Any names embedded in the result are qualified if possible.