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

org.eclipse.cosmos.rm.validation.internal.smlvalidators
Class TargetValidator

java.lang.Object
  extended by org.eclipse.cosmos.rm.validation.internal.core.AbstractValidator
      extended by org.eclipse.cosmos.rm.validation.internal.core.AbstractSMLValidator
          extended by org.eclipse.cosmos.rm.validation.internal.smlvalidators.TargetValidator
All Implemented Interfaces:
ISMLValidator, IValidator

public class TargetValidator
extends AbstractSMLValidator

This class is used to validate the sml:targetElement, sml:targetRequired and sml:targetType sml extensions.


Field Summary
protected  java.util.Map documentDOMBuilderElems
           
protected  ElementTypeMap elementTypeMapBuilderStructure
           
protected  java.util.Map inheritance
           
protected  java.util.Map substitutionElementElems
           
protected  java.util.Map targetInstanceBuilderStructure
           
protected  java.util.Map targetSchemaBuilderStructure
           
protected  IValidationOutput validationLogger
           
 
Fields inherited from interface org.eclipse.cosmos.rm.validation.internal.core.ISMLValidator
SCOPE_ACYCLIC, SCOPE_GRP_ALL, SCOPE_GRP_ID_CONSTRAINTS, SCOPE_GRP_REF_CONSTRAINTS, SCOPE_KEY, SCOPE_KEY_REF, SCOPE_TARGET_ELEMENT, SCOPE_TARGET_TYPE, SCOPE_UNIQUE
 
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
TargetValidator()
           
 
Method Summary
protected  boolean compareElementInstance(java.lang.Object elem1, java.lang.Object elem2)
           
 void initialize(java.util.Map validationAttribute)
          Read in common attributes that are shared between multiple validators.
protected static boolean isURIValid(java.lang.String uri)
          Make sure that the uri can be resolved.
 boolean validate()
          Performs the validation and returns true if successful and false otherwise.
protected  boolean validateTargetElement(TargetElementNode targetElementNode, TargetSchemaNode targetSchemaNode)
           
protected  boolean validateTargetInstance()
           
protected  boolean validateTargetType(TargetElementNode targetElementNode, TargetSchemaNode targetSchemaNode)
           
 
Methods inherited from class org.eclipse.cosmos.rm.validation.internal.core.AbstractSMLValidator
getScope, setScope, shouldAbortOnError
 
Methods inherited from class org.eclipse.cosmos.rm.validation.internal.core.AbstractValidator
addValidationListener, fireValidationEventOccurred, getValidationOutput, setValidationOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.cosmos.rm.validation.internal.core.IValidator
addValidationListener
 

Field Detail

targetSchemaBuilderStructure

protected java.util.Map targetSchemaBuilderStructure

targetInstanceBuilderStructure

protected java.util.Map targetInstanceBuilderStructure

documentDOMBuilderElems

protected java.util.Map documentDOMBuilderElems

substitutionElementElems

protected java.util.Map substitutionElementElems

elementTypeMapBuilderStructure

protected ElementTypeMap elementTypeMapBuilderStructure

inheritance

protected java.util.Map inheritance

validationLogger

protected IValidationOutput validationLogger
Constructor Detail

TargetValidator

public TargetValidator()
Method Detail

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

validateTargetInstance

protected boolean validateTargetInstance()

validateTargetType

protected boolean validateTargetType(TargetElementNode targetElementNode,
                                     TargetSchemaNode targetSchemaNode)

validateTargetElement

protected boolean validateTargetElement(TargetElementNode targetElementNode,
                                        TargetSchemaNode targetSchemaNode)

compareElementInstance

protected boolean compareElementInstance(java.lang.Object elem1,
                                         java.lang.Object elem2)

isURIValid

protected static boolean isURIValid(java.lang.String uri)
Make sure that the uri can be resolved.

Parameters:
uri - the uri string to resolve
Returns:
true if the uri can be resolved otherwise false.

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