Package net.bytebuddy.dynamic.scaffold
Class TypeWriter.Default.ValidatingClassVisitor.Constraint.Compound
java.lang.Object
net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ValidatingClassVisitor.Constraint.Compound
- All Implemented Interfaces:
TypeWriter.Default.ValidatingClassVisitor.Constraint
- Enclosing interface:
TypeWriter.Default.ValidatingClassVisitor.Constraint
@Enhance
public static class TypeWriter.Default.ValidatingClassVisitor.Constraint.Compound
extends Object
implements TypeWriter.Default.ValidatingClassVisitor.Constraint
A constraint implementation that summarizes several constraints.
-
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.ForPackageType, TypeWriter.Default.ValidatingClassVisitor.Constraint.ForRecord
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<TypeWriter.Default.ValidatingClassVisitor.Constraint> A list of constraints that is enforced in the given order. -
Constructor Summary
ConstructorsConstructorDescriptionCompound
(List<? extends TypeWriter.Default.ValidatingClassVisitor.Constraint> constraints) Creates a new compound constraint. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Asserts the legitimacy of an annotation for the instrumented type.void
Asserts if it is legal to invoke a default method from a type.void
assertDefaultValue
(String name) Asserts if a default value is legal for a method.void
Asserts the capability of storing a dynamic value in the constant pool.void
assertField
(String name, boolean isPublic, boolean isStatic, boolean isFinal, boolean isGeneric) Asserts a field for being valid.void
Asserts the capability to store a method handle in the class's constant pool.void
Asserts the capability to invoke a method dynamically.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.void
Asserts the capability to store a method type constant in the class's constant pool.void
Asserts the capability of storing nest mate information.void
Asserts the presence of a permitted subclass.void
Asserts the presence of a record component.void
Asserts the capability of executing a subroutine.void
assertType
(int modifier, boolean definesInterfaces, boolean isGeneric) Asserts if the type can legally represent a package description.void
Asserts the legitimacy of a type annotation for the instrumented type.void
Asserts the capability to store a type constant in the class's constant pool.
-
Field Details
-
constraints
A list of constraints that is enforced in the given order.
-
-
Constructor Details
-
Compound
Creates a new compound constraint.- Parameters:
constraints
- A list of constraints that is enforced in the given order.
-
-
Method Details
-
assertType
public void assertType(int modifier, boolean definesInterfaces, boolean isGeneric) Asserts if the type can legally represent a package description.- Specified by:
assertType
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
- Parameters:
modifier
- The modifier that is to be written to the type.definesInterfaces
-true
if this type implements at least one interface.isGeneric
-true
if 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:
assertField
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
- Parameters:
name
- The name of the field.isPublic
-true
if this field is public.isStatic
-true
if this field is static.isFinal
-true
if this field is final.isGeneric
-true
if 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:
assertMethod
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
- Parameters:
name
- The name of the method.isAbstract
-true
if the method is abstract.isPublic
-true
if this method is public.isPrivate
-true
if this method is private.isStatic
-true
if this method is static.isVirtual
-true
if this method is virtual.isConstructor
-true
if this method is a constructor.isDefaultValueIncompatible
-true
if a method's signature cannot describe an annotation property method.isGeneric
-true
if this method defines a generic signature.
-
assertDefaultValue
Asserts if a default value is legal for a method.- Specified by:
assertDefaultValue
in 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:
assertDefaultMethodCall
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertAnnotation
public void assertAnnotation()Asserts the legitimacy of an annotation for the instrumented type.- Specified by:
assertAnnotation
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertTypeAnnotation
public void assertTypeAnnotation()Asserts the legitimacy of a type annotation for the instrumented type.- Specified by:
assertTypeAnnotation
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertTypeInConstantPool
public void assertTypeInConstantPool()Asserts the capability to store a type constant in the class's constant pool.- Specified by:
assertTypeInConstantPool
in 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:
assertMethodTypeInConstantPool
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertHandleInConstantPool
public void assertHandleInConstantPool()Asserts the capability to store a method handle in the class's constant pool.- Specified by:
assertHandleInConstantPool
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertInvokeDynamic
public void assertInvokeDynamic()Asserts the capability to invoke a method dynamically.- Specified by:
assertInvokeDynamic
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertSubRoutine
public void assertSubRoutine()Asserts the capability of executing a subroutine.- Specified by:
assertSubRoutine
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertDynamicValueInConstantPool
public void assertDynamicValueInConstantPool()Asserts the capability of storing a dynamic value in the constant pool.- Specified by:
assertDynamicValueInConstantPool
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertNestMate
public void assertNestMate()Asserts the capability of storing nest mate information.- Specified by:
assertNestMate
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertRecord
public void assertRecord()Asserts the presence of a record component.- Specified by:
assertRecord
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-
assertPermittedSubclass
public void assertPermittedSubclass()Asserts the presence of a permitted subclass.- Specified by:
assertPermittedSubclass
in interfaceTypeWriter.Default.ValidatingClassVisitor.Constraint
-