01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.core.event;
15:
16: /**
17: * Is used to command ItsNat to transport the specified attribute of a client
18: * DOM element and optionally synchronize it with the matched server DOM element.
19: *
20: * <p>After synchronization the server element has the same attribute value
21: * as the client counterpart. If the client element has not the specified attribute
22: * the server element attribute will be removed too.</p>
23: *
24: * <p>With or without synchronization the attribute value can be obtained
25: * calling {@link org.itsnat.core.event.ItsNatEvent#getExtraParam(String)}</p>
26: *
27: * @see org.itsnat.core.ItsNatDocument#addEventListener(org.w3c.dom.events.EventTarget,String,org.w3c.dom.events.EventListener,boolean,int,ParamTransport[],String,long)
28: * @author Jose Maria Arranz Santamaria
29: */
30: public class NodeAttributeTransport extends SingleParamTransport {
31:
32: /**
33: * Creates a new instance ready to transport the attribute with the specified name
34: * and synchronize it at the server side.
35: *
36: * @param name the attribute name.
37: */
38: public NodeAttributeTransport(String name) {
39: this (name, true);
40: }
41:
42: /**
43: * Creates a new instance ready to transport the attribute with the specified name
44: * with optional server synchronization.
45: *
46: * @param name the attribute name.
47: * @param sync if true the server attribute is updated.
48: */
49: public NodeAttributeTransport(String name, boolean sync) {
50: super(name, sync);
51: }
52: }
|