Class Validator

java.lang.Object
com.google.javascript.jscomp.jsonml.Validator

public class Validator extends 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 Details

  • Method Details

    • validate

      public static 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 String printList(Object[] list)