Package com.jcabi.xml

Class XSDDocument

java.lang.Object
com.jcabi.xml.XSDDocument
All Implemented Interfaces:
XSD

@Deprecated public final class XSDDocument extends Object implements XSD
Deprecated.
This class is deprecated since 0.31.0. Instead, you can use StrictXML with a schema provided in the constructor. Otherwise, you can use XMLDocument and validate the XML against the schema via the XMLDocument.validate(XML) method.
Implementation of XSD.

Objects of this class are immutable and thread-safe.

Since:
0.5
Suppressed Checkstyle violations:
AbbreviationAsWordInNameCheck (5 lines)
  • Constructor Details

    • XSDDocument

      public XSDDocument(XML src)
      Deprecated.
      Public ctor, from XSD as a source.
      Parameters:
      src - XSD document body
    • XSDDocument

      public XSDDocument(String src)
      Deprecated.
      Public ctor, from XSD as a string.
      Parameters:
      src - XSD document body
    • XSDDocument

      public XSDDocument(URL url) throws IOException
      Deprecated.
      Public ctor, from URL.
      Parameters:
      url - Location of document
      Throws:
      IOException - If fails to read
      Since:
      0.7.4
    • XSDDocument

      public XSDDocument(Path file) throws FileNotFoundException
      Deprecated.
      Public ctor, from file.
      Parameters:
      file - Location of document
      Throws:
      FileNotFoundException - If fails to read
      Since:
      0.21
    • XSDDocument

      public XSDDocument(File file) throws FileNotFoundException
      Deprecated.
      Public ctor, from file.
      Parameters:
      file - Location of document
      Throws:
      FileNotFoundException - If fails to read
      Since:
      0.21
    • XSDDocument

      public XSDDocument(URI uri) throws IOException
      Deprecated.
      Public ctor, from URI.
      Parameters:
      uri - Location of document
      Throws:
      IOException - If fails to read
      Since:
      0.15
    • XSDDocument

      public XSDDocument(InputStream stream)
      Deprecated.
      Public ctor, from XSD as an input stream.
      Parameters:
      stream - XSD input stream
  • Method Details

    • make

      public static XSD make(InputStream stream)
      Deprecated.
      Make an instance of XSD schema without I/O exceptions.

      This factory method is useful when you need to create an instance of XSD schema as a static final variable. In this case you can't catch an exception but this method can help, for example:

       class Foo {
         private static final XSD SCHEMA = XSDDocument.make(
           Foo.class.getResourceAsStream("my-schema.xsd")
         );
       }
      Parameters:
      stream - Input stream
      Returns:
      XSD schema
    • make

      public static XSD make(URL url)
      Deprecated.
      Make an instance of XSD schema without I/O exceptions.
      Parameters:
      url - URL with content
      Returns:
      XSD schema
      Since:
      0.7.4
      See Also:
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object
    • validate

      public Collection<SAXParseException> validate(Source xml)
      Deprecated.
      Description copied from interface: XSD
      Validate XML.
      Specified by:
      validate in interface XSD
      Parameters:
      xml - Source XML document
      Returns:
      Collection of problems found (empty if no problems)