Package net.bytebuddy.dynamic.scaffold
Enum Class TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClass
java.lang.Object
java.lang.Enum<TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClass>
net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClass
- All Implemented Interfaces:
Serializable,Comparable<TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClass>,Constable,TypeWriter.Default.ValidatingClassVisitor.Constraint
- Enclosing interface:
TypeWriter.Default.ValidatingClassVisitor.Constraint
public static enum TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClass
extends Enum<TypeWriter.Default.ValidatingClassVisitor.Constraint.ForClass>
implements TypeWriter.Default.ValidatingClassVisitor.Constraint
Represents the constraint of a class type.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>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.ForPackageType, TypeWriter.Default.ValidatingClassVisitor.Constraint.ForRecord -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleantrueif this instance represents the constraints a non-abstract class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateForClass(boolean manifestType) Creates a new constraint for a class. -
Method Summary
Modifier and TypeMethodDescriptionvoidAsserts the legitimacy of an annotation for the instrumented type.voidAsserts if it is legal to invoke a default method from a type.voidassertDefaultValue(String name) Asserts if a default value is legal for a method.voidAsserts the capability of storing a dynamic value in the constant pool.voidassertField(String name, boolean isPublic, boolean isStatic, boolean isFinal, boolean isGeneric) Asserts a field for being valid.voidAsserts the capability to store a method handle in the class's constant pool.voidAsserts the capability to invoke a method dynamically.voidassertMethod(String name, boolean isAbstract, boolean isPublic, boolean isPrivate, boolean isStatic, boolean isVirtual, boolean isConstructor, boolean isDefaultValueIncompatible, boolean isGeneric) Asserts a method for being valid.voidAsserts the capability to store a method type constant in the class's constant pool.voidAsserts the capability of storing nest mate information.voidAsserts the presence of a permitted subclass.voidAsserts the presence of a record component.voidAsserts the capability of executing a subroutine.voidassertType(int modifier, boolean definesInterfaces, boolean isGeneric) Asserts if the type can legally represent a package description.voidAsserts the legitimacy of a type annotation for the instrumented type.voidAsserts the capability to store a type constant in the class's constant pool.Returns the enum constant of this class with the specified name.values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MANIFEST
Represents the constraints of a non-abstract class. -
ABSTRACT
Represents the constraints of an abstract class.
-
-
Field Details
-
manifestType
private final boolean manifestTypetrueif this instance represents the constraints a non-abstract class.
-
-
Constructor Details
-
ForClass
private ForClass(boolean manifestType) Creates a new constraint for a class.- Parameters:
manifestType-trueif this instance represents a non-abstract class.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
assertType
public void assertType(int modifier, 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.definesInterfaces-trueif this type implements at least one interface.isGeneric-trueif this type defines a generic type signature.
-
assertField
public void assertField(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(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
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
-
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
-