com.yworks.yfiles.server.graphml.support
Class WrappingRoundtripMapper

java.lang.Object
  extended bycom.yworks.yfiles.server.graphml.support.WrappingRoundtripMapper
All Implemented Interfaces:
DataAcceptor, DataMap, DataProvider, IRoundtripMapper

public class WrappingRoundtripMapper
extends java.lang.Object
implements IRoundtripMapper

Default implementation of IRoundtripMapper that wraps an existing DataMap.


Constructor Summary
WrappingRoundtripMapper(DataMap delegate, java.lang.String name, KeyScope scope, KeyType type)
          A new instance using the provided DataMap to delegate to.
WrappingRoundtripMapper(DataMap delegate, java.lang.String name, KeyScope scope, KeyType type, boolean autoSerialize)
          A new instance using the provided DataMap to delegate to.
 
Method Summary
 java.lang.Object get(java.lang.Object dataHolder)
           
 boolean getBool(java.lang.Object dataHolder)
           
 double getDouble(java.lang.Object dataHolder)
           
 int getInt(java.lang.Object dataHolder)
           
 java.lang.String getName()
          The value of the attr.name property of the key element this data map is serialized to.
 KeyScope getScope()
          The scope this data map be serialized for.
 KeyType getType()
          The type of the data in this data map.
 boolean isAutoSerialize()
          Whether the content of this data map shall be auto serialized by the GraphRoundtripSupport.
 IRoundtripMapper register(Graph graph)
          Registers itself at the given graph using name property as tag.
 void set(java.lang.Object dataHolder, java.lang.Object value)
           
 void setBool(java.lang.Object dataHolder, boolean value)
           
 void setDouble(java.lang.Object dataHolder, double value)
           
 void setInt(java.lang.Object dataHolder, int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrappingRoundtripMapper

public WrappingRoundtripMapper(DataMap delegate,
                               java.lang.String name,
                               KeyScope scope,
                               KeyType type)
A new instance using the provided DataMap to delegate to. This constructor sets the autoSerialize property to false.

Parameters:
delegate - The DataMap delegate.
name - The name that shall be used for serialization.
scope - The scope that shall be used for serialization.
type - The type that shall be used for serialization.
See Also:
GraphRoundtripSupportBase.setAutoWriteMapperData(boolean)

WrappingRoundtripMapper

public WrappingRoundtripMapper(DataMap delegate,
                               java.lang.String name,
                               KeyScope scope,
                               KeyType type,
                               boolean autoSerialize)
A new instance using the provided DataMap to delegate to.

Parameters:
delegate - The DataMap delegate.
name - The name that shall be used for serialization.
scope - The scope that shall be used for serialization.
type - The type that shall be used for serialization.
autoSerialize - If this mapper shall be auto-serialized.
See Also:
GraphRoundtripSupportBase.setAutoWriteMapperData(boolean)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: IRoundtripMapper
The value of the attr.name property of the key element this data map is serialized to.

Specified by:
getName in interface IRoundtripMapper
Returns:
The value of the attr.name property of the key element this data map is serialized to.

getScope

public KeyScope getScope()
Description copied from interface: IRoundtripMapper
The scope this data map be serialized for.

Specified by:
getScope in interface IRoundtripMapper

getType

public KeyType getType()
Description copied from interface: IRoundtripMapper
The type of the data in this data map.

Specified by:
getType in interface IRoundtripMapper

isAutoSerialize

public boolean isAutoSerialize()
Description copied from interface: IRoundtripMapper
Whether the content of this data map shall be auto serialized by the GraphRoundtripSupport.

Specified by:
isAutoSerialize in interface IRoundtripMapper
Returns:
true if it shall be auto-serialized, false otherwise.

get

public java.lang.Object get(java.lang.Object dataHolder)
Specified by:
get in interface DataProvider

getInt

public int getInt(java.lang.Object dataHolder)
Specified by:
getInt in interface DataProvider

getDouble

public double getDouble(java.lang.Object dataHolder)
Specified by:
getDouble in interface DataProvider

getBool

public boolean getBool(java.lang.Object dataHolder)
Specified by:
getBool in interface DataProvider

set

public void set(java.lang.Object dataHolder,
                java.lang.Object value)
Specified by:
set in interface DataAcceptor

setInt

public void setInt(java.lang.Object dataHolder,
                   int value)
Specified by:
setInt in interface DataAcceptor

setDouble

public void setDouble(java.lang.Object dataHolder,
                      double value)
Specified by:
setDouble in interface DataAcceptor

setBool

public void setBool(java.lang.Object dataHolder,
                    boolean value)
Specified by:
setBool in interface DataAcceptor

register

public IRoundtripMapper register(Graph graph)
Registers itself at the given graph using name property as tag.

Parameters:
graph - The graph to register itself.
Returns:
this


Copyright © 2000-2013 yWorks GmbH. All rights reserved