Package 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)
-
-
Constructor Summary
Constructors Constructor Description ControlledVocabulary(String id, String label, String value, List<ControlledVocabulary> childNodes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ControlledVocabulary>getChildNodes()StringgetId()StringgetLabel()StringgetValue()static ControlledVocabularyloadVocabulary(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.voidsetChildNodes(List<ControlledVocabulary> childNodes)voidsetId(String id)voidsetLabel(String label)voidsetValue(String value)
-
-
-
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 fileSAXException- Error during xml parsingParserConfigurationException- Error during xml parsingTransformerException- 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)
-
-