public interface EditorValue<T>
Modifier and Type | Field and Description |
---|---|
static String |
COPY_PRESET
Marker for preset copy mode
|
static String |
DEFAULT
Marker for default values
|
static String |
DELETE
Marker for delete values
|
static Language |
FALLBACK_LANGUAGE
Language used for fallback values.
|
static String |
LANG_KEY
Key used for identifying language nodes
|
static Language |
SOLE_LANGUAGE
Language used for language independent editor values.
|
static String |
UNSUPPORTED
Marker for unsupported editors
|
Modifier and Type | Method and Description |
---|---|
void |
addEditorValueListener(EditorValueListener listener)
Add the given listener to become notified about changes.
|
void |
assimilate(Language language,
Object object)
Assimilate the value object for the specified language, if possible.
|
void |
beSet(Language language)
Mark the current value for the given language to be set, i.e.
|
void |
clear()
Unset the value for all languages.
|
void |
clear(Language language)
Unset the value for the specified language, i.e.
|
List<Reference> |
findReferences()
Finds references within this editor and returns them as a list.
|
T |
get(Language language)
Get the value object in the specified language.
|
Class<?> |
getContentType()
Get the type of content handled by the editor.
|
DataValue |
getDataValue()
Get DataValue object this editor belongs to.
|
Map<String,Language> |
getEditorLanguages()
Get the languages valid for the current editing operation, where the key
is the language abbreviation and the value is the language object.
|
GomFormElement |
getForm()
Get the form definition.
|
String |
getGuiClassName()
Deprecated.
since 4.0.17 - no replacement
|
Element |
getGuiXml()
Deprecated.
since 4.0.17 - use
getForm() instead |
List<? extends Match> |
getMatches(Language language,
Request request)
Find matches for the given request.
|
String |
getSearchableString(Language language)
This method returns a string representation for search and indexing usage.
|
String |
getTagName()
Get the tag name associated with this editor.
|
Object |
getValue()
Deprecated.
since 4.0.17 - use specific attribute accessor
|
Object |
getValue(Language language)
Deprecated.
since 4.0.17 - use specific attribute accessor
|
Class<T> |
getValueType()
Get the type of value the editor takes.
|
void |
initialize(UserService userService,
DataValue parent,
Element dataNode,
GomFormElement formElement)
Initialize this editor.
|
boolean |
isDefault()
Indicates the value representing default data.
|
boolean |
isEmpty(T object)
Test the given object for being empty.
|
boolean |
isLanguageDependent()
States, if this editor is language dependent.
|
boolean |
isSet()
Indicates that a value is set for at least one language.
|
boolean |
isSet(Language language)
Indicates that a value for the given language is set or is
backed by a language independent value.
|
boolean |
isValid()
Indicates, whether the editor has a valid setting wrt. its GOM.
|
void |
removeEditorValueListener(EditorValueListener listener)
Remove the listener from being notified about changes.
|
void |
set(Language language,
T object)
Set the value object for the specified language.
|
void |
setTagName(String value)
Set the tag name associated with this editor.
|
void |
setValue(Language language,
Object value)
Deprecated.
since 4.0.17 - use specific attribute accessor
|
void |
setValue(Object value)
Deprecated.
since 4.0.17 - use specific attribute accessor
|
void |
setValueNode(Element dataXml)
Set values of editor by dataXml element.
|
String |
toXml()
Get an XML string representation of the editor's values.
|
String |
toXml(Language language)
Get an XML string representation of the editor's value in the specified
language.
|
void |
validate(Language language,
T value)
Checks for the given value to be valid in the specified language wrt. the
editor's GOM.
|
static final Language SOLE_LANGUAGE
static final Language FALLBACK_LANGUAGE
static final String LANG_KEY
static final String UNSUPPORTED
static final String DEFAULT
static final String COPY_PRESET
static final String DELETE
void initialize(UserService userService, DataValue parent, Element dataNode, GomFormElement formElement)
userService
- The userService to be used.parent
- The parent DataValue
object.dataNode
- <CMS_VALUE name=...>...</CMS_VALUE>
formElement
- The form element defining the elements GUI.void setValueNode(Element dataXml)
dataXml
- DataXML object containing valuesString toXml()
String toXml(Language language)
language
- The language to create a representation for.@Deprecated Element getGuiXml()
getForm()
instead@NotNull Class<T> getValueType()
Class<?> getContentType()
getValueType()
for non-list-based value types and returns
the element type for list-based value types.void setTagName(String value)
value
- the tag nameString getTagName()
@Nullable GomFormElement getForm()
boolean isLanguageDependent()
Map<String,Language> getEditorLanguages()
@Nullable T get(Language language)
language
- The language to look up.void set(Language language, T object) throws InvalidValueException
language
- The language to use.object
- The object to store.InvalidValueException
- If the given object is no valid value.void assimilate(Language language, Object object) throws IllegalArgumentException, InvalidValueException
language
- The language to assimilate for.object
- The object to be assimilated.IllegalArgumentException
- If the object cannot be assimilated.InvalidValueException
- If the object's value is not valid.boolean isEmpty(T object)
Default implementation checks for value being null
.
object
- The object to test.true
, iff the value is treated as empty.boolean isSet()
true
, if at least one language is set to a value.boolean isSet(Language language)
language
- The language to look up.true
, if a value is set or backed up.void beSet(Language language)
isSet(Language)
will evaluate to true
and, if the
current value is null
, isEmpty(Object)
will
evaluate to true, too.language
- The language to be marked as set.void clear()
clear(Language)
void clear(Language language)
isEmpty(Object)
will evaluate to true on the current value and isSet(Language)
will evaluate to false.language
- The language to reset values in.String getSearchableString(Language language)
language
- The language to get a searchable string for.@NotNull List<Reference> findReferences() throws RuntimeException
RuntimeException
could be thrown in case of problematic/invalid references!RuntimeException
- in case of any problems with referenced elements.DataValue getDataValue()
boolean isDefault()
true
, if the value represents default data.void addEditorValueListener(EditorValueListener listener)
listener
- The listener to add.void removeEditorValueListener(EditorValueListener listener)
listener
- The listener to be removed.boolean isValid()
true
, iff valid.void validate(Language language, T value) throws InvalidValueException
language
- The language to check for.value
- The value to be checked.InvalidValueException
- If the value is invalid.@NotNull List<? extends Match> getMatches(Language language, Request request)
language
- The language to seach in.request
- The request to find matches for.@Deprecated String getGuiClassName()
@Deprecated @Nullable Object getValue()
@Deprecated void setValue(Object value)
@Deprecated @Nullable Object getValue(Language language)
@Deprecated void setValue(Language language, Object value)
Copyright © 2015 e-Spirit AG. All Rights Reserved. Build 5.1.408