Source Code Cross Referenced for ProcessingInstructionImpl.java in  » XML » xerces-2_9_1 » org » apache » xerces » dom » 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 » XML » xerces 2_9_1 » org.apache.xerces.dom 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        package org.apache.xerces.dom;
019:
020:        import org.w3c.dom.Node;
021:        import org.w3c.dom.ProcessingInstruction;
022:
023:        /**
024:         * Processing Instructions (PIs) permit documents to carry
025:         * processor-specific information alongside their actual content. PIs
026:         * are most common in XML, but they are supported in HTML as well.
027:         *
028:         * This class inherits from CharacterDataImpl to reuse its setNodeValue method.
029:         * 
030:         * @xerces.internal
031:         *
032:         * @version $Id: ProcessingInstructionImpl.java 447266 2006-09-18 05:57:49Z mrglavas $
033:         * @since  PR-DOM-Level-1-19980818.
034:         */
035:        public class ProcessingInstructionImpl extends CharacterDataImpl
036:                implements  ProcessingInstruction {
037:
038:            //
039:            // Constants
040:            //
041:
042:            /** Serialization version. */
043:            static final long serialVersionUID = 7554435174099981510L;
044:
045:            //
046:            // Data
047:            //
048:
049:            protected String target;
050:
051:            //
052:            // Constructors
053:            //
054:
055:            /** Factory constructor. */
056:            public ProcessingInstructionImpl(CoreDocumentImpl ownerDoc,
057:                    String target, String data) {
058:                super (ownerDoc, data);
059:                this .target = target;
060:            }
061:
062:            //
063:            // Node methods
064:            //
065:
066:            /**
067:             * A short integer indicating what type of node this is. The named
068:             * constants for this value are defined in the org.w3c.dom.Node interface.
069:             */
070:            public short getNodeType() {
071:                return Node.PROCESSING_INSTRUCTION_NODE;
072:            }
073:
074:            /**
075:             * Returns the target
076:             */
077:            public String getNodeName() {
078:                if (needsSyncData()) {
079:                    synchronizeData();
080:                }
081:                return target;
082:            }
083:
084:            //
085:            // ProcessingInstruction methods
086:            //
087:
088:            /**
089:             * A PI's "target" states what processor channel the PI's data
090:             * should be directed to. It is defined differently in HTML and XML.
091:             * <p>
092:             * In XML, a PI's "target" is the first (whitespace-delimited) token
093:             * following the "<?" token that begins the PI.
094:             * <p>
095:             * In HTML, target is always null.
096:             * <p>
097:             * Note that getNodeName is aliased to getTarget.
098:             */
099:            public String getTarget() {
100:                if (needsSyncData()) {
101:                    synchronizeData();
102:                }
103:                return target;
104:
105:            } // getTarget():String
106:
107:            /**
108:             * A PI's data content tells the processor what we actually want it
109:             * to do.  It is defined slightly differently in HTML and XML.
110:             * <p>
111:             * In XML, the data begins with the non-whitespace character
112:             * immediately after the target -- @see getTarget().
113:             * <p>
114:             * In HTML, the data begins with the character immediately after the
115:             * "&lt;?" token that begins the PI.
116:             * <p>
117:             * Note that getNodeValue is aliased to getData
118:             */
119:            public String getData() {
120:                if (needsSyncData()) {
121:                    synchronizeData();
122:                }
123:                return data;
124:
125:            } // getData():String
126:
127:            /**
128:             * Change the data content of this PI.
129:             * Note that setData is aliased to setNodeValue.
130:             * @see #getData().
131:             * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is read-only.
132:             */
133:            public void setData(String data) {
134:                // Hand off to setNodeValue for code-reuse reasons (mutation
135:                // events, readonly protection, synchronizing, etc.)
136:                setNodeValue(data);
137:            } // setData(String)
138:
139:            /**
140:             * Returns the absolute base URI of this node or null if the implementation
141:             * wasn't able to obtain an absolute URI. Note: If the URI is malformed, a
142:             * null is returned.
143:             * 
144:             * @return The absolute base URI of this node or null.
145:             * @since DOM Level 3
146:             */
147:            public String getBaseURI() {
148:
149:                if (needsSyncData()) {
150:                    synchronizeData();
151:                }
152:                return ownerNode.getBaseURI();
153:            }
154:
155:        } // class ProcessingInstructionImpl
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.