public interface Vocabulary extends Iterable<Term>, Serializable
Term| Modifier and Type | Method and Description |
|---|---|
Term |
fromName(String name)
Returns the vocabulary term with the specified name.
|
Term |
fromOrdinal(int ordinal)
Returns the vocabulary term specified in a given position.
|
<V> Term |
fromValue(V value)
Returns the vocabulary term that matches the specified value.
|
String |
getNamespace()
Get the namespace of the vocabulary.
|
String |
getPreferredPrefix()
Get the preferred prefix for the vocabulary namespace.
|
int |
size()
Get the number of terms defined in the vocabulary.
|
Term[] |
terms()
Get the terms defined in the vocabulary.
|
String getNamespace()
null
nor empty.String getPreferredPrefix()
null nor empty.int size()
0 if no term is defined.Term[] terms()
Term fromName(String name)
name - the name of the term to returnIllegalArgumentException - if name is null.Term fromOrdinal(int ordinal)
ordinal - the position in which the desired term was declared.IndexOutOfBoundsException - if the specified ordinal is lower than 0 or greater
or equal than #size().<V> Term fromValue(V value)
V - the type of value to be processedvalue - a value to determine the desired term.value.UnsupportedOperationException - if the terms of the vocabulary cannot be transformed to
instances a compatible class.Term.as(Class)
Copyright (C) 2014-2016, Center for Open Middleware