java.lang.Object
org.glavo.classfile.impl.ChainedClassBuilder
- All Implemented Interfaces:
Consumer<ClassElement>,ClassBuilder,ClassfileBuilder<ClassElement,ClassBuilder>
public final class ChainedClassBuilder
extends Object
implements ClassBuilder, Consumer<ClassElement>
-
Constructor Summary
ConstructorsConstructorDescriptionChainedClassBuilder(ClassBuilder downstream, Consumer<ClassElement> consumer) -
Method Summary
Modifier and TypeMethodDescriptionReturns the constant pool builder associated with this builder.original()Returns theClassModelrepresenting the class being transformed, if this class builder represents the transformation of someClassModel.transformField(FieldModel field, FieldTransform transform) Adds a field by transforming a field from another class.transformMethod(MethodModel method, MethodTransform transform) Adds a method by transforming a method from another class.with(ClassElement element) Integrate theClassfileElementinto the entity being built.withField(Utf8Entry name, Utf8Entry descriptor, Consumer<? super FieldBuilder> handler) Adds a field.withMethod(Utf8Entry name, Utf8Entry descriptor, int flags, Consumer<? super MethodBuilder> handler) Adds a method.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.glavo.classfile.ClassBuilder
withField, withField, withField, withFlags, withFlags, withInterfaces, withInterfaces, withInterfaceSymbols, withInterfaceSymbols, withMethod, withMethodBody, withMethodBody, withSuperclass, withSuperclass, withVersionMethods inherited from interface org.glavo.classfile.ClassfileBuilder
accept, canWriteDirect, transform
-
Constructor Details
-
ChainedClassBuilder
-
-
Method Details
-
with
Description copied from interface:ClassfileBuilderIntegrate theClassfileElementinto the entity being built.- Specified by:
within interfaceClassfileBuilder<ClassElement,ClassBuilder> - Parameters:
element- the element- Returns:
- this builder
-
original
Description copied from interface:ClassBuilderReturns theClassModelrepresenting the class being transformed, if this class builder represents the transformation of someClassModel.- Specified by:
originalin interfaceClassBuilder- Returns:
- the
ClassModelrepresenting the class being transformed, if this class builder represents the transformation of someClassModel
-
withField
public ClassBuilder withField(Utf8Entry name, Utf8Entry descriptor, Consumer<? super FieldBuilder> handler) Description copied from interface:ClassBuilderAdds a field.- Specified by:
withFieldin interfaceClassBuilder- Parameters:
name- the name of the fielddescriptor- the field descriptorhandler- handler which receives aFieldBuilderwhich can further define the contents of the field- Returns:
- this builder
-
transformField
Description copied from interface:ClassBuilderAdds a field by transforming a field from another class.- Specified by:
transformFieldin interfaceClassBuilder- Parameters:
field- the field to be transformedtransform- the transform to apply to the field- Returns:
- this builder
-
withMethod
public ClassBuilder withMethod(Utf8Entry name, Utf8Entry descriptor, int flags, Consumer<? super MethodBuilder> handler) Description copied from interface:ClassBuilderAdds a method.- Specified by:
withMethodin interfaceClassBuilder- Parameters:
name- the name of the methoddescriptor- the method descriptorflags- the access flagshandler- handler which receives aMethodBuilderwhich can further define the contents of the method- Returns:
- this builder
-
transformMethod
Description copied from interface:ClassBuilderAdds a method by transforming a method from another class.- Specified by:
transformMethodin interfaceClassBuilder- Parameters:
method- the method to be transformedtransform- the transform to apply to the method- Returns:
- this builder
-
constantPool
Description copied from interface:ClassfileBuilderReturns the constant pool builder associated with this builder.- Specified by:
constantPoolin interfaceClassfileBuilder<ClassElement,ClassBuilder> - Returns:
- the constant pool builder associated with this builder
-