Class ElementValidator
- java.lang.Object
-
- gov.nasa.pds.tools.label.validate.ElementValidator
-
public class ElementValidator extends Object
This class will validate an element value or set of values against an Dictionary.- Version:
- $Revision$
- Author:
- pramirez, jagander
-
-
Constructor Summary
Constructors Constructor Description ElementValidator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
validate(AttributeStatement attribute, Label label, Dictionary dictionary)
static boolean
validate(AttributeStatement attribute, Label label, Dictionary dictionary, ElementDefinition definition)
static boolean
validate(AttributeStatement attribute, Label label, Dictionary dictionary, String objectContext)
Checks to see whether anAttributeStatement
is correct.
-
-
-
Method Detail
-
validate
public static boolean validate(AttributeStatement attribute, Label label, Dictionary dictionary, ElementDefinition definition) throws UnsupportedTypeException
- Throws:
UnsupportedTypeException
-
validate
public static boolean validate(AttributeStatement attribute, Label label, Dictionary dictionary, String objectContext) throws DefinitionNotFoundException, UnsupportedTypeException
Checks to see whether anAttributeStatement
is correct. Will look up the definition in the given dictionary. An object context may be supplied as elements can have aliases that are appropriate within an object. Set objectContext to null if there if the lookup should be performed without care to the surrounding object.- Parameters:
dictionary
- where to look up the elementobjectContext
- enclosing the element to be looked upattribute
- statement to be validated- Returns:
- flag indicating whether or not the statement was valid against the definition found
- Throws:
DefinitionNotFoundException
- if definition for element is not foundUnsupportedTypeException
- if type of element is not supported
-
validate
public static boolean validate(AttributeStatement attribute, Label label, Dictionary dictionary) throws DefinitionNotFoundException, UnsupportedTypeException
-
-