Class StrictXmir

java.lang.Object
org.eolang.parser.StrictXmir
All Implemented Interfaces:
com.jcabi.xml.XML

public final class StrictXmir extends Object implements com.jcabi.xml.XML
XMIR that validates itself right after construction.

Be careful with this class, because it modifies the XML encapsulated by replacing the URI of XSD schema with a file, thus making schema validation faster. The original URI of the XSD schema will be lost/removed from the XML. Thus, you better save the XML to disc and only then encapsulate it into this decorator.

Since:
0.49.0
  • Constructor Details

    • StrictXmir

      public StrictXmir(com.jcabi.xml.XML src)
      Ctor.
      Parameters:
      src - The source
    • StrictXmir

      public StrictXmir(com.jcabi.xml.XML before, Path tmp)
      Ctor. Synchronization by XML is necessary in case we're trying to validate the same XML in multiple threads. In such case the path to XSD scheme inside XML should be updated only once.
      Parameters:
      before - The XML source
      tmp - The directory with cached XSD files
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • xpath

      public List<String> xpath(String query)
      Specified by:
      xpath in interface com.jcabi.xml.XML
    • nodes

      public List<com.jcabi.xml.XML> nodes(String query)
      Specified by:
      nodes in interface com.jcabi.xml.XML
    • registerNs

      public com.jcabi.xml.XML registerNs(String prefix, Object uri)
      Specified by:
      registerNs in interface com.jcabi.xml.XML
    • merge

      public com.jcabi.xml.XML merge(NamespaceContext context)
      Specified by:
      merge in interface com.jcabi.xml.XML
    • node

      @Deprecated public Node node()
      Deprecated.
      Specified by:
      node in interface com.jcabi.xml.XML
    • inner

      public Node inner()
      Specified by:
      inner in interface com.jcabi.xml.XML
    • deepCopy

      public Node deepCopy()
      Specified by:
      deepCopy in interface com.jcabi.xml.XML
    • validate

      public Collection<SAXParseException> validate(LSResourceResolver resolver)
      Specified by:
      validate in interface com.jcabi.xml.XML
    • validate

      public Collection<SAXParseException> validate(com.jcabi.xml.XML schema)
      Specified by:
      validate in interface com.jcabi.xml.XML