@Entity @Indexed(index="eu.etaxonomy.cdm.model.description.DescriptionElementBase") public class TextData extends DescriptionElementBase implements IMultiLanguageTextHolder, java.lang.Cloneable
feature
"medical use" for instance).
A format
used for structuring the text may also be stated.
This class corresponds partially to NaturalLanguageDescriptionType according to the SDD schema.
annotations, markers
CLOB_LENGTH, uuid
Constructor and Description |
---|
TextData()
Class constructor: creates a new empty text data instance.
|
TextData(Feature feature)
Class constructor: creates a new text data instance with the
feature
to be described. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clones this text data.
|
boolean |
containsKey(Language language) |
boolean |
containsValue(LanguageString languageString) |
int |
countLanguages()
Returns the number of
languages in which the content
of this text data has been formulated. |
TextFormat |
getFormat()
Returns the
format used for structuring the text representing
the content of this text data. |
LanguageString |
getLanguageText(Language language)
Returns the multilanguage text with the content of this text data for
a specific language.
|
java.util.Map<Language,LanguageString> |
getMultilanguageText()
Returns a copy of the multilanguage text with the content of this text data.
|
LanguageString |
getPreferredLanguageString(java.util.List<Language> languages)
Returns the LanguageString in the preferred language.
|
LanguageString |
getPreferredLanguageString(java.util.List<Language> languages,
boolean restrictToGivenLanguages)
|
java.lang.String |
getText(Language language)
Returns the text string in the given
language with the content
of this text data. |
static TextData |
NewInstance()
Creates a new empty text data instance.
|
static TextData |
NewInstance(Feature feature)
Creates a new text data instance with the
feature
to be described. |
static TextData |
NewInstance(Feature feature,
java.lang.String text,
Language language,
TextFormat format)
Creates a new text data instance with a given text in a given particular
language and with the given text format for structuring it. |
static TextData |
NewInstance(java.lang.String text,
Language language,
TextFormat format)
Creates a new text data instance with a given text in a given particular
language and with the given text format for structuring it. |
LanguageString |
putText(LanguageString languageString)
Adds a translated
text in a particular language
to the multi-language text representing the content of this text data. |
LanguageString |
putText(Language language,
java.lang.String text)
Creates a
language string based on the given text string
and the given language , returns it and adds it to the multilanguage
text representing the content of this text data. |
LanguageString |
removeText(Language language)
Removes from the multilanguage representing the content of
this text data the one
language string
with the given language . |
void |
setFormat(TextFormat format) |
int |
size()
Returns the number of languages available for this text data.
|
java.lang.String |
toString()
Overrides
Object.toString() . |
addAggregationSource, addImportSource, addMedia, addModifier, addModifyingText, addModifyingText, addPrimaryTaxonomicSource, addPrimaryTaxonomicSource, addSource, addSource, addSource, addSource, addSources, clone, getFeature, getInDescription, getMedia, getModifiers, getModifiers, getModifyingText, getSortIndex, getSources, getTimeperiod, isCharacterData, makeModifierMap, putModifyingText, putModifyingText, removeMedia, removeModifier, removeModifyingText, removeSource, setFeature, setInDescription, setSortIndex, setTimeperiod
addAnnotation, addMarker, addMarker, getAnnotations, getAnnotations, getMarkers, getMarkers, hasMarker, hasMarker, markerValue, removeAnnotation, removeMarker, removeMarker, setAnnotations
cloneLanguageString, equals, getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
addPropertyChangeListener, addPropertyChangeListener, addToSetWithChangeEvent, deproxy, deproxy, fireOnCreateEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCreated, getCreatedBy, getId, getUserFriendlyDescription, getUserFriendlyFieldName, getUserFriendlyTypeName, getUuid, hashCode, hasListeners, initListener, instanceToString, invokeSetMethod, invokeSetMethodWithNull, isBlank, isInstanceOf, isNotBlank, isPersited, removeFromSetWithChangeEvent, removePropertyChangeListener, removePropertyChangeListener, replaceInList, setCreated, setCreatedBy, setId, setNewEntityListener, setUuid
finalize, getClass, notify, notifyAll, wait, wait, wait
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
getCreated, getCreatedBy, getId, getUuid, isInstanceOf, isPersited, setCreated, setCreatedBy, setId, setUuid
public TextData()
TextData(Feature)
public TextData(Feature feature)
feature
to be described.feature
- the feature the text data refer toTextData()
public static TextData NewInstance()
public static TextData NewInstance(Feature feature)
feature
to be described.feature
- the feature the text data refer toNewInstance()
,
NewInstance(String, Language, TextFormat)
,
NewInstance(Feature, String, Language, TextFormat)
public static TextData NewInstance(java.lang.String text, Language language, TextFormat format)
language
and with the given text format for structuring it.text
- the text string with the content of the descriptionlanguage
- the language in which the text string is formulatedformat
- the text format used to structure the text stringNewInstance()
,
NewInstance(Feature)
,
NewInstance(Feature, String, Language, TextFormat)
public static TextData NewInstance(Feature feature, java.lang.String text, Language language, TextFormat format)
language
and with the given text format for structuring it.feature
- the feature the text data refer totext
- the text string with the content of the descriptionlanguage
- the language in which the text string is formulatedformat
- the text format used to structure the text stringNewInstance()
,
NewInstance(Feature)
,
NewInstance(String, Language, TextFormat)
public java.util.Map<Language,LanguageString> getMultilanguageText()
language strings
(texts) contained in the
multilanguage text should all have the same meaning.getText(Language)
public LanguageString getLanguageText(Language language)
language
- the language in which the text string looked for is formulatedpublic java.lang.String getText(Language language)
language
with the content
of this text data.language
- the language in which the text string looked for is formulated#getMultilanguageText(Language)
public LanguageString getPreferredLanguageString(java.util.List<Language> languages)
TermBase.getPreferredRepresentation(List)
languages
- the ordered list of preferred languagesMultilanguageTextHelper.getPreferredLanguageString(Map, List, boolean)
public LanguageString getPreferredLanguageString(java.util.List<Language> languages, boolean restrictToGivenLanguages)
getPreferredLanguageString(List)
. If restrictToGivenLanguages is true
a non-null
result is returned if a language representation for one
of the given languages exists. No default or arbitrary representation is used.languages
- the ordered list of preferred languagesrestrictToGivenLanguages
- MultilanguageTextHelper.getPreferredLanguageString(Map, List, boolean)
public LanguageString putText(Language language, java.lang.String text)
language string
based on the given text string
and the given language
, returns it and adds it to the multilanguage
text representing the content of this text data.language
- the language in which the text string is formulatedtext
- the string representing the content of the text data
in a particular languagegetMultilanguageText()
,
putText(LanguageString)
public LanguageString putText(LanguageString languageString)
text in a particular language
to the multi-language text representing the content of this text data.
The given language string will be returned.languageString
- the language string representing the content of
the text data in a particular languagegetMultilanguageText()
,
#putText(String, Language)
,
HashMap.put(Object, Object)
public LanguageString removeText(Language language)
language string
with the given language
. Returns the removed
language string.language
- the language in which the language string to be removed
has been formulatedgetMultilanguageText()
public int countLanguages()
languages
in which the content
of this text data has been formulated.getMultilanguageText()
public TextFormat getFormat()
format
used for structuring the text representing
the content of this text data.getMultilanguageText()
public void setFormat(TextFormat format)
getFormat()
public boolean containsKey(Language language)
language
- java.util.Map#containsKey(Object)}
public boolean containsValue(LanguageString languageString)
languageString
- java.util.Map#containsValue(Object)}
public int size()
java.util.Map#size()}
public java.lang.String toString()
Object.toString()
.
This returns an String that identifies the object well without being necessarily unique. Internally the method is delegating the
call to {link CdmBase.instanceToString()
.Note: If overriding this method's javadoc always copy or link the above requirement. If not overwritten by a subclass method returns the class, id and uuid as a string for any CDM object.
For example: Taxon#13<b5938a98-c1de-4dda-b040-d5cc5bfb3bc0>
public java.lang.Object clone()
clone
in class DescriptionElementBase
DescriptionElementBase.clone()
,
Object.clone()
Copyright © 2007-2020 EDIT. All Rights Reserved.