uk.org.ogsadai.activity
Class ActivityPropertyDocumentValidator

java.lang.Object
  |
  +--uk.org.ogsadai.common.DocumentValidator
        |
        +--uk.org.ogsadai.activity.ActivityPropertyDocumentValidator

public class ActivityPropertyDocumentValidator
extends DocumentValidator

This DocumentValidator scans through the activity elements contained in an activity configuration document looking for activities that make use of property sub-elements. These are then validated to make sure that there are no duplicated property keys within an activity.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
 
Fields inherited from class uk.org.ogsadai.common.DocumentValidator
 
Constructor Summary
ActivityPropertyDocumentValidator()
           
 
Method Summary
protected  void performValidation(org.w3c.dom.Document document)
          Validates the specified document and throws a DocumentValidationException with a desctiptive error message if the document is invalid.
private  void validatePropertyElements(java.lang.String name, org.w3c.dom.NodeList properties)
          Checks there are no duplicate property keys.
 
Methods inherited from class uk.org.ogsadai.common.DocumentValidator
setSuccessor, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values
Constructor Detail

ActivityPropertyDocumentValidator

public ActivityPropertyDocumentValidator()
Method Detail

performValidation

protected void performValidation(org.w3c.dom.Document document)
                          throws DocumentValidationException
Description copied from class: DocumentValidator
Validates the specified document and throws a DocumentValidationException with a desctiptive error message if the document is invalid.

Specified by:
performValidation in class DocumentValidator
Parameters:
document - Document to validate.
Throws:
DocumentValidationException - if the document is invalid.

validatePropertyElements

private void validatePropertyElements(java.lang.String name,
                                      org.w3c.dom.NodeList properties)
                               throws DocumentValidationException
Checks there are no duplicate property keys. Remember that there is no need to check for the required attributes, "key" and "value" because they will already have been picked up by schema-validation of the activity config document.

Parameters:
name - name of the actvity
properties - NodeList containing property Element objects
Throws:
DocumentValidationException - if there are duplicate property keys