Class XMLValueConstraint<E>

  • Type Parameters:
    E - is the type of the attribute value to test.
    All Implemented Interfaces:
    XMLConstraint

    public abstract class XMLValueConstraint<E>
    extends Object
    implements XMLConstraint
    Matches the attribute "id" with the given value.
    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:40
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    inputoutput
    • Constructor Detail

      • XMLValueConstraint

        public XMLValueConstraint​(String name,
                                  E value)
        Constructor.
        Parameters:
        name - is the name of the attribute to test with the given value.
        value - is the value to match.
    • Method Detail

      • convertValue

        protected abstract E convertValue​(String stringValue)
        Invoked to convert the string into the value to test.
        Parameters:
        stringValue - the value to convert.
        Returns:
        the value to test.
      • isValidElement

        public boolean isValidElement​(Element element)
        Description copied from interface: XMLConstraint
        Replies if the given element is validating the constraints.
        Specified by:
        isValidElement in interface XMLConstraint
        Parameters:
        element - the element to validate.
        Returns:
        true if validation is success, otherwise false.