Package net.bytebuddy.dynamic.scaffold
Interface TypeInitializer
-
- All Superinterfaces:
ByteCodeAppender
- All Known Implementing Classes:
TypeInitializer.None
,TypeInitializer.Simple
public interface TypeInitializer extends ByteCodeAppender
A type initializer is responsible for defining a type's static initialization block.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
TypeInitializer.Drain
A drain for writing a type initializer.static class
TypeInitializer.None
Canonical implementation of a non-defined type initializer.static class
TypeInitializer.Simple
A simple, defined type initializer that executes a givenByteCodeAppender
.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.ByteCodeAppender
ByteCodeAppender.Compound, ByteCodeAppender.Size
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TypeInitializer
expandWith(ByteCodeAppender byteCodeAppender)
Expands this type initializer with another byte code appender.boolean
isDefined()
Indicates if this type initializer is defined.TypeWriter.MethodPool.Record
wrap(TypeWriter.MethodPool.Record record)
Creates a method pool record that applies this type initializer while preserving the record that was supplied.-
Methods inherited from interface net.bytebuddy.implementation.bytecode.ByteCodeAppender
apply
-
-
-
-
Method Detail
-
isDefined
boolean isDefined()
Indicates if this type initializer is defined.- Returns:
true
if this type initializer is defined.
-
expandWith
TypeInitializer expandWith(ByteCodeAppender byteCodeAppender)
Expands this type initializer with another byte code appender. For this to be possible, this type initializer must be defined.- Parameters:
byteCodeAppender
- The byte code appender to apply as the type initializer.- Returns:
- A defined type initializer.
-
wrap
TypeWriter.MethodPool.Record wrap(TypeWriter.MethodPool.Record record)
Creates a method pool record that applies this type initializer while preserving the record that was supplied.- Parameters:
record
- The record to wrap.- Returns:
- A new record that represents the supplied record while also executing this type initializer.
-
-