public class VocabularyFieldValue extends java.lang.Object implements FieldValue
Item.getVocabularyValue(com.canto.cumulus.GUID)
to get this
wrapper class object. You can then use Item.setVocabularyValue(com.canto.cumulus.GUID, VocabularyFieldValue)
to set the field value
back into the item. You can use the wrapper object from one Item to save it to another Item but both have to belong to the same catalog.Constructor and Description |
---|
VocabularyFieldValue(FieldDefinition fieldDefinition)
Creates a new instance for the given string enum field.
|
Modifier and Type | Method and Description |
---|---|
void |
clearValue()
Clear the field's value.
|
ItemCollection |
findItems(java.lang.String searchValue,
boolean searchEqual,
int languageID)
Returns an
ItemCollection containing the items of the $Vocabulary catalog matching the defined query (see @link
FieldDefinition#getVocabularyQuery) and the searchValue . |
static void |
findItems(java.lang.String searchValue,
boolean searchEqual,
int languageID,
java.util.Set<java.lang.Integer> itemIDsToIgnore,
ItemCollection vocabularyItemCollection)
Searches for items of the $Vocabulary catalog matching the defined query (see @link FieldDefinition#getVocabularyQuery) and the
searchValue . |
java.lang.String |
getDisplayString()
Return the field's value as a string that can be displayed to the user.
|
java.lang.String |
getDisplayString(java.util.Locale locale)
Return the field's value as a string that can be displayed to the user.
|
int |
getID()
Get the ID of the string list value.
|
java.util.Set<java.lang.Integer> |
getIDs()
Get the IDs of this field value.
|
boolean |
hasValue()
Return whether this field has a value.
|
void |
setFromDisplayString(java.util.Locale locale,
java.lang.String value)
Set the field value from a display string.
|
void |
setFromDisplayString(java.lang.String value)
Set the field value from a display string.
|
void |
setID(int enumID)
Set the ID of this string list value.
|
void |
setIDs(java.util.Set<java.lang.Integer> ids)
Set the field value to the given set of string list IDs.
|
boolean |
supportsMultipleValues()
Return whether this field is defined to support multiple values.
|
java.lang.String |
toString()
Same as
getDisplayString() . |
public VocabularyFieldValue(FieldDefinition fieldDefinition)
fieldDefinition
- string enum fieldpublic boolean hasValue()
hasValue
in interface FieldValue
true
if the field has a value, false
otherwise.public void clearValue()
Item.save()
to
save this change back to the catalog.clearValue
in interface FieldValue
public java.lang.String getDisplayString()
getDisplayString
in interface FieldValue
public java.lang.String getDisplayString(java.util.Locale locale)
getDisplayString
in interface FieldValue
locale
- The locale to use for the language selection.public void setFromDisplayString(java.lang.String value) throws InvalidArgumentException
Item.save()
to save this change back to the catalog. This method uses the current locale for the language selection.setFromDisplayString
in interface FieldValue
value
- The display string to set the value from.InvalidArgumentException
- if the display string is not of the right format.public void setFromDisplayString(java.util.Locale locale, java.lang.String value) throws InvalidArgumentException
Item.save()
to save this change back to the catalog. This method uses the current locale for the language selection.setFromDisplayString
in interface FieldValue
value
- The display string to set the value from.locale
- The locale to use for formatting and language selection.InvalidArgumentException
- if the display string is not of the right format.public boolean supportsMultipleValues()
true
if this field supports multiple values, false
otherwise.public int getID()
public void setID(int enumID) throws InvalidArgumentException
Item.save()
to save this change back to the
catalog.enumID
- The new value of this string list field value.InvalidArgumentException
- if the ID is not validsetIDs(java.util.Set)
public java.util.Set<java.lang.Integer> getIDs()
public void setIDs(java.util.Set<java.lang.Integer> ids) throws InvalidArgumentException
Item.save()
to save this change back to the catalog.ids
- The string list IDs to be the new field value.InvalidArgumentException
- if one of the given IDs is not valid.public ItemCollection findItems(java.lang.String searchValue, boolean searchEqual, int languageID)
ItemCollection
containing the items of the $Vocabulary catalog matching the defined query (see @link
FieldDefinition#getVocabularyQuery) and the searchValue
.searchValue
- the value to search forsearchEqual
- if this is true
the value must be matches equal. IF this is false
a "starts with" search will be applied. This can be
used to implement a "type ahead" search.languageID
- the language to search if the GUID.UID_CAT_NAME
field is defined for multiple language support.public static void findItems(java.lang.String searchValue, boolean searchEqual, int languageID, java.util.Set<java.lang.Integer> itemIDsToIgnore, ItemCollection vocabularyItemCollection)
searchValue
.searchValue
- the value to search forsearchEqual
- if this is true
the value must be matches equal. IF this is false
a "starts with" search will be applied. This can be
used to implement a "type ahead" search.languageID
- the language to search if the GUID.UID_CAT_NAME
field is defined for multiple language support.public java.lang.String toString()
getDisplayString()
.toString
in class java.lang.Object
www.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.