Package org.dspace.vocabulary
Class ControlledVocabulary
java.lang.Object
org.dspace.vocabulary.ControlledVocabulary
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
ConstructorsConstructorDescriptionControlledVocabulary(String id, String label, String value, List<ControlledVocabulary> childNodes) -
Method Summary
Modifier and TypeMethodDescriptiongetId()getLabel()getValue()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) voidvoidvoid
-
Constructor Details
-
ControlledVocabulary
public ControlledVocabulary(String id, String label, String value, List<ControlledVocabulary> childNodes)
-
-
Method Details
-
loadVocabulary
public static ControlledVocabulary loadVocabulary(String fileName) throws IOException, SAXException, ParserConfigurationException, XPathExpressionException 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 !XPathExpressionException
-
getId
-
setId
-
getLabel
-
setLabel
-
getChildNodes
-
setChildNodes
-
getValue
-
setValue
-