public final class XSDDocument extends Object implements XSD
XSD.
Objects of this class are immutable and thread-safe.
| Constructor and Description |
|---|
XSDDocument(File file)
Public ctor, from file.
|
XSDDocument(InputStream stream)
Public ctor, from XSD as an input stream.
|
XSDDocument(Path file)
Public ctor, from file.
|
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(XML src)
Public ctor, from XSD as a source.
|
| Modifier and Type | Method and Description |
|---|---|
static XSD |
make(InputStream stream)
Make an instance of XSD schema without I/O exceptions.
|
static XSD |
make(URL url)
Make an instance of XSD schema without I/O exceptions.
|
String |
toString() |
Collection<SAXParseException> |
validate(Source xml)
Validate XML.
|
public XSDDocument(XML src)
src - XSD document bodypublic XSDDocument(String src)
src - XSD document bodypublic XSDDocument(URL url) throws IOException
url - Location of documentIOException - If fails to readpublic XSDDocument(Path file) throws FileNotFoundException
file - Location of documentFileNotFoundException - If fails to readpublic XSDDocument(File file) throws FileNotFoundException
file - Location of documentFileNotFoundException - If fails to readpublic XSDDocument(URI uri) throws IOException
uri - Location of documentIOException - If fails to readpublic XSDDocument(InputStream stream)
stream - XSD input streampublic static XSD make(InputStream stream)
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")
);
}stream - Input streampublic static XSD make(URL url)
url - URL with contentmake(InputStream)public Collection<SAXParseException> validate(Source xml)
XSDCopyright © 2012–2019 jcabi.com. All rights reserved.