gov.nasa.pds.tools.dict.parser
Class DictionaryParser
java.lang.Object
gov.nasa.pds.tools.dict.parser.DictionaryParser
- All Implemented Interfaces:
- DictionaryTokens, ODLTokenTypes, Status
public class DictionaryParser
- extends java.lang.Object
- implements ODLTokenTypes, DictionaryTokens, Status
This class provides the means to parse a PDS compliant data dictionary.
The Dictionary
created can be used for validation purposes or just
to examine the contents programmatically. To parse a dictionary use the following:
Dictionary dictionary = DictionaryParser.parse(new URL(""));
If you wanted to turn of aliases the alternative parse method could be used:
Dictionary dictionary = DictionaryParser.parse(new URL(""), false);
- Version:
- $Revision: 2894 $
- Author:
- pramirez
Fields inherited from interface gov.nasa.pds.tools.label.antlr.ODLTokenTypes |
BASED_INTEGER, COMMENT, DATE, DATETIME, DAY, DIGIT, DIGITS, DOY, ELEMENT_IDENT, END, END_GROUP, END_OBJECT, EOF, EOL, EQUALS, EXP_OP, EXTENDED_DIGIT, FRACTION, HOUR, IDENTIFIER, IGNORE, INTEGER, LETTER, LIST_SEPARATOR, LITERAL_GROUP, LITERAL_OBJECT, MINUTE, MONTH, MULT_OP, NULL_TREE_LOOKAHEAD, NUMBER_OR_DATETIME, POINT_OPERATOR, QUOTED, REAL, SECOND, SEQUENCE_CLOSING, SEQUENCE_OPENING, SET_CLOSING, SET_OPENING, SIGN, SPECIALCHAR, SYMBOL, TIME, UNITS, UNITS_FACTOR, WS, YEAR |
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 |
Method Summary |
static void |
main(java.lang.String[] args)
|
static Dictionary |
parse(java.net.URL url)
Parses a URL that is compliant with the PDS Data Dictionary document
and formulates a Dictionary with aliases turned off. |
static Dictionary |
parse(java.net.URL url,
boolean aliasing)
Parses a URL that is compliant with the PDS Data Dictionary document
and formulates a Dictionary with a flag to indicated whether aliases
should be read in. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DictionaryParser
public DictionaryParser()
parse
public static Dictionary parse(java.net.URL url)
throws ParseException,
java.io.IOException
- Parses a
URL
that is compliant with the PDS Data Dictionary document
and formulates a Dictionary
with aliases turned off.
- Parameters:
url
- points to the location of the dictionary
- Returns:
- a data dictionary with element, group, and object definitions
- Throws:
ParseException
- thrown when dictionary can not be parsed correctly
java.io.IOException
- thrown when dictionary can not be accessed
parse
public static Dictionary parse(java.net.URL url,
boolean aliasing)
throws ParseException,
java.io.IOException
- Parses a
URL
that is compliant with the PDS Data Dictionary document
and formulates a Dictionary
with a flag to indicated whether aliases
should be read in.
- Parameters:
url
- points to the location of the dictionaryaliasing
- indicates if aliases should be read in
- Returns:
- a data dictionary with element, group, and object definitions
- Throws:
ParseException
- thrown when dictionary can not be parsed correctly
java.io.IOException
- thrown when dictionary can not be accessed
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
Copyright © 2005-2008 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.