gov.nasa.pds.ltdt.gui.util
Class DictionaryUtility

java.lang.Object
  extended by gov.nasa.pds.ltdt.gui.util.DictionaryUtility

public class DictionaryUtility
extends java.lang.Object

Utility class to store data dictionary related handling.

Author:
jwang

Constructor Summary
DictionaryUtility()
           
 
Method Summary
static java.util.ArrayList buildKeywordDefinitionList(gov.nasa.pds.tools.dict.Definition kwdDef)
          Building a new object/element definition
static java.lang.String[] getDictionaryNameArray(java.lang.String dict)
          Splits a concatenated string of dictionary names into an array of individual names.
static java.util.ArrayList getDictionaryNameList(java.lang.String dict)
          Splits a concatenated string of dictionary names into a list of individual names.
static java.lang.String getDictionaryNameString(java.util.List dictList)
          Input a list of dictionary names, combined the non-null names into a text string with ':' as delimiter
static java.lang.String list2editblock(MainWindow window, java.lang.String keyword, java.lang.StringBuffer message)
          generates a block of structured text based on 'keyword' if the keyword is an object, add the start and end of an object block and required elements within the block.
static gov.nasa.pds.tools.dict.Dictionary MergeDictionary(gov.nasa.pds.tools.dict.Dictionary originalDictionary, gov.nasa.pds.tools.dict.Dictionary newDictionary)
          Merge a new dictionary into an existing one
static gov.nasa.pds.tools.dict.Dictionary MergeDictionary(gov.nasa.pds.tools.dict.Dictionary originalDictionary, java.net.URL location)
          Merge a dictionary at a location into an existing one
static gov.nasa.pds.tools.dict.Dictionary MergeDictionaryList(gov.nasa.pds.tools.dict.Dictionary originalDictionary, java.util.List dictList)
          Merge a list of dictionary into the original one
static void populateDictionaryFullListingPane(MainWindow window)
          Based on a keyword map to populate the full keyword listing window
static void setStatusType(gov.nasa.pds.tools.dict.Dictionary dictionary, java.lang.String statusType)
          Set status type to WDDSTATUSTYPE to each definition within a dictionary
static java.lang.String swap(java.lang.String in)
          Special formatting.
static void writeWDD(MainWindow window, java.lang.String wddFileName)
          Output WDD to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictionaryUtility

public DictionaryUtility()
Method Detail

getDictionaryNameArray

public static java.lang.String[] getDictionaryNameArray(java.lang.String dict)
Splits a concatenated string of dictionary names into an array of individual names.

Parameters:
dict - A string of dictionary names delimited by ';'
Returns:
A String array of dictionary names, returns null if no dictionary info received

getDictionaryNameList

public static java.util.ArrayList getDictionaryNameList(java.lang.String dict)
Splits a concatenated string of dictionary names into a list of individual names.

Parameters:
dict -
Returns:
An array of individual dictionary names

getDictionaryNameString

public static java.lang.String getDictionaryNameString(java.util.List dictList)
                                                throws java.io.IOException
Input a list of dictionary names, combined the non-null names into a text string with ':' as delimiter

Parameters:
dictList -
Returns:
A string of dictionary names concatenated by ":"
Throws:
java.io.IOException

swap

public static java.lang.String swap(java.lang.String in)
Special formatting. Swap strings on either side of : It's assumed that the input string has the input format : or :-- The output would be : or :--

Parameters:
in - Input string
Returns:
Reformatted string

populateDictionaryFullListingPane

public static void populateDictionaryFullListingPane(MainWindow window)
Based on a keyword map to populate the full keyword listing window

Parameters:
window -

buildKeywordDefinitionList

public static java.util.ArrayList buildKeywordDefinitionList(gov.nasa.pds.tools.dict.Definition kwdDef)
Building a new object/element definition

Parameters:
kwdDef - An instance of a definition
Returns:
List of attributes for a definition

list2editblock

public static java.lang.String list2editblock(MainWindow window,
                                              java.lang.String keyword,
                                              java.lang.StringBuffer message)
generates a block of structured text based on 'keyword' if the keyword is an object, add the start and end of an object block and required elements within the block. e.g. OBJECT = END_OBJECT = if the keyword is an element, return it with "=" appended with a substitution variable e.g. = ${NEW} An empty string is returned if the keyword is not found.

Parameters:
window -
keyword -
Returns:
keyword text block

MergeDictionaryList

public static gov.nasa.pds.tools.dict.Dictionary MergeDictionaryList(gov.nasa.pds.tools.dict.Dictionary originalDictionary,
                                                                     java.util.List dictList)
                                                              throws java.net.MalformedURLException,
                                                                     gov.nasa.pds.tools.label.parser.ParseException,
                                                                     java.io.IOException
Merge a list of dictionary into the original one

Parameters:
originalDictionary -
dictList -
Returns:
Merged dictionary
Throws:
java.net.MalformedURLException
gov.nasa.pds.tools.label.parser.ParseException
java.io.IOException

MergeDictionary

public static gov.nasa.pds.tools.dict.Dictionary MergeDictionary(gov.nasa.pds.tools.dict.Dictionary originalDictionary,
                                                                 gov.nasa.pds.tools.dict.Dictionary newDictionary)
Merge a new dictionary into an existing one

Parameters:
originalDictionary -
newDictionary -
Returns:
merged dictionary

MergeDictionary

public static gov.nasa.pds.tools.dict.Dictionary MergeDictionary(gov.nasa.pds.tools.dict.Dictionary originalDictionary,
                                                                 java.net.URL location)
                                                          throws gov.nasa.pds.tools.label.parser.ParseException,
                                                                 java.io.IOException
Merge a dictionary at a location into an existing one

Parameters:
originalDictionary -
location -
Returns:
merged dictionary
Throws:
gov.nasa.pds.tools.label.parser.ParseException
java.io.IOException

writeWDD

public static void writeWDD(MainWindow window,
                            java.lang.String wddFileName)
                     throws java.io.IOException
Output WDD to a file.

Parameters:
window -
wddFileName -
Throws:
java.io.IOException

setStatusType

public static void setStatusType(gov.nasa.pds.tools.dict.Dictionary dictionary,
                                 java.lang.String statusType)
Set status type to WDDSTATUSTYPE to each definition within a dictionary

Parameters:
dictionary -
statusType -


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