Package net.bytebuddy.dynamic.scaffold
Enum TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface
- java.lang.Object
-
- java.lang.Enum<TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface>
-
- net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface>,TypeWriter.Default.ValidatingClassVisitor.Constraint
- Enclosing interface:
- TypeWriter.Default.ValidatingClassVisitor.Constraint
public static enum TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface extends java.lang.Enum<TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface> implements TypeWriter.Default.ValidatingClassVisitor.Constraint
Represents the constraint of an interface type.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ValidatingClassVisitor.Constraint
TypeWriter.Default.ValidatingClassVisitor.Constraint.Compound, TypeWriter.Default.ValidatingClassVisitor.Constraint.ForAnnotation, TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClass, TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClassFileVersion, TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface, TypeWriter.Default.ValidatingClassVisitor.Constraint.ForModuleType, TypeWriter.Default.ValidatingClassVisitor.Constraint.ForPackageType, TypeWriter.Default.ValidatingClassVisitor.Constraint.ForRecord
-
-
Field Summary
Fields Modifier and Type Field Description private booleanclassictrueif this instance represents a classic interface type (pre Java 8).
-
Constructor Summary
Constructors Modifier Constructor Description privateForInterface(boolean classic)Creates a constraint for an interface type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertAnnotation()Asserts the legitimacy of an annotation for the instrumented type.voidassertDefaultMethodCall()Asserts if it is legal to invoke a default method from a type.voidassertDefaultValue(java.lang.String name)Asserts if a default value is legal for a method.voidassertDynamicValueInConstantPool()Asserts the capability of storing a dynamic value in the constant pool.voidassertField(java.lang.String name, boolean isPublic, boolean isStatic, boolean isFinal, boolean isGeneric)Asserts a field for being valid.voidassertHandleInConstantPool()Asserts the capability to store a method handle in the class's constant pool.voidassertInvokeDynamic()Asserts the capability to invoke a method dynamically.voidassertMethod(java.lang.String name, boolean isAbstract, boolean isPublic, boolean isPrivate, boolean isStatic, boolean isVirtual, boolean isConstructor, boolean isDefaultValueIncompatible, boolean isGeneric)Asserts a method for being valid.voidassertMethodTypeInConstantPool()Asserts the capability to store a method type constant in the class's constant pool.voidassertNestMate()Asserts the capability of storing nest mate information.voidassertPermittedSubclass()Asserts the presence of a permitted subclass.voidassertRecord()Asserts the presence of a record component.voidassertSubRoutine()Asserts the capability of executing a subroutine.voidassertType(int modifier, java.lang.String superClassInternalName, boolean definesInterfaces, boolean isGeneric)Asserts if the type can legally represent a package description.voidassertTypeAnnotation()Asserts the legitimacy of a type annotation for the instrumented type.voidassertTypeInConstantPool()Asserts the capability to store a type constant in the class's constant pool.static TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterfacevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CLASSIC
public static final TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface CLASSIC
An interface type with the constraints for the Java versions 5 to 7.
-
JAVA_8
public static final TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface JAVA_8
An interface type with the constraints for the Java versions 8+.
-
-
Method Detail
-
values
public static TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface[] 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 (TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface c : TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TypeWriter.Default.ValidatingClassVisitor.Constraint.ForInterface 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
-
assertField
public void assertField(java.lang.String name, boolean isPublic, boolean isStatic, boolean isFinal, boolean isGeneric)Asserts a field for being valid.- Specified by:
assertFieldin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint- Parameters:
name- The name of the field.isPublic-trueif this field is public.isStatic-trueif this field is static.isFinal-trueif this field is final.isGeneric-trueif this field defines a generic signature.
-
assertMethod
public void assertMethod(java.lang.String name, boolean isAbstract, boolean isPublic, boolean isPrivate, boolean isStatic, boolean isVirtual, boolean isConstructor, boolean isDefaultValueIncompatible, boolean isGeneric)Asserts a method for being valid.- Specified by:
assertMethodin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint- Parameters:
name- The name of the method.isAbstract-trueif the method is abstract.isPublic-trueif this method is public.isPrivate-trueif this method is private.isStatic-trueif this method is static.isVirtual-trueif this method is virtual.isConstructor-trueif this method is a constructor.isDefaultValueIncompatible-trueif a method's signature cannot describe an annotation property method.isGeneric-trueif this method defines a generic signature.
-
assertAnnotation
public void assertAnnotation()
Asserts the legitimacy of an annotation for the instrumented type.- Specified by:
assertAnnotationin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertTypeAnnotation
public void assertTypeAnnotation()
Asserts the legitimacy of a type annotation for the instrumented type.- Specified by:
assertTypeAnnotationin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertDefaultValue
public void assertDefaultValue(java.lang.String name)
Asserts if a default value is legal for a method.- Specified by:
assertDefaultValuein interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint- Parameters:
name- The name of the method.
-
assertDefaultMethodCall
public void assertDefaultMethodCall()
Asserts if it is legal to invoke a default method from a type.- Specified by:
assertDefaultMethodCallin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertType
public void assertType(int modifier, @MaybeNull java.lang.String superClassInternalName, boolean definesInterfaces, boolean isGeneric)Asserts if the type can legally represent a package description.- Specified by:
assertTypein interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint- Parameters:
modifier- The modifier that is to be written to the type.superClassInternalName- The internal name of the super class ornullif none.definesInterfaces-trueif this type implements at least one interface.isGeneric-trueif this type defines a generic type signature.
-
assertTypeInConstantPool
public void assertTypeInConstantPool()
Asserts the capability to store a type constant in the class's constant pool.- Specified by:
assertTypeInConstantPoolin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertMethodTypeInConstantPool
public void assertMethodTypeInConstantPool()
Asserts the capability to store a method type constant in the class's constant pool.- Specified by:
assertMethodTypeInConstantPoolin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertHandleInConstantPool
public void assertHandleInConstantPool()
Asserts the capability to store a method handle in the class's constant pool.- Specified by:
assertHandleInConstantPoolin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertInvokeDynamic
public void assertInvokeDynamic()
Asserts the capability to invoke a method dynamically.- Specified by:
assertInvokeDynamicin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertSubRoutine
public void assertSubRoutine()
Asserts the capability of executing a subroutine.- Specified by:
assertSubRoutinein interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertDynamicValueInConstantPool
public void assertDynamicValueInConstantPool()
Asserts the capability of storing a dynamic value in the constant pool.- Specified by:
assertDynamicValueInConstantPoolin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertNestMate
public void assertNestMate()
Asserts the capability of storing nest mate information.- Specified by:
assertNestMatein interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertRecord
public void assertRecord()
Asserts the presence of a record component.- Specified by:
assertRecordin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertPermittedSubclass
public void assertPermittedSubclass()
Asserts the presence of a permitted subclass.- Specified by:
assertPermittedSubclassin interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
-