Source Code Cross Referenced for KElement.java in  » Scripting » Kawa » gnu » kawa » xml » 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 » Scripting » Kawa » gnu.kawa.xml 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // Copyright (c) 2004  Per M.A. Bothner.
002:        // This is free software;  for terms and warranty disclaimer see ./COPYING.
003:
004:        package gnu.kawa.xml;
005:
006:        import gnu.xml.*;
007:
008:        /* #ifdef use:org.w3c.dom.Node */
009:        // import org.w3c.dom.*;
010:        /* #endif */
011:
012:        public class KElement extends KNode
013:        /* #ifdef use:org.w3c.dom.Node */
014:        // implements org.w3c.dom.Element
015:        /* #endif */
016:        {
017:            public KElement(NodeTree seq, int ipos) {
018:                super (seq, ipos);
019:            }
020:
021:            /* #ifdef use:org.w3c.dom.Node */
022:            // public short getNodeType () { return Node.ELEMENT_NODE; }
023:            /* #endif */
024:
025:            public String getTagName() {
026:                return sequence.getNextTypeName(ipos);
027:            }
028:
029:            public String getNodeValue() {
030:                return null;
031:            }
032:
033:            public boolean hasAttributes() {
034:                return ((NodeTree) sequence).posHasAttributes(ipos);
035:            }
036:
037:            public String getAttribute(String name) {
038:                if (name == null)
039:                    name = "";
040:                NodeTree nodes = (NodeTree) sequence;
041:                int attr = nodes.getAttribute(ipos, null, name);
042:                if (attr == 0)
043:                    return "";
044:                else
045:                    return KNode.getNodeValue(nodes, attr);
046:            }
047:
048:            /* #ifdef use:org.w3c.dom.Node */
049:            // /** Not implemented. */
050:            // public void setAttribute (String name, String value)
051:            //    throws DOMException
052:            // {
053:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
054:            //                          "setAttribute not supported");
055:            // }
056:            // /** Not implemented. */
057:            // public void setIdAttribute (String name, boolean isId)
058:            //    throws DOMException
059:            // {
060:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
061:            //                          "setIdAttribute not supported");
062:            // }
063:            // /** Not implemented. */
064:            // public void setIdAttributeNS (String namespaceURI, String localName,
065:            //                               boolean isId)
066:            //    throws DOMException
067:            // {
068:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
069:            //                          "setIdAttributeNS not supported");
070:            // }
071:            // /** Not implemented. */
072:            // public void setIdAttributeNode (Attr idAttr, boolean isId)
073:            //    throws DOMException
074:            // {
075:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
076:            //                          "setIdAttributeNode not supported");
077:            // }
078:            // /** Not implemented. */
079:            // public void removeAttribute (String name)
080:            //    throws DOMException
081:            // {
082:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
083:            //                          "removeAttribute not supported");
084:            // }
085:            /* #endif */
086:
087:            /* #ifdef JAVA5 */
088:            // public KAttr
089:            /* #else */
090:            /* #ifdef use:org.w3c.dom.Node */
091:            // public Attr
092:            /* #else */
093:            public KAttr
094:            /* #endif */
095:            /* #endif */
096:            getAttributeNode(String name) {
097:                if (name == null)
098:                    name = "";
099:                NodeTree nodes = (NodeTree) sequence;
100:                int attr = nodes.getAttribute(ipos, null, name);
101:                if (attr == 0)
102:                    return null;
103:                else
104:                    return new KAttr(nodes, attr);
105:            }
106:
107:            /* #ifdef use:org.w3c.dom.Node */
108:            // /** Not implemented. */
109:            //  public Attr setAttributeNode (Attr newAttr)
110:            //    throws DOMException
111:            // {
112:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
113:            //                          "setAttributeNode not supported");
114:            // }
115:            // /** Not implemented. */
116:            //  public Attr removeAttributeNode (Attr oldAttr)
117:            //    throws DOMException
118:            // {
119:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
120:            //                          "removeAttributeNode not supported");
121:            // }
122:            /* #endif */
123:
124:            public String getAttributeNS(String namespaceURI, String localName) {
125:                if (namespaceURI == null)
126:                    namespaceURI = "";
127:                if (localName == null)
128:                    localName = "";
129:                NodeTree nodes = (NodeTree) sequence;
130:                int attr = nodes.getAttribute(ipos, namespaceURI, localName);
131:                if (attr == 0)
132:                    return "";
133:                else
134:                    return getNodeValue(nodes, attr);
135:            }
136:
137:            /* #ifdef use:org.w3c.dom.Node */
138:            // /** Not implemented. */
139:            // public void setAttributeNS (String namespaceURI, String qualifiedName, 
140:            //                             String value) throws DOMException
141:            // {
142:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
143:            //                          "setAttributeNS not supported");
144:            // }
145:            /* #endif */
146:
147:            /* #ifdef use:org.w3c.dom.Node */
148:            // /** Not implemented. */
149:            // public void removeAttributeNS (String namespaceURI, String localName)
150:            //   throws DOMException
151:            // {
152:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
153:            //                          "removeAttributeNS not supported");
154:            // }
155:            /* #endif */
156:
157:            /* #ifdef JAVA5 */
158:            // public KAttr
159:            /* #else */
160:            /* #ifdef use:org.w3c.dom.Node */
161:            // public Attr
162:            /* #else */
163:            public KAttr
164:            /* #endif */
165:            /* #endif */
166:            getAttributeNodeNS(String namespaceURI, String localName) {
167:                if (namespaceURI == null)
168:                    namespaceURI = "";
169:                if (localName == null)
170:                    localName = "";
171:                NodeTree nodes = (NodeTree) sequence;
172:                int attr = nodes.getAttribute(ipos, namespaceURI, localName);
173:                if (attr == 0)
174:                    return null;
175:                else
176:                    return new KAttr(nodes, attr);
177:            }
178:
179:            /** Not implemented. */
180:            /* #ifdef use:org.w3c.dom.Node */
181:            // public Attr setAttributeNodeNS (Attr newAttr)
182:            //   throws DOMException
183:            // {
184:            //   throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
185:            //                          "setAttributeNodeNS not supported");
186:            // }
187:            /* #endif */
188:
189:            // Not implemented yet.
190:            /* #ifdef use:org.w3c.dom.Node */
191:            // public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
192:            // {
193:            //   throw new UnsupportedOperationException("getElementsByTagNameNS not implemented yet");
194:            // }
195:            /* #endif */
196:
197:            /** Not implemented yet. */
198:            public boolean hasAttribute(String name) {
199:                int attr = ((NodeTree) sequence).getAttribute(ipos, null,
200:                        name == null ? "" : name);
201:                return attr != 0;
202:            }
203:
204:            public boolean hasAttributeNS(String namespaceURI, String localName) {
205:                if (namespaceURI == null)
206:                    namespaceURI = "";
207:                if (localName == null)
208:                    localName = "";
209:                int attr = ((NodeTree) sequence).getAttribute(ipos,
210:                        namespaceURI, localName);
211:                return attr != 0;
212:            }
213:
214:            /* #ifdef JAXP-1.3 */
215:            // public TypeInfo getSchemaTypeInfo ()
216:            // {
217:            //   return null;
218:            // }
219:            /* #endif JAXP-1.3 */
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.