public class Dictionary extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static Pattern |
VERSION_REGEX |
Constructor and Description |
---|
Dictionary() |
Dictionary(File dictionaryFile) |
Dictionary(URI dictionaryURI) |
Modifier and Type | Method and Description |
---|---|
void |
addDefinition(Definition definition)
Adds a definition to this dictionary.
|
void |
addDefinitions(Collection<Definition> defs)
Adds a list of definitions to this dictionary.
|
void |
addProblem(LabelParserException exception) |
void |
addProblems(List<LabelParserException> exceptions) |
void |
clearProblems() |
boolean |
containsDefinition(DictIdentifier identifier)
Tests to see whether or not a definition exists
|
boolean |
containsElementDefinition(DictIdentifier identifier)
Tests to see whether or not an element is defined
|
boolean |
containsElementDefinition(String objectContext,
DictIdentifier identifier) |
boolean |
containsGroupDefinition(DictIdentifier identifier)
Tests to see whether or not a group is defined
|
boolean |
containsObjectDefinition(DictIdentifier identifier)
Tests to see whether or not an object is defined
|
GroupDefinition |
findGroupClassDefinition(DictIdentifier identifier)
Retrieves the class definition for a group with the given identifier.
|
ObjectDefinition |
findObjectClassDefinition(DictIdentifier identifier)
Retrieves the class definition for an object with the given identifier.
|
Definition |
getDefinition(DictIdentifier identifier)
Retrieves the definition from the dictionary or null if not found
|
protected Map<DictIdentifier,Definition> |
getDefinitions()
Retrieves the map of definitions
|
File |
getDictionaryFile() |
URI |
getDictionaryURI() |
ElementDefinition |
getElementDefinition(DictIdentifier identifier)
Retrieves the element definition from the dictionary or null if not found.
|
ElementDefinition |
getElementDefinition(String objectContext,
DictIdentifier identifier) |
GroupDefinition |
getGroupDefinition(DictIdentifier identifier)
Retrieves the group definition from the dictionary or null if not found
|
String |
getInformation()
Return the dictionary's descriptive information.
|
List<SimpleDictionaryChange> |
getMergeChanges() |
ObjectDefinition |
getObjectDefinition(DictIdentifier identifier)
Retrieves the object definition from the dictionary or null if not found
|
List<LabelParserException> |
getProblems() |
String |
getSourceString() |
Map<String,String> |
getUnits() |
String |
getVersion() |
void |
merge(Dictionary dictionary)
Merges the definitions in the dictionaries
|
void |
setInformation(String information)
Sets the description information for a dictionary.
|
void |
setUnits(Map<String,String> units) |
public static final Pattern VERSION_REGEX
public Dictionary()
public Dictionary(URI dictionaryURI)
public Dictionary(File dictionaryFile)
public URI getDictionaryURI()
public File getDictionaryFile()
public String getSourceString()
public String getVersion()
public void merge(Dictionary dictionary)
dictionary
- to be merged into this dictionary. dictionary merged in will
override values in this dictionary if scalars or be added if listspublic boolean containsDefinition(DictIdentifier identifier)
identifier
- of the definitionpublic boolean containsObjectDefinition(DictIdentifier identifier)
identifier
- of the objectpublic boolean containsGroupDefinition(DictIdentifier identifier)
identifier
- of the the grouppublic boolean containsElementDefinition(DictIdentifier identifier)
identifier
- of the elementpublic boolean containsElementDefinition(String objectContext, DictIdentifier identifier)
public Definition getDefinition(DictIdentifier identifier)
identifier
- of the definitionpublic ObjectDefinition getObjectDefinition(DictIdentifier identifier)
identifier
- of the definitionpublic GroupDefinition getGroupDefinition(DictIdentifier identifier)
identifier
- of the definitionpublic ElementDefinition getElementDefinition(DictIdentifier identifier)
identifier
- of the definitionpublic ElementDefinition getElementDefinition(String objectContext, DictIdentifier identifier)
public void addDefinition(Definition definition)
definition
- to be added to the dictionarypublic void setInformation(String information)
information
- public String getInformation()
public void addDefinitions(Collection<Definition> defs)
defs
- to be added to the dictionarypublic ObjectDefinition findObjectClassDefinition(DictIdentifier identifier)
identifier
- to lookup up class ofObjectDefinition
of class that will constrain object with
given identifier. Returns null if not found.protected Map<DictIdentifier,Definition> getDefinitions()
public GroupDefinition findGroupClassDefinition(DictIdentifier identifier)
identifier
- to lookup up class ofGroupDefinition
of class that will constrain object with
given identifier. Returns null if not found.public List<SimpleDictionaryChange> getMergeChanges()
public void addProblem(LabelParserException exception)
public void addProblems(List<LabelParserException> exceptions)
public List<LabelParserException> getProblems()
public void clearProblems()
Copyright © 2005–2015 Planetary Data System. All rights reserved.