Class RedefinitionDynamicTypeBuilder<T>

  • Type Parameters:
    T - A loaded type that the dynamic type is guaranteed to be a subtype of.
    All Implemented Interfaces:
    DynamicType.Builder<T>

    public class RedefinitionDynamicTypeBuilder<T>
    extends AbstractInliningDynamicTypeBuilder<T>
    A type builder that redefines an instrumented type.
    • Constructor Detail

      • RedefinitionDynamicTypeBuilder

        public RedefinitionDynamicTypeBuilder​(InstrumentedType.WithFlexibleName instrumentedType,
                                              ClassFileVersion classFileVersion,
                                              AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
                                              AnnotationValueFilter.Factory annotationValueFilterFactory,
                                              AnnotationRetention annotationRetention,
                                              Implementation.Context.Factory implementationContextFactory,
                                              MethodGraph.Compiler methodGraphCompiler,
                                              TypeValidation typeValidation,
                                              VisibilityBridgeStrategy visibilityBridgeStrategy,
                                              ClassWriterStrategy classWriterStrategy,
                                              LatentMatcher<? super MethodDescription> ignoredMethods,
                                              TypeDescription originalType,
                                              ClassFileLocator classFileLocator)
        Creates a redefinition dynamic type builder.
        Parameters:
        instrumentedType - An instrumented type representing the subclass.
        classFileVersion - The class file version to use for types that are not based on an existing class file.
        auxiliaryTypeNamingStrategy - The naming strategy to use for naming auxiliary types.
        annotationValueFilterFactory - The annotation value filter factory to use.
        annotationRetention - The annotation retention strategy to use.
        implementationContextFactory - The implementation context factory to use.
        methodGraphCompiler - The method graph compiler to use.
        typeValidation - Determines if a type should be explicitly validated.
        visibilityBridgeStrategy - The visibility bridge strategy to apply.
        classWriterStrategy - The class writer strategy to use.
        ignoredMethods - A matcher for identifying methods that should be excluded from instrumentation.
        originalType - The original type that is being redefined or rebased.
        classFileLocator - The class file locator for locating the original type's class file.
      • RedefinitionDynamicTypeBuilder

        protected RedefinitionDynamicTypeBuilder​(InstrumentedType.WithFlexibleName instrumentedType,
                                                 FieldRegistry fieldRegistry,
                                                 MethodRegistry methodRegistry,
                                                 RecordComponentRegistry recordComponentRegistry,
                                                 TypeAttributeAppender typeAttributeAppender,
                                                 AsmVisitorWrapper asmVisitorWrapper,
                                                 ClassFileVersion classFileVersion,
                                                 AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
                                                 AnnotationValueFilter.Factory annotationValueFilterFactory,
                                                 AnnotationRetention annotationRetention,
                                                 Implementation.Context.Factory implementationContextFactory,
                                                 MethodGraph.Compiler methodGraphCompiler,
                                                 TypeValidation typeValidation,
                                                 VisibilityBridgeStrategy visibilityBridgeStrategy,
                                                 ClassWriterStrategy classWriterStrategy,
                                                 LatentMatcher<? super MethodDescription> ignoredMethods,
                                                 java.util.List<? extends DynamicType> auxiliaryTypes,
                                                 TypeDescription originalType,
                                                 ClassFileLocator classFileLocator)
        Creates a redefinition dynamic type builder.
        Parameters:
        instrumentedType - An instrumented type representing the subclass.
        fieldRegistry - The field pool to use.
        methodRegistry - The method pool to use.
        recordComponentRegistry - The record component pool to use.
        typeAttributeAppender - The type attribute appender to apply onto the instrumented type.
        asmVisitorWrapper - The ASM visitor wrapper to apply onto the class writer.
        classFileVersion - The class file version to use for types that are not based on an existing class file.
        auxiliaryTypeNamingStrategy - The naming strategy to use for naming auxiliary types.
        annotationValueFilterFactory - The annotation value filter factory to use.
        annotationRetention - The annotation retention strategy to use.
        implementationContextFactory - The implementation context factory to use.
        methodGraphCompiler - The method graph compiler to use.
        typeValidation - Determines if a type should be explicitly validated.
        visibilityBridgeStrategy - The visibility bridge strategy to apply.
        classWriterStrategy - The class writer strategy to use.
        ignoredMethods - A matcher for identifying methods that should be excluded from instrumentation.
        auxiliaryTypes - A list of explicitly required auxiliary types.
        originalType - The original type that is being redefined or rebased.
        classFileLocator - The class file locator for locating the original type's class file.
    • Method Detail

      • make

        public DynamicType.Unloaded<T> 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.