Package org.ametys.cms.data.type.impl
Class StringRepositoryElementType
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.model.type.AbstractModelItemType
-
- org.ametys.core.model.type.AbstractElementType<String>
-
- org.ametys.core.model.type.AbstractStringElementType
-
- org.ametys.cms.data.type.impl.StringRepositoryElementType
-
- All Implemented Interfaces:
RepositoryElementType<String>
,RepositoryModelItemType
,ElementType<String>
,ModelItemType
,LogEnabled
,PluginAware
- Direct Known Subclasses:
PasswordRepositoryElementType
public class StringRepositoryElementType extends AbstractStringElementType implements RepositoryElementType<String>
Class for string type of elements stored in the repository
-
-
Constructor Summary
Constructors Constructor Description StringRepositoryElementType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNonEmptyValue(RepositoryData parentData, String name)
Check if there is a non empty value in the given repository databoolean
isCompatible(RepositoryData parentData, String name)
Checks if the value in the given repository data is compatible with the item typeObject
read(RepositoryData parentData, String name)
Read the value in the given repository datavoid
write(ModifiableRepositoryData parentData, String name, Object value)
Write the value into the given repository data-
Methods inherited from class org.ametys.core.model.type.AbstractStringElementType
_compareSingleValues, castValue, fromJSONForClient, isSimple, passwordValueToJSONForClient, toString
-
Methods inherited from class org.ametys.core.model.type.AbstractElementType
_compareMultipleValues, _getValueAttributes, _isValueFromXMLMultiple, _singleValueFromXML, _singleValueToJSON, _singleValueToSAX, compareValues, getManagedClass, getManagedClassArray, isCompatible, parseConfiguration, valueFromXML, valueToJSONForClient, valueToSAX
-
Methods inherited from class org.ametys.core.model.type.AbstractModelItemType
getId, setPluginInfo
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.runtime.model.type.ElementType
castValue, compareValues, fromJSONForClient, getManagedClass, getManagedClassArray, isCompatible, isSimple, parseConfiguration, toString, valueFromXML, valueToJSONForClient, valueToSAX
-
Methods inherited from interface org.ametys.runtime.model.type.ModelItemType
getId
-
Methods inherited from interface org.ametys.runtime.plugin.component.PluginAware
setPluginInfo
-
Methods inherited from interface org.ametys.plugins.repository.data.type.RepositoryModelItemType
isMultiple
-
-
-
-
Constructor Detail
-
StringRepositoryElementType
public StringRepositoryElementType()
-
-
Method Detail
-
read
public Object read(RepositoryData parentData, String name) throws BadItemTypeException
Description copied from interface:RepositoryElementType
Read the value in the given repository data- Specified by:
read
in interfaceRepositoryElementType<String>
- Parameters:
parentData
- repository data containing the valuename
- the name of the element to read- Returns:
- the value. Can return a T or a T[]. That's why the return type is Object
- Throws:
BadItemTypeException
- if the reading value doesn't match this element type
-
hasNonEmptyValue
public boolean hasNonEmptyValue(RepositoryData parentData, String name) throws BadItemTypeException
Description copied from interface:RepositoryModelItemType
Check if there is a non empty value in the given repository data- Specified by:
hasNonEmptyValue
in interfaceRepositoryModelItemType
- Parameters:
parentData
- repository data containing the valuename
- the name of the element to check- Returns:
true
if there is a non empty value,false
otherwise- Throws:
BadItemTypeException
- if the reading value doesn't match this element type
-
write
public void write(ModifiableRepositoryData parentData, String name, Object value) throws BadItemTypeException
Description copied from interface:RepositoryElementType
Write the value into the given repository data- Specified by:
write
in interfaceRepositoryElementType<String>
- Parameters:
parentData
- repository where to store the value.name
- the name of the element to writevalue
- the value to write. Can be a T or a T[]. That's why it is an Object- Throws:
BadItemTypeException
- If the given value doesn't match this element type
-
isCompatible
public boolean isCompatible(RepositoryData parentData, String name) throws UnknownDataException
Description copied from interface:RepositoryModelItemType
Checks if the value in the given repository data is compatible with the item type- Specified by:
isCompatible
in interfaceRepositoryModelItemType
- Parameters:
parentData
- repository data containing the data to checkname
- the name of the data to check- Returns:
true
if the data type matches the current type,false
otherwise- Throws:
UnknownDataException
- if there is no data in the parent repository data with this name
-
-