Package net.bytebuddy.description.type
Enum TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations
- java.lang.Object
-
- java.lang.Enum<TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations>
-
- net.bytebuddy.description.type.TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations>,TypeDescription.Generic.Visitor<java.lang.Boolean>
- Enclosing class:
- TypeDescription.Generic.Visitor.Validator
public static enum TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations extends java.lang.Enum<TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations> implements TypeDescription.Generic.Visitor<java.lang.Boolean>
A type validator for checking type annotations.
-
-
Nested Class Summary
-
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.Generalizing, 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 INSTANCEThe singleton instance.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringTYPE_PARAMETERThe name of theElementType#TYPE_PARAMETERelement.private static java.lang.StringTYPE_USEThe name of theElementType#TYPE_USEelement.
-
Constructor Summary
Constructors Modifier Constructor Description privateForTypeAnnotations()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanisValid(TypeDescription.Generic typeDescription)Checks if the supplied type's type annotations are valid.static booleanofFormalTypeVariable(TypeDescription.Generic typeVariable)Validates the type annotations on a formal type variable but not on its bounds..java.lang.BooleanonGenericArray(TypeDescription.Generic genericArray)Visits a generic array type (TypeDefinition.Sort.GENERIC_ARRAY).java.lang.BooleanonNonGenericType(TypeDescription.Generic typeDescription)Visits a non-generic type (TypeDefinition.Sort.NON_GENERIC).java.lang.BooleanonParameterizedType(TypeDescription.Generic parameterizedType)Visits a parameterized type (TypeDefinition.Sort.PARAMETERIZED).java.lang.BooleanonTypeVariable(TypeDescription.Generic typeVariable)Visits a type variable (TypeDefinition.Sort.VARIABLE,TypeDefinition.Sort.VARIABLE_SYMBOLIC).java.lang.BooleanonWildcard(TypeDescription.Generic wildcard)Visits a wildcard (TypeDefinition.Sort.WILDCARD).static TypeDescription.Generic.Visitor.Validator.ForTypeAnnotationsvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations INSTANCE
The singleton instance.
-
-
Field Detail
-
TYPE_USE
private static final java.lang.String TYPE_USE
The name of theElementType#TYPE_USEelement.- See Also:
- Constant Field Values
-
TYPE_PARAMETER
private static final java.lang.String TYPE_PARAMETER
The name of theElementType#TYPE_PARAMETERelement.- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations[] 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.ForTypeAnnotations c : TypeDescription.Generic.Visitor.Validator.ForTypeAnnotations.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.ForTypeAnnotations 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
-
ofFormalTypeVariable
public static boolean ofFormalTypeVariable(TypeDescription.Generic typeVariable)
Validates the type annotations on a formal type variable but not on its bounds..- Parameters:
typeVariable- The type variable to validate.- Returns:
trueif the formal type variable declares invalid type annotations.
-
onGenericArray
public java.lang.Boolean onGenericArray(TypeDescription.Generic genericArray)
Visits a generic array type (TypeDefinition.Sort.GENERIC_ARRAY).- Specified by:
onGenericArrayin 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:
onWildcardin 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:
onParameterizedTypein 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:
onTypeVariablein 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:
onNonGenericTypein interfaceTypeDescription.Generic.Visitor<java.lang.Boolean>- Parameters:
typeDescription- The non-generic type.- Returns:
- The visitor's return value.
-
isValid
private boolean isValid(TypeDescription.Generic typeDescription)
Checks if the supplied type's type annotations are valid.- Parameters:
typeDescription- The type to validate.- Returns:
trueif the supplied type's type annotations are valid.
-
-