uk.ac.starlink.hdx
Interface ElementValidator


public interface ElementValidator

An object which provides validation services for a registered HdxResourceType. Implementations of this interface are linked with types using the method setElementValidator on the object representing the type.


Method Summary
 boolean validateElement(Element el)
          Checks that an element is a valid instance of a type.
 

Method Detail

validateElement

boolean validateElement(Element el)
Checks that an element is a valid instance of a type.

The validator should not assume that the element it is validating has been constructed by an authoritative source (such as the package or class which implements this interface). In particular, it should not react to invalid elements by throwing unchecked exceptions or using assertions. That is, this method should be usable by code which is constructing its own DOM representing the type in question.

Returns:
true if the element is of the type which this validator checks; the element is valid; and each of its subelements is valid.


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.