Skip navigation links
oracle.javatools.parser.java.v2.model
Interface JavaIsGeneric
- All Superinterfaces:
- Element, JavaElement, JavaHasAnnotations, JavaHasName, JavaHasType, JavaMember
- All Known Subinterfaces:
- JavaClass, JavaMethod, JavaType, JavaTypeVariable, JavaWildcardType, SourceClass, SourceMethod, SourceTypeParameter
- All Known Implementing Classes:
- AbstractClass, AbstractMethod, AbstractType, BaseFileProvider.BaseClass, CastedMethod, oracle.javatools.parser.java.v2.classfile.ClClass, PrimitiveType, QuickComponent, QuickMethod, WrapperClass, WrapperMethod
-
public interface JavaIsGeneric
- extends JavaMember
A generic declaration declares type parameters. Both types and methods (constructors too) may declare type parameters. A bound declaration may be created from a generic declaration.
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaHasName |
getName |
Methods inherited from interface oracle.javatools.parser.java.v2.model.JavaElement |
getElementKind, getFile, getModifiers, getOwner, getSourceElement, isDeprecated, isFinal, isHidden, isSourceElement, isSynthetic, printCompiledInfo |
hasTypeParameters
boolean hasTypeParameters()
-
- Returns:
- True if this member has type parameters.
getTypeParameters
java.util.Collection getTypeParameters()
-
- Returns:
- The array of type parameters for this generic type. Zero-length if this type is not of generic type. Returns a Collection of JavaTypeVariable's.
getTypeParameter
JavaTypeVariable getTypeParameter(java.lang.String name)
-
- Returns:
- The matching type parameter. Null means no match.
hasActualTypeArguments
boolean hasActualTypeArguments()
- Determine if this type or member has explicit or implicit (in the case of the diamond syntax) type arguments, e.g. will return true for 'Type' in 'new Type<Integer>()' and in 'new Type<>()' and false for 'Type' in 'new Type()'
-
- Returns:
- True if this member has explicit or implicit type arguments.
getActualTypeArguments
java.util.Collection getActualTypeArguments()
- Get the type arguments, if any
-
- Returns:
- The array of actual type arguments this type or member is bound to. Zero-length if this type is not generic or is not bound or is a type with implied type arguments, such as from the diamond syntax for new class expressions. Returns a Collection of JavaType's.
Skip navigation links
Copyright © 1997, 2013, Oracle. All rights reserved.