Package net.bytebuddy.description.type
Enum TypeDescription.Generic.Visitor.Validator
- java.lang.Object
-
- java.lang.Enum<TypeDescription.Generic.Visitor.Validator>
-
- net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Validator
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TypeDescription.Generic.Visitor.Validator>
,TypeDescription.Generic.Visitor<java.lang.Boolean>
- Enclosing interface:
- TypeDescription.Generic.Visitor<T>
public static enum TypeDescription.Generic.Visitor.Validator extends java.lang.Enum<TypeDescription.Generic.Visitor.Validator> implements TypeDescription.Generic.Visitor<java.lang.Boolean>
A validator for Java types that are defined for a specified type use within a Java class file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations
A type validator for checking type annotations.-
Nested classes/interfaces inherited from interface net.bytebuddy.description.type.TypeDescription.Generic.Visitor
TypeDescription.Generic.Visitor.AnnotationStripper, TypeDescription.Generic.Visitor.Assigner, TypeDescription.Generic.Visitor.ForRawType, TypeDescription.Generic.Visitor.ForSignatureVisitor, TypeDescription.Generic.Visitor.NoOp, TypeDescription.Generic.Visitor.Reducing, TypeDescription.Generic.Visitor.Reifying, TypeDescription.Generic.Visitor.Substitutor, TypeDescription.Generic.Visitor.TypeErasing, TypeDescription.Generic.Visitor.Validator
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EXCEPTION
A validator for a method exception type.FIELD
A validator for a field type.INTERFACE
A validator for an interface type.METHOD_PARAMETER
A validator for a method parameter type.METHOD_RETURN
A validator for a method return type.RECEIVER
A validator for a method receiver type.SUPER_CLASS
A validator for checking a type's non-null super class.TYPE_VARIABLE
A validator for a type variable.
-
Field Summary
Fields Modifier and Type Field Description private boolean
acceptsArray
true
if this validator accepts array types.private boolean
acceptsPrimitive
true
if this validator accepts primitive types.private boolean
acceptsVariable
true
if this validator accepts type variables.private boolean
acceptsVoid
true
if this validator accepts thevoid
type.
-
Constructor Summary
Constructors Modifier Constructor Description private
Validator(boolean acceptsArray, boolean acceptsPrimitive, boolean acceptsVariable, boolean acceptsVoid)
Creates a new validator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
onGenericArray(TypeDescription.Generic genericArray)
Visits a generic array type (TypeDefinition.Sort.GENERIC_ARRAY
).java.lang.Boolean
onNonGenericType(TypeDescription.Generic typeDescription)
Visits a non-generic type (TypeDefinition.Sort.NON_GENERIC
).java.lang.Boolean
onParameterizedType(TypeDescription.Generic parameterizedType)
Visits a parameterized type (TypeDefinition.Sort.PARAMETERIZED
).java.lang.Boolean
onTypeVariable(TypeDescription.Generic typeVariable)
Visits a type variable (TypeDefinition.Sort.VARIABLE
,TypeDefinition.Sort.VARIABLE_SYMBOLIC
).java.lang.Boolean
onWildcard(TypeDescription.Generic wildcard)
Visits a wildcard (TypeDefinition.Sort.WILDCARD
).static TypeDescription.Generic.Visitor.Validator
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static TypeDescription.Generic.Visitor.Validator[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SUPER_CLASS
public static final TypeDescription.Generic.Visitor.Validator SUPER_CLASS
A validator for checking a type's non-null super class.
-
INTERFACE
public static final TypeDescription.Generic.Visitor.Validator INTERFACE
A validator for an interface type.
-
TYPE_VARIABLE
public static final TypeDescription.Generic.Visitor.Validator TYPE_VARIABLE
A validator for a type variable.
-
FIELD
public static final TypeDescription.Generic.Visitor.Validator FIELD
A validator for a field type.
-
METHOD_RETURN
public static final TypeDescription.Generic.Visitor.Validator METHOD_RETURN
A validator for a method return type.
-
METHOD_PARAMETER
public static final TypeDescription.Generic.Visitor.Validator METHOD_PARAMETER
A validator for a method parameter type.
-
EXCEPTION
public static final TypeDescription.Generic.Visitor.Validator EXCEPTION
A validator for a method exception type.
-
RECEIVER
public static final TypeDescription.Generic.Visitor.Validator RECEIVER
A validator for a method receiver type.
-
-
Field Detail
-
acceptsArray
private final boolean acceptsArray
true
if this validator accepts array types.
-
acceptsPrimitive
private final boolean acceptsPrimitive
true
if this validator accepts primitive types.
-
acceptsVariable
private final boolean acceptsVariable
true
if this validator accepts type variables.
-
acceptsVoid
private final boolean acceptsVoid
true
if this validator accepts thevoid
type.
-
-
Constructor Detail
-
Validator
private Validator(boolean acceptsArray, boolean acceptsPrimitive, boolean acceptsVariable, boolean acceptsVoid)
Creates a new validator.- Parameters:
acceptsArray
-true
if this validator accepts array types.acceptsPrimitive
-true
if this validator accepts primitive types.acceptsVariable
-true
if this validator accepts type variables.acceptsVoid
-true
if this validator accepts thevoid
type.
-
-
Method Detail
-
values
public static TypeDescription.Generic.Visitor.Validator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TypeDescription.Generic.Visitor.Validator c : TypeDescription.Generic.Visitor.Validator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TypeDescription.Generic.Visitor.Validator valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
onGenericArray
public java.lang.Boolean onGenericArray(TypeDescription.Generic genericArray)
Visits a generic array type (TypeDefinition.Sort.GENERIC_ARRAY
).- Specified by:
onGenericArray
in interfaceTypeDescription.Generic.Visitor<java.lang.Boolean>
- Parameters:
genericArray
- The generic array type.- Returns:
- The visitor's return value.
-
onWildcard
public java.lang.Boolean onWildcard(TypeDescription.Generic wildcard)
Visits a wildcard (TypeDefinition.Sort.WILDCARD
).- Specified by:
onWildcard
in interfaceTypeDescription.Generic.Visitor<java.lang.Boolean>
- Parameters:
wildcard
- The wildcard.- Returns:
- The visitor's return value.
-
onParameterizedType
public java.lang.Boolean onParameterizedType(TypeDescription.Generic parameterizedType)
Visits a parameterized type (TypeDefinition.Sort.PARAMETERIZED
).- Specified by:
onParameterizedType
in interfaceTypeDescription.Generic.Visitor<java.lang.Boolean>
- Parameters:
parameterizedType
- The generic array type.- Returns:
- The visitor's return value.
-
onTypeVariable
public java.lang.Boolean onTypeVariable(TypeDescription.Generic typeVariable)
Visits a type variable (TypeDefinition.Sort.VARIABLE
,TypeDefinition.Sort.VARIABLE_SYMBOLIC
).- Specified by:
onTypeVariable
in interfaceTypeDescription.Generic.Visitor<java.lang.Boolean>
- Parameters:
typeVariable
- The generic array type.- Returns:
- The visitor's return value.
-
onNonGenericType
public java.lang.Boolean onNonGenericType(TypeDescription.Generic typeDescription)
Visits a non-generic type (TypeDefinition.Sort.NON_GENERIC
).- Specified by:
onNonGenericType
in interfaceTypeDescription.Generic.Visitor<java.lang.Boolean>
- Parameters:
typeDescription
- The non-generic type.- Returns:
- The visitor's return value.
-
-