|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.core.api.model.impl.AbstractProperty org.nuxeo.ecm.core.api.model.impl.ListProperty
public class ListProperty
Field Summary |
---|
Fields inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty |
---|
IS_READONLY, IS_VALIDATING, KEYED_DATA |
Fields inherited from interface org.nuxeo.ecm.core.api.model.Property |
---|
DIRTY_MASK, IS_DIRTY, IS_MODIFIED, IS_MOVED, IS_NEW, IS_PHANTOM, IS_REMOVED, NONE |
Constructor Summary | |
---|---|
ListProperty(Property parent,
Field field)
|
|
ListProperty(Property parent,
Field field,
int flags)
|
Method Summary | ||
---|---|---|
void |
accept(PropertyVisitor visitor,
Object arg)
Method that implement the visitor pattern. |
|
void |
add(int index,
Property element)
Throws UnsupportedOperationException, added to implement List |
|
boolean |
add(Property o)
Throws UnsupportedOperationException, added to implement List |
|
boolean |
addAll(Collection<? extends Property> c)
Throws UnsupportedOperationException, added to implement List |
|
boolean |
addAll(int index,
Collection<? extends Property> c)
Throws UnsupportedOperationException, added to implement List |
|
Property |
addEmpty()
Creates an empty child property and adds it as a property to the list container. |
|
Property |
addValue(int index,
Object value)
Inserts at the given position a new value to the list. |
|
Property |
addValue(Object value)
Appends a new value to the list. |
|
void |
applyListDiff(ListDiff ld)
Supports ListDiff for compatibility. |
|
static ArrayList<?> |
arrayToList(Object obj)
|
|
void |
clear()
|
|
Object |
clone()
|
|
boolean |
contains(Object o)
Throws UnsupportedOperationException, added to implement List |
|
boolean |
containsAll(Collection<?> c)
Throws UnsupportedOperationException, added to implement List |
|
|
convertTo(Serializable value,
Class<T> toType)
Converts the given normalized value to the given type. |
|
Property |
get(int index)
Get the child property given it's index. |
|
Property |
get(String name)
Gets the child property having the given name. |
|
Collection<Property> |
getChildren()
Get a collection over the children properties. |
|
Iterator<Property> |
getDirtyChildren()
Gets an iterator over the dirty children properties. |
|
Field |
getField()
Gets the field corresponding to this property. |
|
String |
getName()
Gets the property name. |
|
ListType |
getType()
Get the type of the field corresponding to this property. |
|
Serializable |
getValueForWrite()
Gets the property normalized value for write. |
|
int |
indexOf(Object o)
Throws UnsupportedOperationException, added to implement List |
|
int |
indexOf(Property property)
|
|
void |
init(Serializable value)
Initializes the property with the given normalized value. |
|
Serializable |
internalGetValue()
|
|
void |
internalSetValue(Serializable value)
Sets the given normalized value. |
|
boolean |
isContainer()
TODO FIXME XXX uncommented return true; see NXP-1653. |
|
boolean |
isEmpty()
|
|
boolean |
isNormalized(Object value)
Checks if the given value is a normalized one. |
|
boolean |
isSameAs(Property property)
Compare the two properties by content. |
|
int |
lastIndexOf(Object o)
Throws UnsupportedOperationException, added to implement List |
|
ListIterator<Property> |
listIterator()
Throws UnsupportedOperationException, added to implement List |
|
ListIterator<Property> |
listIterator(int index)
Throws UnsupportedOperationException, added to implement List |
|
Serializable |
normalize(Object value)
Normalizes the given value as dictated by the property type. |
|
Property |
remove(int index)
|
|
boolean |
remove(Object o)
Throws UnsupportedOperationException, added to implement List |
|
boolean |
remove(Property property)
|
|
boolean |
removeAll(Collection<?> c)
Throws UnsupportedOperationException, added to implement List |
|
boolean |
retainAll(Collection<?> c)
Throws UnsupportedOperationException, added to implement List |
|
Property |
set(int index,
Property element)
Throws UnsupportedOperationException, added to implement List |
|
void |
setValue(Object value)
Sets this property value. |
|
List<Property> |
subList(int fromIndex,
int toIndex)
Throws UnsupportedOperationException, added to implement List |
|
Object[] |
toArray()
|
|
|
toArray(T[] a)
|
Methods inherited from class org.nuxeo.ecm.core.api.model.impl.AbstractProperty |
---|
areFlagsSet, clearDirtyFlags, clearFlags, getData, getData, getDirtyFlags, getParent, getPath, getRoot, getSchema, getValue, getValue, getValue, getValue, isComplex, isDirty, isList, isModified, isMoved, isNew, isPhantom, isReadOnly, isRemoved, isScalar, isValidating, iterator, moveTo, newInstance, remove, removePhantomFlag, resolvePath, resolvePath, setData, setData, setFlags, setIsModified, setReadOnly, setValidating, setValue, setValue, size, toString, validate, validateType |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
equals, hashCode, iterator, size |
Constructor Detail |
---|
public ListProperty(Property parent, Field field)
public ListProperty(Property parent, Field field, int flags)
Method Detail |
---|
public void internalSetValue(Serializable value) throws PropertyException
AbstractProperty
This applies only for nodes that physically store a value (that means non container nodes). Container nodes does nothing.
internalSetValue
in class AbstractProperty
PropertyException
public boolean isContainer()
return true;
see NXP-1653.
isContainer
in interface Property
line 216
,
ListProperty#getValue}
,
ListProperty#accept}
public Property addValue(int index, Object value) throws PropertyException
Property
The created property will be marked as Property.isNew()
.
addValue
in interface Property
index
- the position to insert the value
PropertyException
public Property addValue(Object value) throws PropertyException
Property
The created property will be marked as Property.isNew()
.
addValue
in interface Property
PropertyException
public Property addEmpty()
Property
This method is useful to construct lists.
addEmpty
in interface Property
public Collection<Property> getChildren()
Property
The returned collection is ordered for list properties, and unordered for complex properties
Be aware that this method is creating phantom child properties for all schema fields that are not yet set.
getChildren
in interface Property
public String getName()
Property
getName
in interface Property
public ListType getType()
Property
getType
in interface Property
public Property get(String name)
Property
If the property is a scalar, this will return always null.
The given name should be the full name (i.e. prefixed name if any prefix exists).
If a non prefixed name is given, the first child property having the given local name will be returned.
Relative paths are not resolved. THis method is intended to lookup direct
children. For path lookups use Property.resolvePath(String)
instead.
get
in interface Property
name
- the child property name (the full name including the prefix
if any)
public Property get(int index)
Property
If this method is not supported an UnsupportedOperationException
must be thrown
Relative paths are not resolved. THis method is intended to lookup direct
chilren. For path lookups, use Property.resolvePath(String)
instead.
get
in interface List<Property>
get
in interface Property
public Serializable internalGetValue() throws PropertyException
internalGetValue
in class AbstractProperty
PropertyException
public Serializable getValueForWrite() throws PropertyException
Property
Can be different fropm Property.getValue()
in cases where the property
adapts the value it is given to store.
getValueForWrite
in interface Property
getValueForWrite
in class AbstractProperty
PropertyException
public void init(Serializable value) throws PropertyException
Property
The given value must be normalized - note that no check is done on that.
The phantom flag is unset by this operation.
This method should be used to initialize properties.
init
in interface Property
init
in class AbstractProperty
value
- the normalized value to set
PropertyException
public void setValue(Object value) throws PropertyException
Property
For complex or list properties the value will be set recursively (as a map or list value).
setValue
in interface Property
setValue
in class AbstractProperty
value
- the value to set
PropertyException
public void clear()
clear
in interface Collection<Property>
clear
in interface List<Property>
public Field getField()
Property
The field is the object defining the property. You can see the field as a java class and the property as a class instance
getField
in interface Property
public boolean remove(Property property)
public Property remove(int index)
remove
in interface List<Property>
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void accept(PropertyVisitor visitor, Object arg) throws PropertyException
Property
The visitor must return null to stop visiting children otherwise a context object that will be passed as the arg argument to children
accept
in interface Property
visitor
- the visitor to acceptarg
- an argument passed to the visitor. This should be used by the
visitor to carry on the visiting context.
PropertyException
public boolean isNormalized(Object value)
Property
Null values are considered as normalized.
isNormalized
in interface Property
isNormalized
in class AbstractProperty
value
- the value to check
public 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 type
PropertyConversionException
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 type
PropertyConversionException
- if the conversion cannot be made
because of type incompatibilitiespublic static ArrayList<?> arrayToList(Object obj)
public void applyListDiff(ListDiff ld) throws PropertyException
ld
-
PropertyException
public boolean isSameAs(Property property) throws PropertyException
Property
isSameAs
in interface Property
PropertyException
public Iterator<Property> getDirtyChildren()
Property
getDirtyChildren
in interface Property
public int indexOf(Property property)
public void add(int index, Property element)
add
in interface List<Property>
public boolean add(Property o)
add
in interface Collection<Property>
add
in interface List<Property>
public boolean addAll(Collection<? extends Property> c)
addAll
in interface Collection<Property>
addAll
in interface List<Property>
public boolean addAll(int index, Collection<? extends Property> c)
addAll
in interface List<Property>
public boolean contains(Object o)
contains
in interface Collection<Property>
contains
in interface List<Property>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<Property>
containsAll
in interface List<Property>
public int indexOf(Object o)
indexOf
in interface List<Property>
public boolean isEmpty()
isEmpty
in interface Collection<Property>
isEmpty
in interface List<Property>
public int lastIndexOf(Object o)
lastIndexOf
in interface List<Property>
public ListIterator<Property> listIterator()
listIterator
in interface List<Property>
public ListIterator<Property> listIterator(int index)
listIterator
in interface List<Property>
public boolean remove(Object o)
remove
in interface Collection<Property>
remove
in interface List<Property>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<Property>
removeAll
in interface List<Property>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<Property>
retainAll
in interface List<Property>
public Property set(int index, Property element)
set
in interface List<Property>
public List<Property> subList(int fromIndex, int toIndex)
subList
in interface List<Property>
public Object[] toArray()
toArray
in interface Collection<Property>
toArray
in interface List<Property>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<Property>
toArray
in interface List<Property>
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |