Module org.glavo.classfile
Package org.glavo.classfile.impl
Record Class TransformImpl.ChainedClassTransform
java.lang.Object
java.lang.Record
org.glavo.classfile.impl.TransformImpl.ChainedClassTransform
- All Implemented Interfaces:
ClassfileTransform<ClassTransform,,ClassElement, ClassBuilder> ClassTransform
- Enclosing class:
TransformImpl
public static record TransformImpl.ChainedClassTransform(ClassTransform t, ClassTransform next)
extends Record
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glavo.classfile.ClassfileTransform
ClassfileTransform.ResolvedTransform<E extends ClassfileElement> -
Field Summary
Fields inherited from interface org.glavo.classfile.ClassTransform
ACCEPT_ALL -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aChainedClassTransformrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaccept(ClassBuilder builder, ClassElement element) Transform an element by taking the appropriate actions on the builder.default voidatEnd(ClassBuilder builder) Take any final action during transformation of a classfile entity.default voidatStart(ClassBuilder builder) Take any preliminary action during transformation of a classfile entity.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.next()Returns the value of thenextrecord component.resolve(ClassBuilder builder) Bind a transform to a builder.t()Returns the value of thetrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.glavo.classfile.ClassTransform
andThen
-
Constructor Details
-
ChainedClassTransform
Creates an instance of aChainedClassTransformrecord class.- Parameters:
t- the value for thetrecord componentnext- the value for thenextrecord component
-
-
Method Details
-
resolve
Description copied from interface:ClassfileTransformBind a transform to a builder. If the transform is chained, intermediate builders are created for each chain link. If the transform is stateful (see, e.g.,ClassTransform.ofStateful(Supplier)), the supplier is invoked to get a fresh transform object.This method is a low-level method that should rarely be used by user code; most of the time, user code should prefer
ClassfileBuilder.transform(CompoundElement, ClassfileTransform), which resolves the transform and executes it on the current builder.- Specified by:
resolvein interfaceClassfileTransform<ClassTransform,ClassElement, ClassBuilder> - Specified by:
resolvein interfaceClassTransform- Parameters:
builder- the builder to bind to- Returns:
- the bound result
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
t
Returns the value of thetrecord component.- Returns:
- the value of the
trecord component
-
next
Returns the value of thenextrecord component.- Returns:
- the value of the
nextrecord component
-
accept
Description copied from interface:ClassfileTransformTransform an element by taking the appropriate actions on the builder. Used when transforming a classfile entity (class, method, field, method body.) If no transformation is desired, the element can be presented toClassfileBuilder.with(ClassfileElement). If the element is to be dropped, no action is required.- Specified by:
acceptin interfaceClassfileTransform<ClassTransform,ClassElement, ClassBuilder> - Parameters:
builder- the builder for the new entityelement- the element
-
atEnd
Description copied from interface:ClassfileTransformTake any final action during transformation of a classfile entity. Called after all elements of the class are presented toClassfileTransform.accept(ClassfileBuilder, ClassfileElement).- Specified by:
atEndin interfaceClassfileTransform<ClassTransform,ClassElement, ClassBuilder> - Parameters:
builder- the builder for the new entity
-
atStart
Description copied from interface:ClassfileTransformTake any preliminary action during transformation of a classfile entity. Called before any elements of the class are presented toClassfileTransform.accept(ClassfileBuilder, ClassfileElement).- Specified by:
atStartin interfaceClassfileTransform<ClassTransform,ClassElement, ClassBuilder> - Parameters:
builder- the builder for the new entity
-