Class DynamicType.Builder.AbstractBase.UsingTypeWriter<U>

java.lang.Object
net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase<U>
net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.UsingTypeWriter<U>
Type Parameters:
U - A loaded type that the built type is guaranteed to be a subclass of.
All Implemented Interfaces:
DynamicType.Builder<U>
Direct Known Subclasses:
DecoratingDynamicTypeBuilder, DynamicType.Builder.AbstractBase.Adapter
Enclosing class:
DynamicType.Builder.AbstractBase<S>

public abstract static class DynamicType.Builder.AbstractBase.UsingTypeWriter<U> extends DynamicType.Builder.AbstractBase<U>
A dynamic type writer that uses a TypeWriter to create a dynamic type.
  • Constructor Details

    • UsingTypeWriter

      public UsingTypeWriter()
  • Method Details

    • wrap

      public ContextClassVisitor wrap(org.objectweb.asm.ClassVisitor classVisitor, int writerFlags, int readerFlags)
      Wraps a class visitor with the configuration that is represented by this dynamic type builder, using a default TypePool. A wrapper might not apply all features that are normally applied by Byte Buddy, if those features require control of the class loading life cycle. Neither does a wrapper define auxiliary types. It is therefore recommended to use Implementation.Context.Disabled.
      Parameters:
      classVisitor - The class visitor to wrap.
      writerFlags - The ASM writer flags to apply.
      readerFlags - The ASM reader flags to apply.
      Returns:
      A new class visitor that wraps a representation of this dynamic type.
    • wrap

      public ContextClassVisitor wrap(org.objectweb.asm.ClassVisitor classVisitor, TypePool typePool, int writerFlags, int readerFlags)
      Wraps a class visitor with the configuration that is represented by this dynamic type builder. A wrapper might not apply all features that are normally applied by Byte Buddy, if those features require control of the class loading life cycle. Neither does a wrapper define auxiliary types. It is therefore recommended to use Implementation.Context.Disabled.
      Parameters:
      classVisitor - The class visitor to wrap.
      typePool - A type pool that is used for computing stack map frames by the underlying class writer, if required.
      writerFlags - The ASM writer flags to apply.
      readerFlags - The ASM reader flags to apply.
      Returns:
      A new class visitor that wraps a representation of this dynamic type.
    • make

      public DynamicType.Unloaded<U> make(TypeResolutionStrategy typeResolutionStrategy)

      Creates the dynamic type this builder represents. If the specified dynamic type is not legal, an IllegalStateException is thrown.

      The dynamic type is initialized using a TypeResolutionStrategy.Passive strategy. Using this strategy, no LoadedTypeInitializer is run during the execution of the type's initializer such that no Implementation used for executing the initializer must rely on such an initializer.

      Parameters:
      typeResolutionStrategy - The type resolution strategy to use for the created type's initialization.
      Returns:
      An unloaded dynamic type representing the type specified by this builder.
    • make

      public DynamicType.Unloaded<U> make(TypeResolutionStrategy typeResolutionStrategy, TypePool typePool)
      Creates the dynamic type this builder represents. If the specified dynamic type is not legal, an IllegalStateException is thrown.
      Parameters:
      typeResolutionStrategy - The type resolution strategy to use for the created type's initialization.
      typePool - A type pool that is used for computing stack map frames by the underlying class writer, if required.
      Returns:
      An unloaded dynamic type representing the type specified by this builder.
    • toTypeWriter

      protected abstract TypeWriter<U> toTypeWriter()
      Creates a TypeWriter without an explicitly specified TypePool.
      Returns:
      An appropriate TypeWriter.
    • toTypeWriter

      protected abstract TypeWriter<U> toTypeWriter(TypePool typePool)
      Creates a TypeWriter given the specified TypePool.
      Parameters:
      typePool - The TypePool to use.
      Returns:
      An appropriate TypeWriter.