Interface AttributeNameConverter

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface AttributeNameConverter
    Interface used to convert (replace) an attribute name.
    Author:
    Damien Carbonne
    • Field Detail

      • IDENTITY

        static final AttributeNameConverter IDENTITY
        An attribute name converter that returns the name unchanged.
    • Method Detail

      • convertAttributeName

        String convertAttributeName​(Element element,
                                    String name)
        Returns the name that should be used instead of the original name.
        Parameters:
        element - The element.
        name - The attribute name.
        Returns:
        The name to use for attribute, instead of name.
      • fromNameFunction

        static AttributeNameConverter fromNameFunction​(UnaryOperator<String> function)
        Creates a new AttributeNameConverter from a name converter function.

        Conversion is independent of element.

        Parameters:
        function - The function used to convert attribute names.
        Returns:
        A new AttributeValueConverter from function.
        Throws:
        IllegalArgumentException - When function is null.
      • fromNameMap

        static AttributeNameConverter fromNameMap​(Map<String,​String> map)
        Creates a new AttributeNameConverter from a map.

        Conversion is independent of element.
        If a name is not mapped, then result is that name.

        Parameters:
        map - The map.
        Returns:
        A new AttributeValueConverter from map.
        Throws:
        IllegalArgumentException - When map is null.