Source Code Cross Referenced for LZSOAPPart.java in  » Ajax » Laszlo-4.0.10 » org » openlaszlo » remote » swf » soap » 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 » Laszlo 4.0.10 » org.openlaszlo.remote.swf.soap 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* *****************************************************************************
002:         * LZSOAPPart.java
003:         * ****************************************************************************/
004:
005:        /* J_LZ_COPYRIGHT_BEGIN *******************************************************
006:         * Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
007:         * Use is subject to license terms.                                            *
008:         * J_LZ_COPYRIGHT_END *********************************************************/
009:
010:        package org.openlaszlo.remote.swf.soap;
011:
012:        import java.math.BigDecimal;
013:        import java.net.URI;
014:        import javax.xml.namespace.QName;
015:        import javax.xml.rpc.ParameterMode;
016:        import javax.xml.rpc.ServiceException;
017:        import org.apache.axis.Constants;
018:        import org.apache.log4j.Logger;
019:
020:        public class LZSOAPPart {
021:            public static Logger mLogger = Logger.getLogger(LZSOAPPart.class);
022:
023:            String mName = null;
024:            String mElement = null;
025:            ComplexType mType = null;
026:
027:            // Only used when soap message is in request and is rpc
028:            ParameterMode mParameterMode = ParameterMode.IN;
029:
030:            public LZSOAPPart(String name) {
031:                mName = name;
032:            }
033:
034:            public String getName() {
035:                return mName;
036:            }
037:
038:            public String getElement() {
039:                return mElement;
040:            }
041:
042:            public ComplexType getType() {
043:                return mType;
044:            }
045:
046:            public ParameterMode getParameterMode() {
047:                return mParameterMode;
048:            }
049:
050:            public void setName(String name) {
051:                mName = name;
052:            }
053:
054:            public void setElement(String element) {
055:                mElement = element;
056:            }
057:
058:            public void setType(ComplexType type) {
059:                mType = type;
060:            }
061:
062:            public void setParameterMode(ParameterMode parameterMode) {
063:                mParameterMode = parameterMode;
064:            }
065:
066:            /**
067:             * Convert string to object value based on part type.
068:             * @param param string to convert to object based on part type.
069:             * @return object value of string based on part type. 
070:             * @throws SOAPException if value can't be converted.
071:             */
072:            public Object valueOf(String param) throws ServiceException {
073:
074:                // TODO: [2007-06-28 pkang] return more values based on
075:                // Constants.XSD_XXX
076:                try {
077:
078:                    //----------------------------------------------------------------
079:                    // From Constants.equals(QName first, QName second)
080:                    //
081:                    // The first QName is the current version of the name.  The second
082:                    // qname is compared with the first considering all namespace uri
083:                    // versions.
084:                    //----------------------------------------------------------------
085:
086:                    QName typeQName = mType.getName();
087:                    if (Constants.equals(Constants.XSD_INT, typeQName)) {
088:                        return Integer.valueOf(param);
089:                    } else if (Constants.equals(Constants.XSD_LONG, typeQName)) {
090:                        return Long.valueOf(param);
091:                    } else if (Constants.equals(Constants.XSD_FLOAT, typeQName)) {
092:                        return Float.valueOf(param);
093:                    } else if (Constants
094:                            .equals(Constants.XSD_DOUBLE, typeQName)) {
095:                        return Double.valueOf(param);
096:                    } else if (Constants.equals(Constants.XSD_BOOLEAN,
097:                            typeQName)) {
098:                        return Boolean.valueOf(param);
099:                    } else if (Constants.equals(Constants.XSD_DECIMAL,
100:                            typeQName)) {
101:                        return new BigDecimal(param);
102:                    } else if (Constants.equals(Constants.XSD_SHORT, typeQName)) {
103:                        return Short.valueOf(param);
104:                    } else if (Constants.equals(Constants.XSD_BYTE, typeQName)) {
105:                        return Byte.valueOf(param);
106:                    } else if (Constants
107:                            .equals(Constants.XSD_ANYURI, typeQName)) {
108:                        return new URI(param);
109:                    }
110:                    return param;
111:                } catch (Exception e) {
112:                    mLogger.error(e.getMessage());
113:                    throw new ServiceException(e.getMessage());
114:                }
115:            }
116:
117:            public void toXML(StringBuffer sb) {
118:                sb.append("<part ").append(" name=\"").append(mName).append(
119:                        "\"").append(" element=\"").append(mElement).append(
120:                        "\"").append(" type=\"").append(mType.getName())
121:                        .append("\"").append(" parameterMode=\"").append(
122:                                mParameterMode).append("\"").append("/>");
123:            }
124:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.