Source Code Cross Referenced for ElementImpl.java in  » Ajax » GWT » com » google » gwt » xml » client » 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 » Ajax » GWT » com.google.gwt.xml.client.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2007 Google Inc.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005:         * use this file except in compliance with the License. You may obtain a copy of
006:         * the License at
007:         * 
008:         * http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012:         * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013:         * License for the specific language governing permissions and limitations under
014:         * the License.
015:         */
016:        package com.google.gwt.xml.client.impl;
017:
018:        import com.google.gwt.core.client.JavaScriptException;
019:        import com.google.gwt.core.client.JavaScriptObject;
020:        import com.google.gwt.xml.client.Attr;
021:        import com.google.gwt.xml.client.DOMException;
022:        import com.google.gwt.xml.client.Element;
023:        import com.google.gwt.xml.client.NodeList;
024:
025:        /**
026:         * This method implements the Element interface.
027:         */
028:        class ElementImpl extends NodeImpl implements  Element {
029:
030:            protected ElementImpl(JavaScriptObject o) {
031:                super (o);
032:            }
033:
034:            /**
035:             * This function delegates to the native method <code>getAttribute</code> in
036:             * XMLParserImpl.
037:             */
038:            public String getAttribute(String tagName) {
039:                return XMLParserImpl.getAttribute(this .getJsObject(), tagName);
040:            }
041:
042:            /**
043:             * This function delegates to the native method <code>getAttributeNode</code>
044:             * in XMLParserImpl.
045:             */
046:            public Attr getAttributeNode(String tagName) {
047:                return (Attr) NodeImpl.build(XMLParserImpl.getAttributeNode(
048:                        this .getJsObject(), tagName));
049:            }
050:
051:            /**
052:             * This function delegates to the native method
053:             * <code>getElementsByTagName</code> in XMLParserImpl.
054:             */
055:            public NodeList getElementsByTagName(String tagName) {
056:                return new NodeListImpl(XMLParserImpl.getElementsByTagName(this 
057:                        .getJsObject(), tagName));
058:            }
059:
060:            /**
061:             * This function delegates to the native method <code>getTagName</code> in
062:             * XMLParserImpl.
063:             */
064:            public String getTagName() {
065:                return XMLParserImpl.getTagName(this .getJsObject());
066:            }
067:
068:            /**
069:             * This function delegates to the native method <code>hasAttribute</code> in
070:             * XMLParserImpl.
071:             */
072:            public boolean hasAttribute(String tagName) {
073:                return getAttribute(tagName) != null;
074:            }
075:
076:            /**
077:             * This function delegates to the native method <code>removeAttribute</code>
078:             * in XMLParserImpl.
079:             */
080:            public void removeAttribute(String name) throws DOMNodeException {
081:                try {
082:                    XMLParserImpl.removeAttribute(this .getJsObject(), name);
083:                } catch (JavaScriptException e) {
084:                    throw new DOMNodeException(
085:                            DOMException.INVALID_MODIFICATION_ERR, e, this );
086:                }
087:            }
088:
089:            /**
090:             * This function delegates to the native method <code>setAttribute</code> in
091:             * XMLParserImpl.
092:             */
093:            public void setAttribute(String name, String value)
094:                    throws DOMNodeException {
095:                try {
096:                    XMLParserImpl.setAttribute(this .getJsObject(), name, value);
097:                } catch (JavaScriptException e) {
098:                    throw new DOMNodeException(
099:                            DOMException.INVALID_MODIFICATION_ERR, e, this );
100:                }
101:            }
102:
103:            /**
104:             * This method returns the string representation of this 
105:             * <code>ElementImpl</code>.
106:             * @return the string representation of this 
107:             * <code>ElementImpl</code>.
108:             * @see java.lang.Object#toString()
109:             */
110:            @Override
111:            public String toString() {
112:                final StringBuffer b = new StringBuffer("<");
113:                b.append(getTagName());
114:                if (hasAttributes()) {
115:                    b.append(getAttributes().toString());
116:                }
117:                if (hasChildNodes()) {
118:                    b.append(">");
119:                    b.append(getChildNodes().toString());
120:                    b.append("</");
121:                    b.append(getTagName());
122:                    b.append(">");
123:                } else {
124:                    b.append("/>");
125:                }
126:                return b.toString();
127:            }
128:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.