Source Code Cross Referenced for NodePropertyTransport.java in  » Ajax » ItsNat » org » itsnat » core » event » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » ItsNat » org.itsnat.core.event 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:          ItsNat Java Web Application Framework
003:          Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
004:          Author: Jose Maria Arranz Santamaria
005:
006:          This program is free software: you can redistribute it and/or modify
007:          it under the terms of the GNU Affero General Public License as published by
008:          the Free Software Foundation, either version 3 of the License, or
009:          (at your option) any later version. See the GNU Affero General Public 
010:          License for more details. See the copy of the GNU Affero General Public License
011:          included in this program. If not, see <http://www.gnu.org/licenses/>.
012:         */
013:        package org.itsnat.core.event;
014:
015:        /**
016:         * Is used to command ItsNat to transport the specified node property of a client
017:         * element and optionally synchronize it with the matched server element as an attribute.
018:         *
019:         * <p>After synchronization the server DOM element has the same attribute value 
020:         * as the client property counterpart. If the client property value is null 
021:         * the server element attribute will be removed too.</p>
022:         *
023:         * <p>With or without synchronization the property value can be obtained
024:         * calling {@link org.itsnat.core.event.ItsNatEvent#getExtraParam(String)}</p>
025:         * 
026:         * @see org.itsnat.core.ItsNatDocument#addEventListener(org.w3c.dom.events.EventTarget,String,org.w3c.dom.events.EventListener,boolean,int,ParamTransport[],String,long)
027:         * @author Jose Maria Arranz Santamaria
028:         */
029:        public class NodePropertyTransport extends SingleParamTransport {
030:            private String javaSetMethodName;
031:            private Class type;
032:            private String attName;
033:
034:            /**
035:             * Creates a new instance ready to transport the node property with the specified name
036:             * and synchronize it at the server side as an attribute, the attribute name used is the same 
037:             * as the property name.
038:             *
039:             * @param name the property name.    
040:             */
041:            public NodePropertyTransport(String name) {
042:                this (name, name, true);
043:            }
044:
045:            /**
046:             * Creates a new instance ready to transport the node property with the specified name
047:             * and optionally synchronize it at the server side as an attribute, the attribute name used is the same 
048:             * as the property name.
049:             * 
050:             * 
051:             * @param name the property name.
052:             * @param sync if true the server is updated.
053:             */
054:            public NodePropertyTransport(String name, boolean sync) {
055:                this (name, name, sync);
056:            }
057:
058:            /**
059:             * Creates a new instance ready to transport the node property with the specified name
060:             * and synchronize it at the server side as an attribute with the specified name.
061:             *
062:             * <p>Use this constructor when the property name differs from the attribute name.</p>
063:             *
064:             * @param name the property name.    
065:             * @param attName the attribute name.    
066:             */
067:            public NodePropertyTransport(String name, String attName) {
068:                this (name, attName, true);
069:            }
070:
071:            private NodePropertyTransport(String name, String attName,
072:                    boolean sync) {
073:                // No hacemos público este constructor pues si se especifica el nombre del atributo
074:                // como diferente a la propiedad es que queremos sincronizar seguro.
075:                super (name, sync);
076:
077:                this .attName = attName;
078:
079:                this .type = null;
080:
081:                this .javaSetMethodName = null;
082:            }
083:
084:            /**
085:             * Creates a new instance ready to transport the node property with the specified name
086:             * and synchronize it at the server side as an attribute. The synchronization is 
087:             * done using reflection calling the method set<i>Name</i>(<i>Class type</i>) 
088:             * of the target DOM element.
089:             *
090:             * <p>For instance: if specified name is "value" and specified type is String,
091:             * the method called will be <code>setValue(String)</code></p>
092:             *
093:             * @param name the property name.    
094:             * @param type the class type of the property.
095:             */
096:            public NodePropertyTransport(String name, Class type) {
097:                super (name, true);
098:
099:                this .type = type;
100:
101:                String javaMethodName = Character.toUpperCase(name.charAt(0))
102:                        + name.substring(1);
103:                this .javaSetMethodName = "set" + javaMethodName;
104:                this .attName = null;
105:            }
106:
107:            /**
108:             * Creates a new instance ready to transport the node property with the specified name
109:             * and synchronize it at the server side as an attribute. The synchronization is 
110:             * done using reflection calling the set method with the specified name 
111:             * of the target DOM element.
112:             *
113:             * <p>For instance: if specified method name is "setValue" and specified type is String,
114:             * the method called will be <code>setValue(String)</code></p>
115:             *
116:             * @param name the property name.    
117:             * @param type the class type of the property.
118:             */
119:            public NodePropertyTransport(String name, Class type,
120:                    String javaSetMethodName) {
121:                super (name, true);
122:
123:                this .type = type;
124:                this .javaSetMethodName = javaSetMethodName;
125:                this .attName = null;
126:            }
127:
128:            /**
129:             * Returns the attribute name.
130:             * 
131:             * @return the attribute name or null if reflection is used to synchronize.
132:             */
133:            public String getAttrName() {
134:                return attName;
135:            }
136:
137:            /**
138:             * Returns the class type of the property value when using reflection to synchronize.
139:             * 
140:             * @return the class type or null if reflection is not used to synchronize.
141:             */
142:            public Class getType() {
143:                return type;
144:            }
145:
146:            /**
147:             * Returns the method name used to synchronize using reflection.
148:             * 
149:             * @return the method name or null if reflection is not used to synchronize.
150:             */
151:            public String getJavaSetMethodName() {
152:                return javaSetMethodName;
153:            }
154:
155:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.