Class TypeKindVisitor6<R,P>
- Type Parameters:
-
R
- the return type of this visitor's methods. UseVoid
for visitors that do not need to return results. -
P
- the type of the additional parameter to this visitor's methods. UseVoid
for visitors that do not need an additional parameter.
- All Implemented Interfaces:
TypeVisitor<R,
P>
- Direct Known Subclasses:
TypeKindVisitor7
@SupportedSourceVersion(RELEASE_6) public class TypeKindVisitor6<R,P> extends SimpleTypeVisitor6<R,P>
RELEASE_6
source version. For types Xyz
that may have more than one kind, the visitXyz
methods in this class delegate to the visitXyzAsKind
method corresponding to the first argument's kind. The visitXyzAsKind
methods call defaultAction
, passing their arguments to defaultAction
's corresponding parameters.- API Note:
- Methods in this class may be overridden subject to their general contract.
WARNING: The
TypeVisitor
interface implemented by this class may have methods added to it or theTypeKind enum
used in this class may have constants added to it in the future to accommodate new, currently unknown, language structures added to future versions of the Java programming language. Therefore, methods whose names begin with"visit"
may be added to this class in the future; to avoid incompatibilities, classes and subclasses which extend this class should not declare any instance methods with names beginning with"visit"
.When such a new visit method is added, the default implementation in this class will be to directly or indirectly call the
visitUnknown
method. A new type kind visitor class will also be introduced to correspond to the new language level; this visitor will have different default behavior for the visit method in question. When a new visitor is introduced, portions of this visitor class may be deprecated, including its constructors. - Since:
- 1.6
- See Also:
Field Summary
Fields declared in class javax.lang.model.util.SimpleTypeVisitor6
DEFAULT_VALUE
Constructor Summary
Modifier | Constructor | Description |
---|---|---|
protected |
Deprecated. Release 6 is obsolete; update to a visitor for a newer release level. |
|
protected |
Deprecated. Release 6 is obsolete; update to a visitor for a newer release level. |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
R |
visitNoType |
Visits a NoType instance. |
R |
visitNoTypeAsModule |
Visits a MODULE pseudo-type. |
R |
visitNoTypeAsNone |
Visits a NONE pseudo-type. |
R |
visitNoTypeAsPackage |
Visits a PACKAGE pseudo-type. |
R |
visitNoTypeAsVoid |
Visits a VOID pseudo-type. |
R |
visitPrimitive |
Visits a primitive type. |
R |
visitPrimitiveAsBoolean |
Visits a BOOLEAN primitive type. |
R |
visitPrimitiveAsByte |
Visits a BYTE primitive type. |
R |
visitPrimitiveAsChar |
Visits a CHAR primitive type. |
R |
visitPrimitiveAsDouble |
Visits a DOUBLE primitive type. |
R |
visitPrimitiveAsFloat |
Visits a FLOAT primitive type. |
R |
visitPrimitiveAsInt |
Visits an INT primitive type. |
R |
visitPrimitiveAsLong |
Visits a LONG primitive type. |
R |
visitPrimitiveAsShort |
Visits a SHORT primitive type. |
Methods declared in class javax.lang.model.util.SimpleTypeVisitor6
defaultAction, visitArray, visitDeclared, visitError, visitExecutable, visitNull, visitTypeVariable, visitWildcard
Methods declared in class javax.lang.model.util.AbstractTypeVisitor6
visit, visit, visitIntersection, visitUnion, visitUnknown
Constructor Details
TypeKindVisitor6
@Deprecated(since="9") protected TypeKindVisitor6()
null
for the default value.TypeKindVisitor6
@Deprecated(since="9") protected TypeKindVisitor6(R defaultValue)
- Parameters:
-
defaultValue
- the value to assign toSimpleTypeVisitor6.DEFAULT_VALUE
Method Details
visitPrimitive
public R visitPrimitive(PrimitiveType t, P p)
- Specified by:
-
visitPrimitive
in interfaceTypeVisitor<R,
P> - Overrides:
-
visitPrimitive
in classSimpleTypeVisitor6<R,
P> - Implementation Requirements:
- This implementation dispatches to the visit method for the specific kind of primitive type:
BOOLEAN
,BYTE
, etc. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of the kind-specific visit method
visitPrimitiveAsBoolean
public R visitPrimitiveAsBoolean(PrimitiveType t, P p)
BOOLEAN
primitive type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitPrimitiveAsByte
public R visitPrimitiveAsByte(PrimitiveType t, P p)
BYTE
primitive type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitPrimitiveAsShort
public R visitPrimitiveAsShort(PrimitiveType t, P p)
SHORT
primitive type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitPrimitiveAsInt
public R visitPrimitiveAsInt(PrimitiveType t, P p)
INT
primitive type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitPrimitiveAsLong
public R visitPrimitiveAsLong(PrimitiveType t, P p)
LONG
primitive type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitPrimitiveAsChar
public R visitPrimitiveAsChar(PrimitiveType t, P p)
CHAR
primitive type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitPrimitiveAsFloat
public R visitPrimitiveAsFloat(PrimitiveType t, P p)
FLOAT
primitive type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitPrimitiveAsDouble
public R visitPrimitiveAsDouble(PrimitiveType t, P p)
DOUBLE
primitive type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitNoType
public R visitNoType(NoType t, P p)
NoType
instance.- Specified by:
-
visitNoType
in interfaceTypeVisitor<R,
P> - Overrides:
-
visitNoType
in classSimpleTypeVisitor6<R,
P> - Implementation Requirements:
- This implementation dispatches to the visit method for the specific kind of pseudo-type:
VOID
,PACKAGE
,MODULE
, orNONE
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of the kind-specific visit method
visitNoTypeAsVoid
public R visitNoTypeAsVoid(NoType t, P p)
VOID
pseudo-type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitNoTypeAsPackage
public R visitNoTypeAsPackage(NoType t, P p)
PACKAGE
pseudo-type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
visitNoTypeAsModule
public R visitNoTypeAsModule(NoType t, P p)
MODULE
pseudo-type.- Implementation Requirements:
- This implementation calls
visitUnknown
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
visitUnknown
- Since:
- 10
visitNoTypeAsNone
public R visitNoTypeAsNone(NoType t, P p)
NONE
pseudo-type.- Implementation Requirements:
- This implementation calls
defaultAction
. - Parameters:
-
t
- the type to visit -
p
- a visitor-specified parameter - Returns:
- the result of
defaultAction
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.compiler/javax/lang/model/util/TypeKindVisitor6.html