public static class ClassVisitorWrapper.Chain extends Object implements ClassVisitorWrapper
ClassVisitorWrapper
s.ClassVisitorWrapper.Chain
Modifier | Constructor and Description |
---|---|
|
Chain()
Creates an immutable empty chain.
|
protected |
Chain(List<ClassVisitorWrapper> classVisitorWrappers)
Creates a new immutable chain based on an existing list of
ClassVisitorWrapper s
where no copy of the received list is made. |
Modifier and Type | Method and Description |
---|---|
ClassVisitorWrapper.Chain |
append(ClassVisitorWrapper classVisitorWrapper)
Adds a
ClassVisitorWrapper to the end of the chain such that the wrapped
ASM ClassVisitor will be applied after the other class visitors. |
boolean |
equals(Object other) |
int |
hashCode() |
int |
mergeReader(int hint)
Defines a hint that is provided to any
ClassReader when reading a class if applicable. |
int |
mergeWriter(int hint)
Defines a hint that is provided to any
ClassWriter when writing a class. |
ClassVisitorWrapper.Chain |
prepend(ClassVisitorWrapper classVisitorWrapper)
Adds a
ClassVisitorWrapper to the beginning of the chain such that the wrapped
ASM ClassVisitor will be applied before the other class visitors. |
String |
toString() |
ClassVisitor |
wrap(ClassVisitor classVisitor)
Applies a
ClassVisitorWrapper to the creation of a DynamicType . |
public Chain()
protected Chain(List<ClassVisitorWrapper> classVisitorWrappers)
ClassVisitorWrapper
s
where no copy of the received list is made.classVisitorWrappers
- A list of ClassVisitorWrapper
s where elements
at the beginning of the list are applied first, i.e. will be at the bottom of the generated
ClassVisitor
.public ClassVisitorWrapper.Chain prepend(ClassVisitorWrapper classVisitorWrapper)
ClassVisitorWrapper
to the beginning of the chain such that the wrapped
ASM ClassVisitor
will be applied before the other class visitors.classVisitorWrapper
- The ClassVisitorWrapper
to add to the beginning of the chain.ClassVisitorWrapper
.public ClassVisitorWrapper.Chain append(ClassVisitorWrapper classVisitorWrapper)
ClassVisitorWrapper
to the end of the chain such that the wrapped
ASM ClassVisitor
will be applied after the other class visitors.classVisitorWrapper
- The ClassVisitorWrapper
to add to the end of the chain.ClassVisitorWrapper
.public int mergeWriter(int hint)
ClassVisitorWrapper
ClassWriter
when writing a class. Typically, this gives opportunity to instruct ASM
to compute stack map frames or the size of the local variables array and the operand stack. If no specific hints are required for
applying this wrapper, the given value is to be returned.mergeWriter
in interface ClassVisitorWrapper
hint
- The current hint. This value should be merged (e.g. hint | foo
) into the value that is returned by this wrapper.ClassWriter
.public int mergeReader(int hint)
ClassVisitorWrapper
ClassReader
when reading a class if applicable. Typically, this gives opportunity to
instruct ASM to expand or skip frames and to skip code and debug information. If no specific hints are required for applying this
wrapper, the given value is to be returned.mergeReader
in interface ClassVisitorWrapper
hint
- The current hint. This value should be merged (e.g. hint | foo
) into the value that is returned by this wrapper.ClassReader
.public ClassVisitor wrap(ClassVisitor classVisitor)
ClassVisitorWrapper
ClassVisitorWrapper
to the creation of a DynamicType
.wrap
in interface ClassVisitorWrapper
classVisitor
- A ClassVisitor
to become the new primary class visitor to which the created
DynamicType
is written to.ClassVisitor
that usually delegates to the ClassVisitor
delivered in the argument.Copyright © 2014–2015. All rights reserved.