COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification

org.eclipse.cosmos.rm.validation.internal.core
Class SchematronValidatorImpl

java.lang.Object
  extended by org.eclipse.cosmos.rm.validation.internal.core.SchematronValidatorImpl
All Implemented Interfaces:
ISchematronValidation, IValidator

public class SchematronValidatorImpl
extends java.lang.Object
implements ISchematronValidation

This is the Schematron validation implementation class.


Field Summary
protected static java.lang.String SKELETON15
           
protected  AbstractValidationOutput validationLogger
           
protected  javax.xml.transform.Source xml
           
protected  java.lang.String xsd
           
 
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
 
Constructor Summary
SchematronValidatorImpl()
           
 
Method Summary
 void addValidationListener(IValidationListener listener)
           
 void initialize(java.util.Map validationAttribute)
          Initialize this validation class based on the set of attributes passed in.
protected  void parseMessageStream(java.lang.String messageStream)
          Helper method that logs the schematron message
 void setXML(java.lang.Object xml)
          TODO: should pass xml instance as an attribute
protected  void transform(javax.xml.transform.Source source, javax.xml.transform.Source xslt, javax.xml.transform.Result result)
          Helper method that will apply a xslt transform to a given xml source and write the results to a Result object
 boolean validate()
          Executes the schematron validation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xsd

protected java.lang.String xsd

SKELETON15

protected static final java.lang.String SKELETON15
See Also:
Constant Field Values

validationLogger

protected AbstractValidationOutput validationLogger

xml

protected javax.xml.transform.Source xml
Constructor Detail

SchematronValidatorImpl

public SchematronValidatorImpl()
Method Detail

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

setXML

public void setXML(java.lang.Object xml)
TODO: should pass xml instance as an attribute

Specified by:
setXML in interface ISchematronValidation

validate

public boolean validate()
Executes the schematron validation

Specified by:
validate in interface IValidator
Returns:
true if successful; false otherwise

transform

protected void transform(javax.xml.transform.Source source,
                         javax.xml.transform.Source xslt,
                         javax.xml.transform.Result result)
Helper method that will apply a xslt transform to a given xml source and write the results to a Result object

Parameters:
source - xml source
xslt - xslt transform that will be applied to the source
result - stores the resulting transform

parseMessageStream

protected void parseMessageStream(java.lang.String messageStream)
Helper method that logs the schematron message

Parameters:
messageStream - schematron message

addValidationListener

public void addValidationListener(IValidationListener listener)
Specified by:
addValidationListener in interface IValidator

COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification