public class MutableMultiLanguagedProperty extends Object implements IMutableMultiLanguagedProperty
Copyright (c) SAP AG 2004
Constructor and Description |
---|
MutableMultiLanguagedProperty(IPropertyName name,
IPropertyDef def,
Locale locale) |
MutableMultiLanguagedProperty(IPropertyName name,
Locale locale) |
MutableMultiLanguagedProperty(MutableProperty prop,
List values,
Locale locale) |
MutableMultiLanguagedProperty(MutableProperty prop,
Locale locale) |
Modifier and Type | Method and Description |
---|---|
void |
addValue(Object value)
Adds a value to the list for a multi-value property
|
void |
deleteValue(String languageTag)
Removes a language specific value of this property
|
String |
getAttribute(String name)
Get the value of an attribute
|
Properties |
getAttributes()
Returns a collection of attributes
|
boolean |
getBooleanValue()
Get the property value if the type is PropertyType.BOOLEAN
|
boolean |
getBooleanValue(String languageTag)
Get the property value if the type is PropertyType.BOOLEAN for the desired languageTag
|
IMultiLanguagedProperty |
getClone(Locale locale) |
Date |
getDateValue()
Get the property value if the type is PropertyType.DATE
|
Date |
getDateValue(String languageTag)
Get the property value if the type is PropertyType.DATE for the desired languageTag
|
String |
getDefaultLanguage() |
String |
getDescription()
Returns the description of the property
|
String |
getDescription(IResourceContext context) |
int |
getIntValue()
Get the property value if the type is PropertyType.INTEGER
|
int |
getIntValue(String languageTag)
Get the property value if the type is PropertyType.INTEGER for the desired languageTag
|
String[] |
getLanguageTags() |
String[] |
getLanguageTagsNeedingTranslation() |
String |
getLastSetLanguageTag() |
long |
getLongIntValue()
Get the property value if the type is PropertyType.LONG
|
long |
getLongIntValue(String languageTag)
Get the property value if the type is PropertyType.LONG for the desired languageTag
|
IMutableProperty |
getMutable()
Returns a copy of this propertry that can be modified
|
IPropertyDef |
getPropertyDef()
Get a reference to the proeprty definition.
|
IPropertyName |
getPropertyName()
Returns the property name
|
String |
getStringValue()
Get the property value if the type is String
|
String |
getStringValue(String languageTag)
Get the property value if the type is String for the desired languageTag
|
PropertyType |
getType()
Return the property's data type
|
Object |
getValue()
Returns the property value as a Object if this is not a multi-valued property.
|
String |
getValueAsString()
Get the property value converted to a string.
|
String |
getValueAsString(String languageTag)
Get the property value converted to a string for the desired languageTag.
|
List |
getValues()
Returns the property values if this is a multi-valued property.
|
static boolean |
isMultiLanguaged(IProperty prop) |
boolean |
isMultivalued()
Returns true if the property is multi-valued
|
void |
markAsTranslated()
marks all languages as up-to-date
|
void |
markAsTranslated(String languageTag)
marks this language as up-to-date
|
boolean |
needsTranslation(String languageTag) |
void |
removeAttribute(String name)
Removes a attribute
|
void |
removeValue(int index)
Remove a value of a multi-value property
|
void |
setAttribute(String name,
String value)
Set an attribute
|
void |
setAttributes(Properties attributes)
Set the complete collection of attributes
|
void |
setBooleanValue(boolean value)
Sets the property value if the type ist PropertyType.BOOLEAN
|
void |
setBooleanValue(String languageTag,
boolean value)
Sets the property value if the type ist PropertyType.BOOLEAN
|
void |
setDateValue(Date value)
Sets the property value if the type ist PropertyType.DATE
|
void |
setDateValue(String languageTag,
Date value)
Sets the property value if the type ist PropertyType.DATE
|
void |
setDateValueFromLong(long value)
Sets the property value if the type ist PropertyType.DATE
|
void |
setDateValueFromLong(String languageTag,
long value)
Sets the property value if the type ist PropertyType.DATE
|
void |
setDefaultLanguage(String languageTag)
Specifies the default language.
|
void |
setIntValue(int value)
Sets the property value if the type ist PropertyType.INTEGER
|
void |
setIntValue(String languageTag,
int value)
Sets the property value if the type ist PropertyType.INTEGER
|
void |
setLongIntValue(long value)
Sets the property value if the type ist PropertyType.LONG
|
void |
setLongIntValue(String languageTag,
long value)
Sets the property value if the type ist PropertyType.LONG
|
void |
setStringValue(String value)
Sets the property value if the type ist PropertyType.STRING
|
void |
setStringValue(String languageTag,
String value)
Sets the property value if the type ist PropertyType.STRING
|
void |
setValue(int index,
Object value)
Set a value of a multi-value property
|
void |
setValues(List values)
Sets all values of a multi-value property
|
String |
toString() |
public MutableMultiLanguagedProperty(IPropertyName name, Locale locale) throws ResourceException
ResourceException
public MutableMultiLanguagedProperty(IPropertyName name, IPropertyDef def, Locale locale) throws ResourceException
ResourceException
public MutableMultiLanguagedProperty(MutableProperty prop, Locale locale)
public MutableMultiLanguagedProperty(MutableProperty prop, List values, Locale locale)
public static boolean isMultiLanguaged(IProperty prop) throws ResourceException
ResourceException
public boolean getBooleanValue(String languageTag) throws ResourceException
IMultiLanguagedProperty
getBooleanValue
in interface IMultiLanguagedProperty
ResourceException
public int getIntValue(String languageTag) throws ResourceException
IMultiLanguagedProperty
getIntValue
in interface IMultiLanguagedProperty
ResourceException
public long getLongIntValue(String languageTag) throws ResourceException
IMultiLanguagedProperty
getLongIntValue
in interface IMultiLanguagedProperty
ResourceException
public Date getDateValue(String languageTag) throws ResourceException
IMultiLanguagedProperty
getDateValue
in interface IMultiLanguagedProperty
ResourceException
public String getStringValue(String languageTag) throws ResourceException
IMultiLanguagedProperty
getStringValue
in interface IMultiLanguagedProperty
ResourceException
public String getValueAsString(String languageTag) throws ResourceException
IMultiLanguagedProperty
getValueAsString
in interface IMultiLanguagedProperty
ResourceException
public String[] getLanguageTags() throws ResourceException
getLanguageTags
in interface IMultiLanguagedProperty
ResourceException
public String[] getLanguageTagsNeedingTranslation() throws ResourceException
getLanguageTagsNeedingTranslation
in interface IMultiLanguagedProperty
ResourceException
public boolean needsTranslation(String languageTag) throws ResourceException
needsTranslation
in interface IMultiLanguagedProperty
ResourceException
public String getLastSetLanguageTag() throws ResourceException
getLastSetLanguageTag
in interface IMultiLanguagedProperty
ResourceException
public IPropertyName getPropertyName()
IProperty
getPropertyName
in interface IProperty
public PropertyType getType()
IProperty
public boolean isMultivalued()
IProperty
isMultivalued
in interface IProperty
public IPropertyDef getPropertyDef()
IProperty
getPropertyDef
in interface IProperty
public String getValueAsString()
IProperty
getValueAsString
in interface IProperty
public boolean getBooleanValue()
IProperty
getBooleanValue
in interface IProperty
public int getIntValue()
IProperty
getIntValue
in interface IProperty
public long getLongIntValue()
IProperty
getLongIntValue
in interface IProperty
public Date getDateValue()
IProperty
getDateValue
in interface IProperty
public String getStringValue()
IProperty
getStringValue
in interface IProperty
public List getValues() throws ResourceException
IProperty
getValues
in interface IProperty
ResourceException
public Object getValue() throws ResourceException
IProperty
getValue
in interface IProperty
ResourceException
public IMutableProperty getMutable()
IProperty
getMutable
in interface IProperty
public IMultiLanguagedProperty getClone(Locale locale)
getClone
in interface IMultiLanguagedProperty
locale
- the current locale (needed for determing the default language)public String getAttribute(String name) throws ResourceException
IProperty
getAttribute
in interface IProperty
name
- Attribute nameResourceException
public Properties getAttributes() throws ResourceException
IProperty
getAttributes
in interface IProperty
ResourceException
public String getDescription() throws WcmException
IProperty
getDescription
in interface IProperty
WcmException
- Exception raised in failure situationpublic String getDescription(IResourceContext context) throws WcmException
getDescription
in interface IProperty
WcmException
public void setIntValue(int value) throws ResourceException
IMutableProperty
setIntValue
in interface IMutableProperty
value
- The new valueResourceException
public void setDateValue(Date value) throws ResourceException
IMutableProperty
setDateValue
in interface IMutableProperty
value
- The new valueResourceException
public void setDateValueFromLong(long value) throws ResourceException
IMutableProperty
setDateValueFromLong
in interface IMutableProperty
value
- The new valueResourceException
public void setStringValue(String value) throws ResourceException
IMutableProperty
setStringValue
in interface IMutableProperty
value
- The new valueResourceException
public void setLongIntValue(long value) throws ResourceException
IMutableProperty
setLongIntValue
in interface IMutableProperty
value
- The new valueResourceException
public void setBooleanValue(boolean value) throws ResourceException
IMutableProperty
setBooleanValue
in interface IMutableProperty
value
- The new valueResourceException
public void setValues(List values) throws ResourceException
IMutableProperty
setValues
in interface IMutableProperty
values
- The new values. The following table shows the instance that
has to be used for each type. PropertyType | instanceof
------------------------- STRING | String BOOLEAN | Boolean INTEGER |
Integer LONG | Long DATE | Date XML | StringResourceException
- If the property is not defined as multi-valued
If a instance of a value does not match the property typepublic void addValue(Object value) throws ResourceException
IMutableProperty
addValue
in interface IMutableProperty
value
- The value to add. The following table shows the instance that
has to be used for each type. PropertyType | instanceof
------------------------- STRING | String BOOLEAN | Boolean INTEGER |
Integer LONG | Long DATE | Date XML | StringResourceException
- If the property is not defined as multi-valued
If the instance of the value does not match the property typepublic void setValue(int index, Object value) throws ResourceException
IMutableProperty
setValue
in interface IMutableProperty
index
- The zero-based indexvalue
- The new valueResourceException
- If the property is not defined as multi-valued
If the instance of the value does not match the property type If the
index it out of boundspublic void removeValue(int index) throws ResourceException
IMutableProperty
removeValue
in interface IMutableProperty
index
- The zero-based indexResourceException
- If the property is not defined as multi-valued
If the index it out of boundspublic void setAttribute(String name, String value) throws ResourceException
IMutableProperty
setAttribute
in interface IMutableProperty
name
- Attribute namevalue
- Attribute valueResourceException
public void setAttributes(Properties attributes) throws ResourceException
IMutableProperty
setAttributes
in interface IMutableProperty
attributes
- All attributesResourceException
public void removeAttribute(String name) throws ResourceException
IMutableProperty
removeAttribute
in interface IMutableProperty
name
- Attribute nameResourceException
public String getDefaultLanguage() throws ResourceException
ResourceException
public void setIntValue(String languageTag, int value) throws ResourceException
IMutableMultiLanguagedProperty
setIntValue
in interface IMutableMultiLanguagedProperty
ResourceException
public void setDateValue(String languageTag, Date value) throws ResourceException
IMutableMultiLanguagedProperty
setDateValue
in interface IMutableMultiLanguagedProperty
ResourceException
public void setDateValueFromLong(String languageTag, long value) throws ResourceException
IMutableMultiLanguagedProperty
setDateValueFromLong
in interface IMutableMultiLanguagedProperty
ResourceException
public void setStringValue(String languageTag, String value) throws ResourceException
IMutableMultiLanguagedProperty
setStringValue
in interface IMutableMultiLanguagedProperty
ResourceException
public void setLongIntValue(String languageTag, long value) throws ResourceException
IMutableMultiLanguagedProperty
setLongIntValue
in interface IMutableMultiLanguagedProperty
ResourceException
public void setBooleanValue(String languageTag, boolean value) throws ResourceException
IMutableMultiLanguagedProperty
setBooleanValue
in interface IMutableMultiLanguagedProperty
ResourceException
public void deleteValue(String languageTag) throws ResourceException
IMutableMultiLanguagedProperty
deleteValue
in interface IMutableMultiLanguagedProperty
ResourceException
public void markAsTranslated(String languageTag) throws ResourceException
IMutableMultiLanguagedProperty
markAsTranslated
in interface IMutableMultiLanguagedProperty
ResourceException
public void markAsTranslated() throws ResourceException
IMutableMultiLanguagedProperty
markAsTranslated
in interface IMutableMultiLanguagedProperty
ResourceException
public void setDefaultLanguage(String languageTag) throws ResourceException
IMutableMultiLanguagedProperty
IMultiLanguagedProperty
.setDefaultLanguage
in interface IMutableMultiLanguagedProperty
languageTag
- the default languageResourceException
IMultiLanguagedProperty
Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2018 SAP AG Complete Copyright Notice