org.dspace.vocabulary
Class ControlledVocabulary

java.lang.Object
  extended by org.dspace.vocabulary.ControlledVocabulary

public class ControlledVocabulary
extends Object

This class represents a single controlled vocabulary node It also contains references to its child nodes

Author:
Kevin Van de Velde (kevin at atmire dot com)

Constructor Summary
ControlledVocabulary(String id, String label, String value, List<ControlledVocabulary> childNodes)
           
 
Method Summary
 List<ControlledVocabulary> getChildNodes()
           
 String getId()
           
 String getLabel()
           
 String getValue()
           
static ControlledVocabulary loadVocabulary(String fileName)
          Load the vocabulary with the given filename, if no vocabulary is found null is returned The vocabulary file will need to located in the [dspace.dir]/config/controlled-vocabulary directory.
 void setChildNodes(List<ControlledVocabulary> childNodes)
           
 void setId(String id)
           
 void setLabel(String label)
           
 void setValue(String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlledVocabulary

public ControlledVocabulary(String id,
                            String label,
                            String value,
                            List<ControlledVocabulary> childNodes)
Method Detail

loadVocabulary

public static ControlledVocabulary loadVocabulary(String fileName)
                                           throws IOException,
                                                  SAXException,
                                                  ParserConfigurationException,
                                                  TransformerException
Load the vocabulary with the given filename, if no vocabulary is found null is returned The vocabulary file will need to located in the [dspace.dir]/config/controlled-vocabulary directory.

Parameters:
fileName - the name of the vocabulary file.
Returns:
a controlled vocabulary object
Throws:
IOException - Should something go wrong with reading the file
SAXException - Error during xml parsing
ParserConfigurationException - Error during xml parsing
TransformerException - Error during xml parsing TODO: add some caching !

getId

public String getId()

setId

public void setId(String id)

getLabel

public String getLabel()

setLabel

public void setLabel(String label)

getChildNodes

public List<ControlledVocabulary> getChildNodes()

setChildNodes

public void setChildNodes(List<ControlledVocabulary> childNodes)

getValue

public String getValue()

setValue

public void setValue(String value)


Copyright © 2012 DuraSpace. All Rights Reserved.