|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.policy.io.xmlchecking.W3CXMLSchemaValidator
public class W3CXMLSchemaValidator
Class that abstracts the W3C XML Schema validation process. It is an implementation of the SchemaValidatorInterface.
Field Summary | |
---|---|
private static org.slf4j.Logger |
LOGGER
|
private Schema |
schema
|
private static String |
SCHEMA_LANGUAGE
|
private static String |
SCHEMA_LOCATION
|
Constructor Summary | |
---|---|
W3CXMLSchemaValidator()
Create a Validator instance with the default Schema as specified in schema_checking.properties file. |
|
W3CXMLSchemaValidator(File schemaFile)
Create a Validator instance with the Schema represented by the given File object. |
Method Summary | |
---|---|
static String |
validate(File file)
Checks the file if it matches the XML scheme. |
void |
validate(Node r)
Checks if xml represented by a node is valid according to the current schema. |
void |
validate(Reader r)
Checks if xml content represented by a Reader is valid according to the current schema. |
void |
validate(Source source)
Check if xml represented by a Source is valid according to the current schema. |
void |
validate(String s)
Checks if a given xml string is valid according to the current schema. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.slf4j.Logger LOGGER
private static final String SCHEMA_LOCATION
"org.openpermis.policy.io.xmlchecking/xml_checking"
private static final String SCHEMA_LANGUAGE
"http://www.w3.org/2001/XMLSchema"
private Schema schema
Constructor Detail |
---|
public W3CXMLSchemaValidator() throws SAXException, IOException
SAXException
- Thrown if parsing of the Schema file fails
IOException
- Thrown is a file operation failspublic W3CXMLSchemaValidator(File schemaFile) throws SAXException, IOException
schemaFile
- File that contains the Schema to be used
SAXException
- Thrown if parsing of the Schema file fails
IOException
- Thrown is a file operation failsMethod Detail |
---|
public static String validate(File file)
file
- File to check
public void validate(String s) throws SAXException, IOException
s
- String to be validated
SAXException
- If parsing of the schema instance fails
IOException
- Thrown on IO errorpublic void validate(Reader r) throws SAXException, IOException
r
- Reader accessing the xml content
SAXException
- If parsing of the schema instance fails
IOException
- Thrown on IO errorpublic void validate(Node r) throws SAXException, IOException
r
- XML Node that is to be validated
SAXException
- If parsing of the schema instance fails
IOException
- Thrown on IO errorpublic void validate(Source source) throws SAXException, IOException
source
- Source to be validated
SAXException
- If parsing of the schema instance fails
IOException
- Thrown on IO error
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:14:59
Copyright (c) 2002-2007 Ergon Informatik AG