org.dspace.vocabulary
Class ControlledVocabulary
java.lang.Object
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)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ControlledVocabulary
public ControlledVocabulary(String id,
String label,
String value,
List<ControlledVocabulary> childNodes)
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.