Class ConstructorStrategy.ForDefaultConstructor

    • Constructor Detail

      • ForDefaultConstructor

        public ForDefaultConstructor()
        Creates a constructor strategy for invoking a super constructor with default arguments.
      • ForDefaultConstructor

        public ForDefaultConstructor​(ElementMatcher<? super MethodDescription> elementMatcher)
        Creates a constructor strategy for invoking a super constructor with default arguments.
        Parameters:
        elementMatcher - A matcher to select a super constructor among possible candidates.
      • ForDefaultConstructor

        public ForDefaultConstructor​(MethodAttributeAppender.Factory methodAttributeAppenderFactory)
        Creates a constructor strategy for invoking a super constructor with default arguments.
        Parameters:
        methodAttributeAppenderFactory - The method attribute appender factory to apply.
      • ForDefaultConstructor

        public ForDefaultConstructor​(ElementMatcher<? super MethodDescription> elementMatcher,
                                     MethodAttributeAppender.Factory methodAttributeAppenderFactory)
        Creates a constructor strategy for invoking a super constructor with default arguments.
        Parameters:
        elementMatcher - A matcher to select a super constructor among possible candidates.
        methodAttributeAppenderFactory - The method attribute appender factory to apply.
    • Method Detail

      • extractConstructors

        public List<MethodDescription.Token> extractConstructors​(TypeDescription instrumentedType)
        Extracts constructors for a given super type. The extracted constructor signatures will then be imitated by the created dynamic type.
        Specified by:
        extractConstructors in interface ConstructorStrategy
        Parameters:
        instrumentedType - The type for which the constructors should be created.
        Returns:
        A list of tokens that describe the constructors that are to be implemented.