org.openanzo.glitter.query.validator
Class WellDesignedOptionalsValidator

java.lang.Object
  extended by org.openanzo.glitter.query.validator.WellDesignedOptionalsValidator
All Implemented Interfaces:
QueryValidator

public class WellDesignedOptionalsValidator
extends java.lang.Object
implements QueryValidator

Rejects queries that contain an OPTIONAL that contains a variable that is not in the required part of the OPTIONAL but does appear some other place in the query.

Author:
lee

Constructor Summary
WellDesignedOptionalsValidator()
           
 
Method Summary
 java.lang.String getValidationError()
          This method's return value is only valid after a call to validateQuery on the same instance returns false.
 java.lang.String getValidatorDescription()
          Returns a human-readable description of what this QueryValidator checks for.
 boolean validateQuery(GraphPattern query)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WellDesignedOptionalsValidator

public WellDesignedOptionalsValidator()
Method Detail

getValidationError

public java.lang.String getValidationError()
Description copied from interface: QueryValidator
This method's return value is only valid after a call to validateQuery on the same instance returns false.

Specified by:
getValidationError in interface QueryValidator
Returns:
The reason for a failure to validate.

getValidatorDescription

public java.lang.String getValidatorDescription()
Description copied from interface: QueryValidator
Returns a human-readable description of what this QueryValidator checks for.

Specified by:
getValidatorDescription in interface QueryValidator
Returns:
A human-readable description of what this QueryValidator checks for.

validateQuery

public boolean validateQuery(GraphPattern query)
Specified by:
validateQuery in interface QueryValidator
Parameters:
query - The query pattern of the query to be validated
Returns:
True, if the query is OK; False, otherwise. If false, then getValidationError() may be called to return the reason for the failure to validate.


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.