Interface XMLAttribute.Builder<RC,​WC>

    • Method Detail

      • withUsage

        XMLAttribute.Builder<RC,​WC> withUsage​(XMLUsage usage)
        Overrides the usage of this attribute
        Parameters:
        usage - the attribute usage
        Returns:
        a reference to this builder
      • withDefaultValue

        XMLAttribute.Builder<RC,​WC> withDefaultValue​(String defaultValue)
        Specifies a default value for this attribute, applied if the attribute is absent from the input.
        Parameters:
        defaultValue - the default value of this attribute
        Returns:
        a reference to this builder
      • withFixedValue

        XMLAttribute.Builder<RC,​WC> withFixedValue​(String fixedValue)
        Specifies a fixed value of this attribute, applied if the attribute is absent from the input. However, if this attribute is present in the input, it must specify this fixed value.
        Parameters:
        defaultValue - the fixed value of this attribute
        Returns:
        a reference to this builder
      • withConsumer

        XMLAttribute.Builder<RC,​WC> withConsumer​(BiConsumer<RC,​String> consumer)
        Specifies a consumer used to apply an attribute value to the read context.
        Parameters:
        consumer - consumes the attribute value into the read context
        Returns:
        a reference to this builder
      • withFormatter

        XMLAttribute.Builder<RC,​WC> withFormatter​(Function<WC,​String> formatter)
        Specifies a function used to format content as an attribute value.
        Parameters:
        formatter - a function returning the attribute value of the content to be written.
        Returns:
        a reference to this builder
      • build

        XMLAttribute<RC,​WC> build()
        Builds this attribute
        Returns:
        an XML attribute