Package gov.nasa.pds.tools.dict.parser
Class DictionaryParser
- java.lang.Object
-
- gov.nasa.pds.tools.dict.parser.DictionaryParser
-
public class DictionaryParser extends Object
This class provides the means to parse a PDS compliant data dictionary. TheDictionary
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$
- Author:
- pramirez, jagander
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DictionaryParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
static Dictionary
parse(File file)
static Dictionary
parse(File file, boolean aliasing)
static Dictionary
parse(File file, boolean aliasing, boolean storeProblems)
static Dictionary
parse(InputStream input, Dictionary dictionary, boolean aliasing, boolean storeProblems)
Parses aURL
that is compliant with the PDS Data Dictionary document and formulates aDictionary
with a flag to indicated whether aliases should be read in.static Dictionary
parse(URL url)
Parses aURL
that is compliant with the PDS Data Dictionary document and formulates aDictionary
with aliases turned off.static Dictionary
parse(URL url, boolean aliasing)
static Dictionary
parse(URL url, boolean aliasing, boolean storeProblems)
-
-
-
Field Detail
-
OBJECT_TYPE_ID
protected static final DictIdentifier OBJECT_TYPE_ID
-
DESCRIPTION_ID
protected static final DictIdentifier DESCRIPTION_ID
-
STATUS_TYPE_ID
protected static final DictIdentifier STATUS_TYPE_ID
-
REQUIRED_OBJECTS_ID
protected static final DictIdentifier REQUIRED_OBJECTS_ID
-
OPTIONAL_OBJECTS_ID
protected static final DictIdentifier OPTIONAL_OBJECTS_ID
-
REQUIRED_ELEMENTS_ID
protected static final DictIdentifier REQUIRED_ELEMENTS_ID
-
OPTIONAL_ELEMENTS_ID
protected static final DictIdentifier OPTIONAL_ELEMENTS_ID
-
NAME_ID
protected static final DictIdentifier NAME_ID
-
DATA_TYPE_ID
protected static final DictIdentifier DATA_TYPE_ID
-
UNITS_ID
protected static final DictIdentifier UNITS_ID
-
MIN_LENGTH_ID
protected static final DictIdentifier MIN_LENGTH_ID
-
MAX_LENGTH_ID
protected static final DictIdentifier MAX_LENGTH_ID
-
VALUES_ID
protected static final DictIdentifier VALUES_ID
-
VALUE_TYPE_ID
protected static final DictIdentifier VALUE_TYPE_ID
-
MINIMUM_ID
protected static final DictIdentifier MINIMUM_ID
-
MAXIMUM_ID
protected static final DictIdentifier MAXIMUM_ID
-
UNIT_SEQUENCE_ID
protected static final DictIdentifier UNIT_SEQUENCE_ID
-
OBJECT_ALIASES_ID
protected static final DictIdentifier OBJECT_ALIASES_ID
-
ELEMENT_ALIASES_ID
protected static final DictIdentifier ELEMENT_ALIASES_ID
-
ALIAS_LIST_ID
protected static final DictIdentifier ALIAS_LIST_ID
-
UNIT_LIST_ID
protected static final DictIdentifier UNIT_LIST_ID
-
GENERIC_OBJECT_ID
protected static final DictIdentifier GENERIC_OBJECT_ID
-
SPECIFIC_OBJECT_ID
protected static final DictIdentifier SPECIFIC_OBJECT_ID
-
ELEMENT_DEFINITION_ID
protected static final DictIdentifier ELEMENT_DEFINITION_ID
-
-
Method Detail
-
parse
public static Dictionary parse(URL url) throws LabelParserException, IOException
Parses aURL
that is compliant with the PDS Data Dictionary document and formulates aDictionary
with aliases turned off.- Parameters:
url
- points to the location of the dictionary- Returns:
- a data dictionary with element, group, and object definitions
- Throws:
LabelParserException
- thrown when dictionary can not be parsed correctlyIOException
- thrown when dictionary can not be accessed
-
parse
public static Dictionary parse(URL url, boolean aliasing) throws LabelParserException, IOException
- Throws:
LabelParserException
IOException
-
parse
public static Dictionary parse(URL url, boolean aliasing, boolean storeProblems) throws LabelParserException, IOException
- Throws:
LabelParserException
IOException
-
parse
public static Dictionary parse(File file) throws LabelParserException, IOException
- Throws:
LabelParserException
IOException
-
parse
public static Dictionary parse(File file, boolean aliasing) throws LabelParserException, IOException
- Throws:
LabelParserException
IOException
-
parse
public static Dictionary parse(File file, boolean aliasing, boolean storeProblems) throws LabelParserException, IOException
- Throws:
LabelParserException
IOException
-
parse
public static Dictionary parse(InputStream input, Dictionary dictionary, boolean aliasing, boolean storeProblems) throws LabelParserException, IOException
Parses aURL
that is compliant with the PDS Data Dictionary document and formulates aDictionary
with a flag to indicated whether aliases should be read in.- Parameters:
input
- input stream to dictionaryaliasing
- indicates if aliases should be read in- Returns:
- a data dictionary with element, group, and object definitions
- Throws:
LabelParserException
- thrown when dictionary can not be parsed correctlyIOException
- thrown when dictionary can not be accessed
-
-