gov.nasa.pds.tools.label.validate
Class ElementValidator

java.lang.Object
  extended by gov.nasa.pds.tools.label.validate.ElementValidator
All Implemented Interfaces:
DictionaryTokens

public class ElementValidator
extends java.lang.Object
implements DictionaryTokens

This class will validate an element value or set of values against an ElementDefinition.

Version:
$Revision: 3361 $
Author:
pramirez

Field Summary
 
Fields inherited from interface gov.nasa.pds.tools.dict.DictionaryTokens
ALIAS_LIST, DATA_TYPE, DEFINITION, DESCRIPTION, ELEMENT_ALIASES, ELEMENT_DEFINITION, ELEMENT_IDENT_LENGTH, GENERIC_GROUP, GENERIC_OBJECT, MAX_LENGTH, MAXIMUM, MIN_LENGTH, MINIMUM, NAME, NAMESPACE_LENGTH, NOT_APPLICABLE, OBJECT_ALIASES, OBJECT_TYPE, OBJECT_TYPE_GENERIC, OBJECT_TYPE_GENERIC_GROUP, OBJECT_TYPE_SPECIFIC, OBJECT_TYPE_SPECIFIC_GROUP, OPTIONAL_ELEMENTS, OPTIONAL_OBJECTS, REQUIRED_ELEMENTS, REQUIRED_OBJECTS, SPECIFIC_GROUP, SPECIFIC_OBJECT, STATUS_TYPE, UNIT_LIST, UNIT_SEQUENCE, UNITS, VALUE_TYPE, VALUE_TYPE_STATIC, VALUE_TYPE_SUGGESTED, VALUES
 
Constructor Summary
ElementValidator()
           
 
Method Summary
static boolean isValid(Dictionary dictionary, AttributeStatement attribute)
           
static boolean isValid(Dictionary dictionary, AttributeStatement attribute, ValidationListener listener)
           
static boolean isValid(Dictionary dictionary, java.lang.String objectContext, AttributeStatement attribute)
          Checks to see whether an AttributeStatement is correct.
static boolean isValid(Dictionary dictionary, java.lang.String objectContext, AttributeStatement attribute, ValidationListener listener)
           
static boolean isValid(ElementDefinition definition, AttributeStatement attribute)
           
static boolean isValid(ElementDefinition definition, AttributeStatement attribute, ValidationListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementValidator

public ElementValidator()
Method Detail

isValid

public static boolean isValid(ElementDefinition definition,
                              AttributeStatement attribute)
                       throws UnsupportedTypeException
Throws:
UnsupportedTypeException

isValid

public static boolean isValid(ElementDefinition definition,
                              AttributeStatement attribute,
                              ValidationListener listener)

isValid

public static boolean isValid(Dictionary dictionary,
                              java.lang.String objectContext,
                              AttributeStatement attribute)
Checks to see whether an AttributeStatement 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 element
objectContext - enclosing the element to be looked up
attribute - 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 found
UnsupportedTypeException - if type of element is not supported

isValid

public static boolean isValid(Dictionary dictionary,
                              java.lang.String objectContext,
                              AttributeStatement attribute,
                              ValidationListener listener)

isValid

public static boolean isValid(Dictionary dictionary,
                              AttributeStatement attribute)

isValid

public static boolean isValid(Dictionary dictionary,
                              AttributeStatement attribute,
                              ValidationListener listener)


Copyright © 2005-2008 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.