org.itsnat.core.event
Class NodePropertyTransport

java.lang.Object
  extended by org.itsnat.core.event.ParamTransport
      extended by org.itsnat.core.event.SingleParamTransport
          extended by org.itsnat.core.event.NodePropertyTransport
All Implemented Interfaces:
java.io.Serializable

public class NodePropertyTransport
extends SingleParamTransport

Is used to command ItsNat to transport the specified node property of a client element and optionally synchronize it with the matched server element as an attribute.

After synchronization the server DOM element has the same attribute value as the client property counterpart. If the client property value is null the server element attribute will be removed too.

With or without synchronization the property value can be obtained calling ItsNatEvent.getExtraParam(String)

Author:
Jose Maria Arranz Santamaria
See Also:
ItsNatDocument.addEventListener(org.w3c.dom.events.EventTarget,String,org.w3c.dom.events.EventListener,boolean,int,ParamTransport[],String,long), Serialized Form

Constructor Summary
NodePropertyTransport(java.lang.String name)
          Creates a new instance ready to transport the node property with the specified name and synchronize it at the server side as an attribute, the attribute name used is the same as the property name.
NodePropertyTransport(java.lang.String name, boolean sync)
          Creates a new instance ready to transport the node property with the specified name and optionally synchronize it at the server side as an attribute, the attribute name used is the same as the property name.
NodePropertyTransport(java.lang.String name, java.lang.Class type)
          Creates a new instance ready to transport the node property with the specified name and synchronize it at the server side as an attribute.
NodePropertyTransport(java.lang.String name, java.lang.Class type, java.lang.String javaSetMethodName)
          Creates a new instance ready to transport the node property with the specified name and synchronize it at the server side as an attribute.
NodePropertyTransport(java.lang.String name, java.lang.String attName)
          Creates a new instance ready to transport the node property with the specified name and synchronize it at the server side as an attribute with the specified name.
 
Method Summary
 java.lang.String getAttrName()
          Returns the attribute name.
 java.lang.String getJavaSetMethodName()
          Returns the method name used to synchronize using reflection.
 java.lang.Class getType()
          Returns the class type of the property value when using reflection to synchronize.
 
Methods inherited from class org.itsnat.core.event.SingleParamTransport
getName
 
Methods inherited from class org.itsnat.core.event.ParamTransport
isSync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodePropertyTransport

public NodePropertyTransport(java.lang.String name)
Creates a new instance ready to transport the node property with the specified name and synchronize it at the server side as an attribute, the attribute name used is the same as the property name.

Parameters:
name - the property name.

NodePropertyTransport

public NodePropertyTransport(java.lang.String name,
                             boolean sync)
Creates a new instance ready to transport the node property with the specified name and optionally synchronize it at the server side as an attribute, the attribute name used is the same as the property name.

Parameters:
name - the property name.
sync - if true the server is updated.

NodePropertyTransport

public NodePropertyTransport(java.lang.String name,
                             java.lang.String attName)
Creates a new instance ready to transport the node property with the specified name and synchronize it at the server side as an attribute with the specified name.

Use this constructor when the property name differs from the attribute name.

Parameters:
name - the property name.
attName - the attribute name.

NodePropertyTransport

public NodePropertyTransport(java.lang.String name,
                             java.lang.Class type)
Creates a new instance ready to transport the node property with the specified name and synchronize it at the server side as an attribute. The synchronization is done using reflection calling the method setName(Class type) of the target DOM element.

For instance: if specified name is "value" and specified type is String, the method called will be setValue(String)

Parameters:
name - the property name.
type - the class type of the property.

NodePropertyTransport

public NodePropertyTransport(java.lang.String name,
                             java.lang.Class type,
                             java.lang.String javaSetMethodName)
Creates a new instance ready to transport the node property with the specified name and synchronize it at the server side as an attribute. The synchronization is done using reflection calling the set method with the specified name of the target DOM element.

For instance: if specified method name is "setValue" and specified type is String, the method called will be setValue(String)

Parameters:
name - the property name.
type - the class type of the property.
Method Detail

getAttrName

public java.lang.String getAttrName()
Returns the attribute name.

Returns:
the attribute name or null if reflection is used to synchronize.

getType

public java.lang.Class getType()
Returns the class type of the property value when using reflection to synchronize.

Returns:
the class type or null if reflection is not used to synchronize.

getJavaSetMethodName

public java.lang.String getJavaSetMethodName()
Returns the method name used to synchronize using reflection.

Returns:
the method name or null if reflection is not used to synchronize.


Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.