Class Transformer.ForMethod

    • Constructor Detail

      • ForMethod

        public ForMethod​(Transformer<MethodDescription.Token> transformer)
        Creates a new transforming method transformer.
        Parameters:
        transformer - The transformer to be applied.
    • Method Detail

      • withModifiers

        public static Transformer<MethodDescription> withModifiers​(ModifierContributor.ForMethod... modifierContributor)
        Creates a transformer that enforces the supplied modifier contributors. All ranges of each contributor is first cleared and then overridden by the specified modifiers in the order they are supplied.
        Parameters:
        modifierContributor - The modifier transformers in their application order.
        Returns:
        A method transformer where each method's modifiers are adapted to the given modifiers.
      • withModifiers

        public static Transformer<MethodDescription> withModifiers​(java.util.List<? extends ModifierContributor.ForMethod> modifierContributors)
        Creates a transformer that enforces the supplied modifier contributors. All ranges of each contributor is first cleared and then overridden by the specified modifiers in the order they are supplied.
        Parameters:
        modifierContributors - The modifier contributors in their application order.
        Returns:
        A method transformer where each method's modifiers are adapted to the given modifiers.