public class SchemaHandler
extends java.lang.Object
Constructor and Description |
---|
SchemaHandler(java.io.InputStream is)
Constructs a new SchemaHandler
|
SchemaHandler(java.lang.String xml)
Constructs a new SchemaHandler
|
SchemaHandler(java.net.URL url)
Constructs a new SchemaHandler
|
Modifier and Type | Method and Description |
---|---|
boolean |
compileAndValidate(java.lang.String xml)
Compiles the schema, and if successful validates an XML String against it
|
boolean |
compileSchema()
Attempts to compile the schema.
|
java.lang.String |
getConcatenatedMessage() |
Element |
getDataTypeDefinition(java.lang.String typeName)
Gets the schema element definition of a data type by name
|
java.util.List<java.lang.String> |
getErrorMessages() |
java.util.List<java.lang.String> |
getMessages() |
java.util.Set<java.lang.String> |
getPrimaryTypeNames() |
java.lang.String |
getSchema() |
java.util.Map<java.lang.String,Element> |
getTypeMap()
Gets the map of data type names to their definitions
|
java.util.List<java.lang.String> |
getWarningMessages() |
void |
setSchema(java.lang.String schema) |
boolean |
validate(java.lang.String xml)
Validates the given XML document against the compiled schema.
|
public SchemaHandler(java.lang.String xml)
xml
- XML String representing the schema this handler will use for validationpublic SchemaHandler(java.io.InputStream is)
is
- a Stream representing the schema this handler will use for validationpublic SchemaHandler(java.net.URL url)
url
- a URL to the XSD representing the schema this handler will use for validationpublic boolean compileAndValidate(java.lang.String xml)
xml
- the XML String to validate against Schemapublic boolean compileSchema()
public boolean validate(java.lang.String xml)
xml
- instance document to be validated.java.lang.IllegalStateException
- if schema has not been compiled successfullypublic java.util.List<java.lang.String> getErrorMessages()
public java.util.List<java.lang.String> getWarningMessages()
public java.util.List<java.lang.String> getMessages()
public java.lang.String getConcatenatedMessage()
public java.lang.String getSchema()
public void setSchema(java.lang.String schema)
schema
- new schema to use (resets everything)public java.util.Set<java.lang.String> getPrimaryTypeNames()
public Element getDataTypeDefinition(java.lang.String typeName)
typeName
- the data type namepublic java.util.Map<java.lang.String,Element> getTypeMap()
Copyright © 2004-2014 The YAWL Foundation.