public class StringProperty extends ScalarProperty
field, value
deprecatedFallback, flags, forceDirty, IS_READONLY, isDeprecated, NON_CANON_INDEX, parent
DIRTY_MASK, IS_DIRTY, IS_MODIFIED, IS_MOVED, IS_NEW, IS_PHANTOM, IS_REMOVED, NONE
Constructor and Description |
---|
StringProperty(Property parent,
Field field,
int flags) |
Modifier and Type | Method and Description |
---|---|
<T> T |
convertTo(Serializable value,
Class<T> toType)
Converts the given normalized value to the given type.
|
boolean |
isNormalized(Object value)
Checks if the given value is a normalized one.
|
Object |
newInstance()
Creates a new and empty instance of a normalized value.
|
Serializable |
normalize(Object value)
Normalizes the given value as dictated by the property type.
|
accept, addEmpty, addValue, addValue, clone, get, get, getChildren, getDirtyChildren, getField, getName, getType, internalGetValue, internalSetValue, isContainer, isSameAs, toString
appendDirtyFlags, areFlagsSet, clearDirtyFlags, clearFlags, collectPath, computeRemovedProperty, getDefaultValue, getDeprecatedParent, getDirtyFlags, getObjectResolver, getParent, getPath, getRoot, getSchema, getValue, getValue, getValue, getValue, getValueDeprecation, getValueForWrite, getXPath, getXPath, init, isComplex, isDeprecated, isDirty, isForceDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isSameValue, isScalar, iterator, moveTo, newDeprecatedMessage, remove, removePhantomFlag, resolvePath, resolvePath, setDirtyFlags, setFlags, setForceDirty, setIsModified, setIsMoved, setIsNew, setIsRemoved, setReadOnly, setValue, setValue, setValue, setValueDeprecation, size, validateType
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public StringProperty(Property parent, Field field, int flags)
public boolean isNormalized(Object value)
Property
Null values are considered as normalized.
isNormalized
in interface Property
isNormalized
in class AbstractProperty
value
- the value to checkpublic Serializable normalize(Object value) throws PropertyConversionException
Property
Normalized values are the ones that are used for transportation over the net and that are given to the storage implementation to be stored in the repository
Normalized values must be Serializable
If the given value is already normalized it will be returned back.
normalize
in interface Property
normalize
in class AbstractProperty
value
- the value to normalize according to the property typePropertyConversionException
public <T> T convertTo(Serializable value, Class<T> toType) throws PropertyConversionException
Property
If the value has already the given type it will be returned back.
convertTo
in interface Property
convertTo
in class AbstractProperty
value
- the normalized value to converttoType
- the conversion typePropertyConversionException
- if the conversion cannot be made because of type incompatibilitiespublic Object newInstance()
Property
Empty is used in the sense of a value that has not been initialized or can be considered as an empty value. For
example for the String
type the empty value will be the empty string ""
newInstance
in interface Property
newInstance
in class AbstractProperty
Copyright © 2018 Nuxeo. All rights reserved.