Class Validator


  • public class Validator
    extends java.lang.Object
    Statically validates JsonML elements. It is done in constant time: no subtree is traversed, but the element is validated based only on its properties. Sometimes, also its children are taken into account. Usually it checks if the specified element has a correct number of children, and if all require attributes exist. It does not enforce all restrictions which are implied by ES3 or ES5 specification.
    • Field Detail

      • MISSING_ARGUMENT

        public static final java.lang.String MISSING_ARGUMENT
        See Also:
        Constant Field Values
      • NOT_ENOUGH_CHILDREN_FMT

        public static final java.lang.String NOT_ENOUGH_CHILDREN_FMT
        See Also:
        Constant Field Values
      • TOO_MANY_CHILDREN_FMT

        public static final java.lang.String TOO_MANY_CHILDREN_FMT
        See Also:
        Constant Field Values
      • WRONG_CHILD_TYPE_FMT

        public static final java.lang.String WRONG_CHILD_TYPE_FMT
        See Also:
        Constant Field Values
      • exprTypes

        public static TagType[] exprTypes
    • Method Detail

      • validate

        public static java.lang.String validate​(JsonML element)
        Validates the specified JsonML element.
        Parameters:
        element - JsonML element to validate
        Returns:
        error message if the element could not be validated, an empty string otherwise
      • printList

        public static java.lang.String printList​(java.lang.Object[] list)