org.eclipse.cosmos.rm.validation.internal.smlvalidators
Class SchematronValidator
java.lang.Object
org.eclipse.cosmos.rm.validation.internal.core.AbstractValidator
org.eclipse.cosmos.rm.validation.internal.core.AbstractSMLValidator
org.eclipse.cosmos.rm.validation.internal.smlvalidators.SchematronValidator
- All Implemented Interfaces:
- ISMLValidator, IValidator
public class SchematronValidator
- extends AbstractSMLValidator
This validator will apply schematrons to elements whose schema
has a schemtron.
| 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 |
initialize(java.util.Map validationAttribute)
Read in common attributes that are shared between multiple
validators. |
protected boolean |
processNode(org.w3c.dom.Node currentElement,
org.w3c.dom.Node rootElement,
java.lang.Object alias)
Processes a node to determine if a schematron should be applied. |
protected void |
transform(javax.xml.transform.Source source,
javax.xml.transform.Source xslt,
javax.xml.transform.Result result,
org.eclipse.cosmos.rm.validation.internal.smlvalidators.SchematronValidator.ErrorCaptureStream captureError)
Helper method that will apply a xslt transform to a given xml source and write the results
to a Result object |
boolean |
validate()
Performs the validation and returns true if successful and
false otherwise. |
protected boolean |
validateSchematron(Schematron schematronNode,
org.w3c.dom.Node currentElement,
org.w3c.dom.Node rootElement)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SKELETON15
protected static final java.lang.String SKELETON15
- See Also:
- Constant Field Values
validationLogger
protected IValidationOutput validationLogger
elementTypeMapBuilderStructure
protected ElementTypeMap elementTypeMapBuilderStructure
schemaCacheBuilderStructure
protected ElementSchematronCacheBuilder.RuleBindings schemaCacheBuilderStructure
documentDOMBuilder
protected DocumentDOMBuilder documentDOMBuilder
inheritance
protected java.util.Map inheritance
SchematronValidator
public SchematronValidator()
initialize
public void initialize(java.util.Map validationAttribute)
- Description copied from class:
AbstractValidator
- Read in common attributes that are shared between multiple
validators.
- Specified by:
initialize in interface IValidator- Overrides:
initialize in class AbstractValidator
- Parameters:
validationAttribute - The validation outputs- See Also:
IValidator.initialize(java.util.Map)
validate
public boolean validate()
- Description copied from interface:
IValidator
- Performs the validation and returns true if successful and
false otherwise.
- Returns:
- true if successful; false otherwise
processNode
protected boolean processNode(org.w3c.dom.Node currentElement,
org.w3c.dom.Node rootElement,
java.lang.Object alias)
- Processes a node to determine if a schematron should be applied.
- Parameters:
currentElement - node to processrootElement - root document element associated with the current elementalias - alias name of the root document. This is needed if rule binding is defined in document
- Returns:
- true if node was processed successfully otherwise false is returned.
validateSchematron
protected boolean validateSchematron(Schematron schematronNode,
org.w3c.dom.Node currentElement,
org.w3c.dom.Node rootElement)
transform
protected void transform(javax.xml.transform.Source source,
javax.xml.transform.Source xslt,
javax.xml.transform.Result result,
org.eclipse.cosmos.rm.validation.internal.smlvalidators.SchematronValidator.ErrorCaptureStream captureError)
throws javax.xml.transform.TransformerException
- Helper method that will apply a xslt transform to a given xml source and write the results
to a Result object
- Parameters:
source - xml sourcexslt - xslt transform that will be applied to the sourceresult - stores the resulting transformcaptureError - Used to capture errors writtern to the error stream
- Throws:
javax.xml.transform.TransformerException