org.deri.wsmo4j.validator
Class WsmlValidatorImpl

java.lang.Object
  extended by org.deri.wsmo4j.validator.WsmlValidatorImpl
All Implemented Interfaces:
org.wsmo.validator.Validator, org.wsmo.validator.WsmlValidator

public class WsmlValidatorImpl
extends Object
implements org.wsmo.validator.WsmlValidator

Interface or class description

  Created on Aug 18, 2005
  Committed by $Author: morcen $
  $Source$,
 

Version:
$Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
Author:
Holger Lausen (holger.lausen@deri.org), nathalie.steinmetz@deri.org
See Also:
WsmlValidator

Field Summary
 org.wsmo.factory.LogicalExpressionFactory leFactory
           
 boolean validateImports
           
 HashSet<org.wsmo.common.Identifier> visitedOntologies
           
 
Fields inherited from interface org.wsmo.validator.WsmlValidator
VALIDATE_IMPORTS
 
Constructor Summary
WsmlValidatorImpl()
           
WsmlValidatorImpl(Map properties)
          The WsmlValidator is initialised based on the supplied preferences.
 
Method Summary
 String determineVariant(org.omwg.logicalexpression.LogicalExpression logExpr, List<org.wsmo.validator.ValidationError> errorMessages, List<org.wsmo.validator.ValidationWarning> warningMessages)
          This method checks for which wsml variant the given logical expression is valid.
 String determineVariant(org.wsmo.common.TopEntity te, List<org.wsmo.validator.ValidationError> errorMessages, List<org.wsmo.validator.ValidationWarning> warningMessages)
          This method checks for which wsml variant the given TopEntity is valid.
 boolean isValid(org.omwg.logicalexpression.LogicalExpression logExpr, String variant, List<org.wsmo.validator.ValidationError> errorMessages, List<org.wsmo.validator.ValidationWarning> warningMessages)
          The logical expression is validated against the given variant.
 boolean isValid(org.wsmo.common.TopEntity te, List<org.wsmo.validator.ValidationError> errorMessages, List<org.wsmo.validator.ValidationWarning> warningMessages)
          When no variant is specified in the TopEntity, the TopEntity is checked for valid wsml-full, otherwise it is validated against the variant stated in the TopEntity.
 boolean isValid(org.wsmo.common.TopEntity te, String variant, List<org.wsmo.validator.ValidationError> errorMessages, List<org.wsmo.validator.ValidationWarning> warningMessages)
          The TopEntity is validated against the given variant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leFactory

public org.wsmo.factory.LogicalExpressionFactory leFactory

validateImports

public boolean validateImports

visitedOntologies

public HashSet<org.wsmo.common.Identifier> visitedOntologies
Constructor Detail

WsmlValidatorImpl

public WsmlValidatorImpl()

WsmlValidatorImpl

public WsmlValidatorImpl(Map properties)
The WsmlValidator is initialised based on the supplied preferences. The properties map can contain the factories to be used as Strings or as instances. If a factory to use is only indicated as String, the constructor needs to create an instance of this given factory.

Parameters:
properties - the preferences for the validator.
Method Detail

isValid

public boolean isValid(org.wsmo.common.TopEntity te,
                       List<org.wsmo.validator.ValidationError> errorMessages,
                       List<org.wsmo.validator.ValidationWarning> warningMessages)
When no variant is specified in the TopEntity, the TopEntity is checked for valid wsml-full, otherwise it is validated against the variant stated in the TopEntity.

Specified by:
isValid in interface org.wsmo.validator.Validator
Parameters:
te - TopEntity
errorMessages - list that will be filled with error messages dound during validation
warningMessages - list that will be filled with warning messages found during validation
Returns:
true/false, if the TopEntity is valid to the TopEntity's variant or not
See Also:
Validator.isValid(org.wsmo.common.TopEntity, java.util.List, java.util.List)

isValid

public boolean isValid(org.wsmo.common.TopEntity te,
                       String variant,
                       List<org.wsmo.validator.ValidationError> errorMessages,
                       List<org.wsmo.validator.ValidationWarning> warningMessages)
The TopEntity is validated against the given variant.

Specified by:
isValid in interface org.wsmo.validator.WsmlValidator
Parameters:
te - TopEntity to be validated.
variant - to be validated against (String representation of the corresponging IRI e.g. "http://www.wsmo.org/wsml/wsml-syntax/wsml-core")
errorMessages - list that will be filled with error messages found during validation
warningMessages - list that will be filled with warning messages found during validation
Returns:
true/false, if the TopEntity is valid with respect to the variant or not
See Also:
WsmlValidator.isValid(org.wsmo.common.TopEntity, java.lang.String, java.util.List, java.util.List), ValidationError, ValidationWarning

isValid

public boolean isValid(org.omwg.logicalexpression.LogicalExpression logExpr,
                       String variant,
                       List<org.wsmo.validator.ValidationError> errorMessages,
                       List<org.wsmo.validator.ValidationWarning> warningMessages)
The logical expression is validated against the given variant.

Specified by:
isValid in interface org.wsmo.validator.WsmlValidator
Parameters:
logExpr - LogicalExpression to be checked
variant - to be validated against (String representation of the corresponging IRI e.g. "http://www.wsmo.org/wsml/wsml-syntax/wsml-core")
errorMessages - list that will be filled with error messages dound during validation
warningMessages - list that will be filled with warning messages found during validation
Returns:
true/false, if the LogicalExpression is valid to the given variant or not
See Also:
org.wsmo.validator.Validator#isValid(LogicalExpression, String, java.util.List, java.util.List)

determineVariant

public String determineVariant(org.wsmo.common.TopEntity te,
                               List<org.wsmo.validator.ValidationError> errorMessages,
                               List<org.wsmo.validator.ValidationWarning> warningMessages)
This method checks for which wsml variant the given TopEntity is valid.

Specified by:
determineVariant in interface org.wsmo.validator.WsmlValidator
Parameters:
te - TopEntity to be checked
Returns:
String variant, the IRI of the variant that te is in, null if not valid wsml full
See Also:
WsmlValidator.determineVariant(org.wsmo.common.TopEntity, java.util.List, java.util.List)

determineVariant

public String determineVariant(org.omwg.logicalexpression.LogicalExpression logExpr,
                               List<org.wsmo.validator.ValidationError> errorMessages,
                               List<org.wsmo.validator.ValidationWarning> warningMessages)
This method checks for which wsml variant the given logical expression is valid.

Specified by:
determineVariant in interface org.wsmo.validator.WsmlValidator
Parameters:
logExpr - LogicalExpression to be checked
Returns:
String variant, the IRI of the variant that logExpr is in, null if not valid wsml full
See Also:
WsmlValidator.determineVariant(LogicalExpression, java.util.List, java.util.List)


Copyright © 2004-2008 Ontotext Lab.. All Rights Reserved.