Source Code Cross Referenced for ProxyElementAdapter.java in  » J2EE » webwork-2.2.6 » com » opensymphony » webwork » views » xslt » 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 » J2EE » webwork 2.2.6 » com.opensymphony.webwork.views.xslt 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2002-2006 by OpenSymphony
003:         * All rights reserved.
004:         */
005:        package com.opensymphony.webwork.views.xslt;
006:
007:        import org.apache.commons.logging.Log;
008:        import org.apache.commons.logging.LogFactory;
009:        import org.w3c.dom.*;
010:        import java.util.List;
011:        import java.util.ArrayList;
012:
013:        /**
014:         * ProxyElementAdapter is a pass-through adapter for objects which already
015:         * implement the Element interface.  All methods are proxied to the underlying
016:         * Node except getParent(), getNextSibling() and getPreviousSibling(), which
017:         * are implemented by the abstract adapter node to work with the parent adapter.
018:         *
019:         * @author Pat Niemeyer (pat@pat.net)
020:         */
021:        /*
022:         Note: this class wants to be (extend) both an AbstractElementAdapter
023:         and ProxyElementAdapter, but its proxy-ness is winning right now.
024:         */
025:        public class ProxyElementAdapter extends ProxyNodeAdapter implements 
026:                Element {
027:            private Log log = LogFactory.getLog(this .getClass());
028:
029:            public ProxyElementAdapter(AdapterFactory factory,
030:                    AdapterNode parent, Element value) {
031:                super (factory, parent, value);
032:            }
033:
034:            /**
035:             * Get the proxied Element
036:             */
037:            protected Element element() {
038:                return (Element) getPropertyValue();
039:            }
040:
041:            protected List buildChildAdapters() {
042:                List adapters = new ArrayList();
043:                NodeList children = node().getChildNodes();
044:                for (int i = 0; i < children.getLength(); i++) {
045:                    Node child = children.item(i);
046:                    Node adapter = wrap(child);
047:                    if (adapter != null) {
048:                        log.debug("wrapped child node: " + child.getNodeName());
049:                        adapters.add(adapter);
050:                    }
051:                }
052:                return adapters;
053:            }
054:
055:            // Proxied Element methods
056:
057:            public String getTagName() {
058:                return element().getTagName();
059:            }
060:
061:            public boolean hasAttribute(String name) {
062:                return element().hasAttribute(name);
063:            }
064:
065:            public String getAttribute(String name) {
066:                return element().getAttribute(name);
067:            }
068:
069:            public boolean hasAttributeNS(String namespaceURI, String localName) {
070:                return element().hasAttributeNS(namespaceURI, localName);
071:            }
072:
073:            public Attr getAttributeNode(String name) {
074:                log.debug("wrapping attribute");
075:                return (Attr) wrap(element().getAttributeNode(name));
076:            }
077:
078:            // I'm overriding this just for clarity.  The base impl is correct.
079:            public NodeList getElementsByTagName(String name) {
080:                return super .getElementsByTagName(name);
081:            }
082:
083:            public String getAttributeNS(String namespaceURI, String localName) {
084:                return element().getAttributeNS(namespaceURI, localName);
085:            }
086:
087:            public Attr getAttributeNodeNS(String namespaceURI, String localName) {
088:                return (Attr) wrap(element().getAttributeNodeNS(namespaceURI,
089:                        localName));
090:            }
091:
092:            public NodeList getElementsByTagNameNS(String namespaceURI,
093:                    String localName) {
094:                return super .getElementsByTagNameNS(namespaceURI, localName);
095:            }
096:
097:            // Unsupported mutators of Element
098:
099:            public void removeAttribute(String name) throws DOMException {
100:                throw new UnsupportedOperationException();
101:            }
102:
103:            public void removeAttributeNS(String namespaceURI, String localName)
104:                    throws DOMException {
105:                throw new UnsupportedOperationException();
106:            }
107:
108:            public void setAttribute(String name, String value)
109:                    throws DOMException {
110:                throw new UnsupportedOperationException();
111:            }
112:
113:            public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
114:                throw new UnsupportedOperationException();
115:            }
116:
117:            public Attr setAttributeNode(Attr newAttr) throws DOMException {
118:                throw new UnsupportedOperationException();
119:            }
120:
121:            public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
122:                throw new UnsupportedOperationException();
123:            }
124:
125:            public void setAttributeNS(String namespaceURI,
126:                    String qualifiedName, String value) throws DOMException {
127:                throw new UnsupportedOperationException();
128:            }
129:
130:            // end proxied Element methods
131:
132:            // unsupported DOM level 3 methods
133:
134:            public TypeInfo getSchemaTypeInfo() {
135:                throw operationNotSupported();
136:            }
137:
138:            public void setIdAttribute(String string, boolean b)
139:                    throws DOMException {
140:                throw operationNotSupported();
141:            }
142:
143:            public void setIdAttributeNS(String string, String string1,
144:                    boolean b) throws DOMException {
145:                throw operationNotSupported();
146:            }
147:
148:            public void setIdAttributeNode(Attr attr, boolean b)
149:                    throws DOMException {
150:                throw operationNotSupported();
151:            }
152:
153:            // end DOM level 3 methods
154:
155:            public String toString() {
156:                return "ProxyElement for: " + element();
157:            }
158:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.