org.eclipse.cosmos.rm.validation.internal.core
Class DatastructureBuilderImpl
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.eclipse.cosmos.rm.validation.internal.core.DatastructureBuilderImpl
- All Implemented Interfaces:
- IValidator, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler
public class DatastructureBuilderImpl
- extends org.xml.sax.helpers.DefaultHandler
- implements IValidator, org.xml.sax.ext.LexicalHandler
Implements a custom SAX Default Handler that will delegate ContentHandler
calls to IDataBuilder instances.
| Fields inherited from interface org.eclipse.cosmos.rm.validation.internal.core.IValidator |
ATTRIBUTE_ENV, ATTRIBUTE_FAST_FAIL_POLICY, ATTRIBUTE_FILE_OUTPUT, ATTRIBUTE_INPUT_TYPE, ATTRIBUTE_INSTANCE, ATTRIBUTE_OUTPUT, ATTRIBUTE_SCHEMATRON_SCHEMA, ATTRIBUTE_SML_IF_SCHEMA, ATTRIBUTE_STRUCTURED_OUTPUT, ATTRIBUTE_VALIDATION_SCHEMATRON, ATTRIBUTE_VALIDATION_SML, ATTRIBUTE_VALIDATION_XML, VALUE_ENV_ECLIPSE, VALUE_ENV_STANDALONE, VALUE_SML_IF, VALUE_SML_UNIT |
|
Method Summary |
void |
addValidationListener(IValidationListener listener)
|
void |
characters(char[] ch,
int start,
int len)
|
void |
comment(char[] ch,
int start,
int len)
|
protected void |
createSAXParser(java.lang.String xsd)
Configures the default handler and associates the schema with the SAX
Parser |
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
void |
endEntity(java.lang.String arg0)
|
void |
endPrefixMapping(java.lang.String arg0)
|
void |
error(org.xml.sax.SAXParseException exception)
|
protected void |
fatalError(java.lang.Exception exception)
|
protected void |
fatalError(int lineNumber,
java.lang.String message)
|
boolean |
getStatus()
|
void |
ignorableWhitespace(char[] arg0,
int arg1,
int arg2)
|
void |
initialize(java.util.Map validationAttribute)
Initialize this validation class based on the set of attributes
passed in. |
void |
processingInstruction(java.lang.String arg0,
java.lang.String arg1)
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
|
void |
skippedEntity(java.lang.String arg0)
|
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
void |
startEntity(java.lang.String arg0)
|
void |
startPrefixMapping(java.lang.String arg0,
java.lang.String arg1)
|
void |
unparsedEntityDecl(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2,
java.lang.String arg3)
|
boolean |
validate()
Performs the validation and returns true if successful and
false otherwise. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
fatalError, notationDecl, resolveEntity, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatastructureBuilderImpl
public DatastructureBuilderImpl()
initialize
public void initialize(java.util.Map validationAttribute)
- Description copied from interface:
IValidator
- Initialize this validation class based on the set of attributes
passed in. See the ATTRIBUTE_* available.
- Specified by:
initialize in interface IValidator
- Parameters:
validationAttribute - The validation outputs- See Also:
IValidator.initialize(java.util.Map)
createSAXParser
protected void createSAXParser(java.lang.String xsd)
- Configures the default handler and associates the schema with the SAX
Parser
- Parameters:
xsd - file location of the schema file to validate
error
public void error(org.xml.sax.SAXParseException exception)
- Specified by:
error in interface org.xml.sax.ErrorHandler- Overrides:
error in class org.xml.sax.helpers.DefaultHandler
fatalError
protected void fatalError(java.lang.Exception exception)
fatalError
protected void fatalError(int lineNumber,
java.lang.String message)
validate
public boolean validate()
- Description copied from interface:
IValidator
- Performs the validation and returns true if successful and
false otherwise.
- Specified by:
validate in interface IValidator
- Returns:
- true if successful; false otherwise
- See Also:
IValidator.validate()
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
- Specified by:
startElement in interface org.xml.sax.ContentHandler- Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
endElement
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
- Specified by:
endElement in interface org.xml.sax.ContentHandler- Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
characters
public void characters(char[] ch,
int start,
int len)
throws org.xml.sax.SAXException
- Specified by:
characters in interface org.xml.sax.ContentHandler- Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
endDocument
public void endDocument()
throws org.xml.sax.SAXException
- Specified by:
endDocument in interface org.xml.sax.ContentHandler- Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
endPrefixMapping
public void endPrefixMapping(java.lang.String arg0)
throws org.xml.sax.SAXException
- Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler- Overrides:
endPrefixMapping in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
unparsedEntityDecl
public void unparsedEntityDecl(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2,
java.lang.String arg3)
throws org.xml.sax.SAXException
- Specified by:
unparsedEntityDecl in interface org.xml.sax.DTDHandler- Overrides:
unparsedEntityDecl in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
ignorableWhitespace
public void ignorableWhitespace(char[] arg0,
int arg1,
int arg2)
throws org.xml.sax.SAXException
- Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler- Overrides:
ignorableWhitespace in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
processingInstruction
public void processingInstruction(java.lang.String arg0,
java.lang.String arg1)
throws org.xml.sax.SAXException
- Specified by:
processingInstruction in interface org.xml.sax.ContentHandler- Overrides:
processingInstruction in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
skippedEntity
public void skippedEntity(java.lang.String arg0)
throws org.xml.sax.SAXException
- Specified by:
skippedEntity in interface org.xml.sax.ContentHandler- Overrides:
skippedEntity in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
startDocument
public void startDocument()
throws org.xml.sax.SAXException
- Specified by:
startDocument in interface org.xml.sax.ContentHandler- Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
startPrefixMapping
public void startPrefixMapping(java.lang.String arg0,
java.lang.String arg1)
throws org.xml.sax.SAXException
- Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler- Overrides:
startPrefixMapping in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler- Overrides:
setDocumentLocator in class org.xml.sax.helpers.DefaultHandler
getStatus
public boolean getStatus()
addValidationListener
public void addValidationListener(IValidationListener listener)
- Specified by:
addValidationListener in interface IValidator
comment
public void comment(char[] ch,
int start,
int len)
throws org.xml.sax.SAXException
- Specified by:
comment in interface org.xml.sax.ext.LexicalHandler
- Throws:
org.xml.sax.SAXException
endCDATA
public void endCDATA()
throws org.xml.sax.SAXException
- Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler
- Throws:
org.xml.sax.SAXException
endDTD
public void endDTD()
throws org.xml.sax.SAXException
- Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler
- Throws:
org.xml.sax.SAXException
endEntity
public void endEntity(java.lang.String arg0)
throws org.xml.sax.SAXException
- Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler
- Throws:
org.xml.sax.SAXException
startCDATA
public void startCDATA()
throws org.xml.sax.SAXException
- Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler
- Throws:
org.xml.sax.SAXException
startDTD
public void startDTD(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
throws org.xml.sax.SAXException
- Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler
- Throws:
org.xml.sax.SAXException
startEntity
public void startEntity(java.lang.String arg0)
throws org.xml.sax.SAXException
- Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler
- Throws:
org.xml.sax.SAXException