Source Code Cross Referenced for ProcessingInstructionEvent.java in  » 6.0-JDK-Modules » sjsxp » com » sun » xml » stream » events » 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 » 6.0 JDK Modules » sjsxp » com.sun.xml.stream.events 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: ProcessingInstructionEvent.java,v 1.2 2006/04/01 06:01:34 jeffsuttor Exp $
003:         */
004:
005:        /*
006:         * The contents of this file are subject to the terms
007:         * of the Common Development and Distribution License
008:         * (the License).  You may not use this file except in
009:         * compliance with the License.
010:         * 
011:         * You can obtain a copy of the license at
012:         * https://glassfish.dev.java.net/public/CDDLv1.0.html.
013:         * See the License for the specific language governing
014:         * permissions and limitations under the License.
015:         * 
016:         * When distributing Covered Code, include this CDDL
017:         * Header Notice in each file and include the License file
018:         * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
019:         * If applicable, add the following below the CDDL Header,
020:         * with the fields enclosed by brackets [] replaced by
021:         * you own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         * 
024:         * [Name of File] [ver.__] [Date]
025:         * 
026:         * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
027:         */
028:
029:        package com.sun.xml.stream.events;
030:
031:        import java.io.Writer;
032:        import javax.xml.stream.Location;
033:        import javax.xml.stream.XMLStreamConstants;
034:        import javax.xml.stream.XMLStreamException;
035:        import javax.xml.stream.events.ProcessingInstruction;
036:
037:        /** Implements Processing Instruction Event
038:         *
039:         *@author Neeraj Bajaj, Sun Microsystems.
040:         *
041:         */
042:
043:        public class ProcessingInstructionEvent extends DummyEvent implements 
044:                ProcessingInstruction {
045:
046:            /** Processing Instruction Name */
047:            private String fName;
048:            /** Processsing instruction content */
049:            private String fContent;
050:
051:            public ProcessingInstructionEvent() {
052:                init();
053:            }
054:
055:            public ProcessingInstructionEvent(String targetName, String data) {
056:                this (targetName, data, null);
057:            }
058:
059:            public ProcessingInstructionEvent(String targetName, String data,
060:                    Location loc) {
061:                init();
062:                this .fName = targetName;
063:                fContent = data;
064:                setLocation(loc);
065:            }
066:
067:            protected void init() {
068:                setEventType(XMLStreamConstants.PROCESSING_INSTRUCTION);
069:            }
070:
071:            public String getTarget() {
072:                return fName;
073:            }
074:
075:            public void setTarget(String targetName) {
076:                fName = targetName;
077:            }
078:
079:            public void setData(String data) {
080:                fContent = data;
081:            }
082:
083:            public String getData() {
084:                return fContent;
085:            }
086:
087:            public String toString() {
088:                if (fContent != null && fName != null)
089:                    return "<?" + fName + fContent + "?>";
090:                if (fName != null)
091:                    return "<?" + fName + "?>";
092:                if (fContent != null)
093:                    return "<?" + fContent + "?>";
094:                else
095:                    return "<??>";
096:            }
097:
098:            /** This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
099:             * No indentation or whitespace should be outputted.
100:             *
101:             * Any user defined event type SHALL have this method
102:             * called when being written to on an output stream.
103:             * Built in Event types MUST implement this method,
104:             * but implementations MAY choose not call these methods
105:             * for optimizations reasons when writing out built in
106:             * Events to an output stream.
107:             * The output generated MUST be equivalent in terms of the
108:             * infoset expressed.
109:             *
110:             * @param writer The writer that will output the data
111:             * @throws XMLStreamException if there is a fatal error writing the event
112:             */
113:            public void writeAsEncodedUnicode(Writer writer)
114:                    throws XMLStreamException {
115:            }
116:
117:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.