Package com.jcabi.xml
Class XSDDocument
java.lang.Object
com.jcabi.xml.XSDDocument
- All Implemented Interfaces:
XSD
Implementation of
XSD
.
Objects of this class are immutable and thread-safe.
- Since:
- 0.5
- Suppressed Checkstyle violations:
- AbbreviationAsWordInNameCheck (5 lines)
-
Constructor Summary
ConstructorDescriptionXSDDocument
(XML src) Public ctor, from XSD as a source.XSDDocument
(File file) Public ctor, from file.XSDDocument
(InputStream stream) Public ctor, from XSD as an input stream.XSDDocument
(String src) Public ctor, from XSD as a string.XSDDocument
(URI uri) Public ctor, from URI.XSDDocument
(URL url) Public ctor, from URL.XSDDocument
(Path file) Public ctor, from file. -
Method Summary
Modifier and TypeMethodDescriptionstatic XSD
make
(InputStream stream) Make an instance of XSD schema without I/O exceptions.static XSD
Make an instance of XSD schema without I/O exceptions.toString()
Validate XML.
-
Constructor Details
-
XSDDocument
Public ctor, from XSD as a source.- Parameters:
src
- XSD document body
-
XSDDocument
Public ctor, from XSD as a string.- Parameters:
src
- XSD document body
-
XSDDocument
Public ctor, from URL.- Parameters:
url
- Location of document- Throws:
IOException
- If fails to read- Since:
- 0.7.4
-
XSDDocument
Public ctor, from file.- Parameters:
file
- Location of document- Throws:
FileNotFoundException
- If fails to read- Since:
- 0.21
-
XSDDocument
Public ctor, from file.- Parameters:
file
- Location of document- Throws:
FileNotFoundException
- If fails to read- Since:
- 0.21
-
XSDDocument
Public ctor, from URI.- Parameters:
uri
- Location of document- Throws:
IOException
- If fails to read- Since:
- 0.15
-
XSDDocument
Public ctor, from XSD as an input stream.- Parameters:
stream
- XSD input stream
-
-
Method Details
-
make
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
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
-
validate
Description copied from interface:XSD
Validate XML.
-