org.eclipse.emf.cdo.client
Interface AttributeConverter

All Superinterfaces:
CDODataTypes, org.eclipse.net4j.spring.Loggable, org.eclipse.net4j.spring.Service
All Known Implementing Classes:
AttributeConverterImpl

public interface AttributeConverter
extends org.eclipse.net4j.spring.Service, CDODataTypes

Maps EDataType instances to CDO data type IDs and transfers attribute values between EObject and Channel instances.

An AttributeConverter may apply any sort of data type conversion to optimize the payload traffic through the Channel, as long as the corresponding AttributeConverter at server side is able to handle the specific data format.

Note: An AttributeConverter service is needed both at server and at client side (different interfaces). Their interpretations of the data type formats have to be identical under all circumstances! Otherwise unpredictable behaviour will occur, in the best case resulting in an OutOfSequenceException being thrown and always rendering the affected Channel unusable. Other channels of the same Connector are not affected.

See Also:
CDODataTypes

Field Summary
 
Fields inherited from interface org.eclipse.emf.cdo.core.CDODataTypes
BOOLEAN, BOOLEAN_OBJECT, BYTE, BYTE_OBJECT, CHAR, CHAR_OBJECT, DOUBLE, DOUBLE_OBJECT, FLOAT, FLOAT_OBJECT, INT, INT_OBJECT, LONG, LONG_OBJECT, MAX_PRIMITIVE, MIN_PRIMITIVE, SHORT, SHORT_OBJECT, STRING, USER_DEFINED
 
Method Summary
 void fromChannel(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EAttribute attribute, org.eclipse.net4j.core.Channel channel)
          Reads a value from a Channel and writes it to the given object attribute.
 int getCDODataType(org.eclipse.emf.ecore.EDataType eDataType)
          Returns the CDO data type ID (as specified in CDODataTypes) for the given EDataType instance.
 void toChannel(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EAttribute attribute, org.eclipse.net4j.core.Channel channel)
          Reads a value from an object attribute and writes it to the given Channel .
 
Methods inherited from interface org.eclipse.net4j.spring.Service
addStateListener, dump, getState, isActive, isAutoStart, isStarted, removeStateListener, start, stop, testSetState
 
Methods inherited from interface org.eclipse.net4j.spring.Loggable
debug, debug, error, error, fatal, fatal, getBeanName, getChild, getContainer, getFullBeanName, getLogger, info, info, isDebugEnabled, isErrorEnabled, isFatalEnabled, isInfoEnabled, isWarnEnabled, warn, warn
 

Method Detail

fromChannel

void fromChannel(org.eclipse.emf.ecore.EObject object,
                 org.eclipse.emf.ecore.EAttribute attribute,
                 org.eclipse.net4j.core.Channel channel)
Reads a value from a Channel and writes it to the given object attribute.

Parameters:
object - The object to store value in.
attribute - The attribute to store the value in.
channel - The channel to read the value from.

toChannel

void toChannel(org.eclipse.emf.ecore.EObject object,
               org.eclipse.emf.ecore.EAttribute attribute,
               org.eclipse.net4j.core.Channel channel)
Reads a value from an object attribute and writes it to the given Channel .

Parameters:
object - The object to read the value from.
attribute - The attribute to read the value from.
channel - The channel to write the value to.

getCDODataType

int getCDODataType(org.eclipse.emf.ecore.EDataType eDataType)
Returns the CDO data type ID (as specified in CDODataTypes) for the given EDataType instance.

Parameters:
eDataType - The EMF data type instance to map to the CDO type system.
Returns:
The CDO data type ID.

Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
All Rights Reserved.