org.spicefactory.pimento.metamodel.impl
Class ManagedPropertyImpl

java.lang.Object
  extended by org.spicefactory.pimento.metamodel.impl.ManagedPropertyImpl
All Implemented Interfaces:
Externalizable, ManagedProperty
Direct Known Subclasses:
AttributeImpl, CollectionImpl

public abstract class ManagedPropertyImpl
extends Object
implements ManagedProperty, Externalizable

Default implementation of the Embeddable interface.

Author:
Jens Halm

Constructor Summary
ManagedPropertyImpl(PropertyHandler handler, Property property, int index)
          Creates a new instance.
 
Method Summary
 PropertyHandler getHandler()
          The handler of the property, responsible for converting values to and from snapshots.
 int getIndex()
          Returns the index position of the property.
 Property getProperty()
          Returns the reflection type of the managed property.
 boolean isReadOnly()
          Indicates whether this property is read-only from the perspective of the client.
 boolean isRefreshable()
          Indicates whether this property is refreshable from the perspective of the client.
 void readExternal(DataInput input)
          Restores the content of this object from the DataInput instance.
 void writeExternal(DataOutput output)
          Saves the content of this object to the DataOutput instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedPropertyImpl

public ManagedPropertyImpl(PropertyHandler handler,
                           Property property,
                           int index)
Creates a new instance.

Parameters:
handler - the handler responsible for encoding and decoding snapshot values
property - the reflection property
index - the index position of this property in the managed entity
Method Detail

getIndex

public int getIndex()
Description copied from interface: ManagedProperty
Returns the index position of the property. When exchanging partial snapshots Pimento send only the index position and not the property name as the identifier to save some bandwith.

Specified by:
getIndex in interface ManagedProperty
Returns:
the index position of the property

getHandler

public PropertyHandler getHandler()
Description copied from interface: ManagedProperty
The handler of the property, responsible for converting values to and from snapshots.

Specified by:
getHandler in interface ManagedProperty
Returns:
the handler of the property, responsible for converting values to and from snapshots.

getProperty

public Property getProperty()
Description copied from interface: ManagedProperty
Returns the reflection type of the managed property.

Specified by:
getProperty in interface ManagedProperty
Returns:
the reflection type of the managed property.

isRefreshable

public boolean isRefreshable()
Description copied from interface: ManagedProperty
Indicates whether this property is refreshable from the perspective of the client. A refreshable property will be automatically synchronized in the client whenever that client persists or merges an entity that contains such a property. It does not synchronize other connected clients though.

Specified by:
isRefreshable in interface ManagedProperty
Returns:
true if this property is refreshable from the perspective of the client

isReadOnly

public boolean isReadOnly()
Description copied from interface: ManagedProperty
Indicates whether this property is read-only from the perspective of the client. If this property is true any attempt from a Flex/Flash client to change the property value will lead to an Exception. Changes caused by Java code are not affected by this setting.

Specified by:
isReadOnly in interface ManagedProperty
Returns:
true if this property is read-only from the perspective of the client

readExternal

public void readExternal(DataInput input)
Description copied from interface: Externalizable
Restores the content of this object from the DataInput instance. Values must be read in the same sequence as they were written on the client side.

Specified by:
readExternal in interface Externalizable
Parameters:
input - the AMF3 data to read from

writeExternal

public void writeExternal(DataOutput output)
Description copied from interface: Externalizable
Saves the content of this object to the DataOutput instance.

Specified by:
writeExternal in interface Externalizable
Parameters:
output - the output to write to