gov.nasa.pds.tools.label.validate
Class ElementValidator
java.lang.Object
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: 2631 $
- Author:
- pramirez
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, OBJECT_ALIASES, OBJECT_TYPE, OBJECT_TYPE_GENERIC_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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ElementValidator
public ElementValidator()
isValid
public static boolean isValid(ElementDefinition definition,
AttributeStatement attribute)
throws UnsupportedTypeException
- Throws:
UnsupportedTypeException
isValid
public static boolean isValid(Dictionary dictionary,
java.lang.String objectContext,
AttributeStatement attribute)
throws DefinitionNotFoundException,
UnsupportedTypeException
- 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 elementobjectContext
- enclosing the element to be looked upattribute
- statement to be validated
- Returns:
- flag indicting 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,
AttributeStatement attribute)
throws DefinitionNotFoundException,
UnsupportedTypeException
- Throws:
DefinitionNotFoundException
UnsupportedTypeException
Copyright © 2005-2007 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.