Source Code Cross Referenced for DetailImpl.java in  » Web-Services » saaj » com » sun » xml » messaging » saaj » soap » impl » 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 » Web Services » saaj » com.sun.xml.messaging.saaj.soap.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the terms
003:         * of the Common Development and Distribution License
004:         * (the "License").  You may not use this file except
005:         * in compliance with the License.
006:         *
007:         * You can obtain a copy of the license at
008:         * https://jwsdp.dev.java.net/CDDLv1.0.html
009:         * See the License for the specific language governing
010:         * permissions and limitations under the License.
011:         *
012:         * When distributing Covered Code, include this CDDL
013:         * HEADER in each file and include the License file at
014:         * https://jwsdp.dev.java.net/CDDLv1.0.html  If applicable,
015:         * add the following below this CDDL HEADER, with the
016:         * fields enclosed by brackets "[]" replaced with your
017:         * own identifying information: Portions Copyright [yyyy]
018:         * [name of copyright owner]
019:         */
020:        /*
021:         * $Id: DetailImpl.java,v 1.3 2007/08/23 10:54:47 kumarjayanti Exp $
022:         * $Revision: 1.3 $
023:         * $Date: 2007/08/23 10:54:47 $
024:         */
025:
026:        package com.sun.xml.messaging.saaj.soap.impl;
027:
028:        import java.util.Iterator;
029:        import java.util.NoSuchElementException;
030:
031:        import javax.xml.namespace.QName;
032:        import javax.xml.soap.*;
033:
034:        import org.w3c.dom.Element;
035:
036:        import com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl;
037:        import com.sun.xml.messaging.saaj.soap.name.NameImpl;
038:
039:        public abstract class DetailImpl extends FaultElementImpl implements 
040:                Detail {
041:            public DetailImpl(SOAPDocumentImpl ownerDoc, NameImpl detailName) {
042:                super (ownerDoc, detailName);
043:            }
044:
045:            protected abstract DetailEntry createDetailEntry(Name name);
046:
047:            protected abstract DetailEntry createDetailEntry(QName name);
048:
049:            public DetailEntry addDetailEntry(Name name) throws SOAPException {
050:                DetailEntry entry = createDetailEntry(name);
051:                addNode(entry);
052:                return (DetailEntry) circumventBug5034339(entry);
053:            }
054:
055:            public DetailEntry addDetailEntry(QName qname) throws SOAPException {
056:                DetailEntry entry = createDetailEntry(qname);
057:                addNode(entry);
058:                return (DetailEntry) circumventBug5034339(entry);
059:            }
060:
061:            protected SOAPElement addElement(Name name) throws SOAPException {
062:                return addDetailEntry(name);
063:            }
064:
065:            protected SOAPElement addElement(QName name) throws SOAPException {
066:                return addDetailEntry(name);
067:            }
068:
069:            protected SOAPElement convertToSoapElement(Element element) {
070:                if (element instanceof  DetailEntry) {
071:                    return (SOAPElement) element;
072:                } else {
073:                    DetailEntry detailEntry = createDetailEntry(NameImpl
074:                            .copyElementName(element));
075:                    return replaceElementWithSOAPElement(element,
076:                            (ElementImpl) detailEntry);
077:                }
078:            }
079:
080:            public Iterator getDetailEntries() {
081:                return new Iterator() {
082:                    Iterator eachNode = getChildElementNodes();
083:                    SOAPElement next = null;
084:                    SOAPElement last = null;
085:
086:                    public boolean hasNext() {
087:                        if (next == null) {
088:                            while (eachNode.hasNext()) {
089:                                next = (SOAPElement) eachNode.next();
090:                                if (next instanceof  DetailEntry) {
091:                                    break;
092:                                }
093:                                next = null;
094:                            }
095:                        }
096:                        return next != null;
097:                    }
098:
099:                    public Object next() {
100:                        if (!hasNext()) {
101:                            throw new NoSuchElementException();
102:                        }
103:                        last = next;
104:                        next = null;
105:                        return last;
106:                    }
107:
108:                    public void remove() {
109:                        if (last == null) {
110:                            throw new IllegalStateException();
111:                        }
112:                        SOAPElement target = last;
113:                        removeChild(target);
114:                        last = null;
115:                    }
116:                };
117:            }
118:
119:            protected boolean isStandardFaultElement() {
120:                return true;
121:            }
122:
123:            //overriding this method since the only two uses of this method 
124:            // are in ElementImpl and DetailImpl
125:            //whereas the original base impl does the correct job for calls to it inside ElementImpl
126:            // But it would not work for DetailImpl.
127:            protected SOAPElement circumventBug5034339(SOAPElement element) {
128:
129:                Name elementName = element.getElementName();
130:                if (!isNamespaceQualified(elementName)) {
131:                    String prefix = elementName.getPrefix();
132:                    String defaultNamespace = getNamespaceURI(prefix);
133:                    if (defaultNamespace != null) {
134:                        Name newElementName = NameImpl.create(elementName
135:                                .getLocalName(), elementName.getPrefix(),
136:                                defaultNamespace);
137:                        SOAPElement newElement = createDetailEntry(newElementName);
138:                        replaceChild(newElement, element);
139:                        return newElement;
140:                    }
141:                }
142:                return element;
143:            }
144:
145:        }
w___w___w_.j_a_v___a___2__s__.___com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.