Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.model
Interface Property

All Known Subinterfaces:
SQLDocument
All Known Implementing Classes:
SQLBaseProperty, SQLCollectionProperty, SQLComplexListProperty, SQLComplexProperty, SQLContentProperty, SQLDocumentLive, SQLDocumentProxy, SQLDocumentVersion, SQLSimpleProperty

public interface Property

This class describes a document property.

Properties are lazily created. This means a property can be retrieved - using getProperty(name)) on the container - even if it not already exists but was defined by the container schema.

The first time a write operation is invoked on such a property, the property will be created by the underlying storage.

Author:
Bogdan Stefanescu

Method Summary
 String getName()
          Gets the name used to identify this property by its container.
 Collection<Property> getProperties()
          Gets the collection of the children properties.
 Property getProperty(String name)
          Gets the children property given its name.
 Iterator<Property> getPropertyIterator()
          Gets an iterator over the children properties.
 Type getType()
          Gets the property type.
 Object getValue()
          Gets the value of this property.
 boolean isNull()
          Tests whether or not this property is null.
 boolean isPropertySet(String name)
          Checks whether this property has child property with the given name.
 void setNull()
          Nullify this property.
 void setValue(Object value)
          Sets the value of this property.
 

Method Detail

getName

String getName()
               throws DocumentException
Gets the name used to identify this property by its container.

If the container of this property is not supporting accessing properties by names, returns the empty string.

Returns:
the object name or the empty string if the object has no name
Throws:
DocumentException - if the type cannot be resolved

getType

Type getType()
Gets the property type.

Returns:
the property type

getValue

Object getValue()
                throws DocumentException
Gets the value of this property.

Returns:
this property's value
Throws:
DocumentException

setValue

void setValue(Object value)
              throws DocumentException
Sets the value of this property.

Parameters:
value - the value to set
Throws:
DocumentException

isNull

boolean isNull()
Tests whether or not this property is null.

A null property means that it is defined by the container schema but was not yet set (so it may not exists as a persistent object)

If the property is null the first time a write operation is done on it the property will be created by the underlying storage

Returns:
true if the property is null, false otherwise

setNull

void setNull()
             throws DocumentException
Nullify this property.

The property is set to null which may result in being removed from the storage (this aspect depends on the implementation)

Throws:
DocumentException

isPropertySet

boolean isPropertySet(String name)
                      throws DocumentException
Checks whether this property has child property with the given name.

Returns:
true if this property has children properties, false otherwise
Throws:
DocumentException
UnsupportedOperationException - if this is not a composite property

getProperty

Property getProperty(String name)
                     throws DocumentException
Gets the children property given its name.

Parameters:
name - the property name
Returns:
the property
Throws:
DocumentException
UnsupportedOperationException - if this is not a composite property

getProperties

Collection<Property> getProperties()
                                   throws DocumentException
Gets the collection of the children properties.

Returns:
an iterator over the children properties
Throws:
DocumentException
UnsupportedOperationException - if this is not a composite property

getPropertyIterator

Iterator<Property> getPropertyIterator()
                                       throws DocumentException
Gets an iterator over the children properties.

Returns:
an iterator over the children properties
Throws:
DocumentException
UnsupportedOperationException - if this is not a composite property

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.