Source Code Cross Referenced for AttributeImpl.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: AttributeImpl.java,v 1.2 2006/04/01 06:01:35 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 javax.xml.namespace.QName;
032:        import javax.xml.stream.events.Attribute;
033:        import java.io.Writer;
034:        import javax.xml.stream.events.XMLEvent;
035:
036:        //xxx: AttributeEvent is not really a first order event. Should we be renaming the class to AttributeImpl for consistent
037:        //naming convention.
038:
039:        /**
040:         * Implementation of Attribute Event.
041:         *
042:         *@author Neeraj Bajaj, Sun Microsystems
043:         *@author K.Venugopal, Sun Microsystems
044:         *
045:         */
046:
047:        public class AttributeImpl extends DummyEvent implements  Attribute
048:
049:        {
050:            //attribute value
051:            private String fValue;
052:            private String fNonNormalizedvalue;
053:
054:            //name of the attribute
055:            private QName fQName;
056:            //attribute type
057:            private String fAttributeType = "CDATA";
058:
059:            //A flag indicating whether this attribute was actually specified in the start-tag
060:            //of its element or was defaulted from the schema.
061:            private boolean fIsSpecified;
062:
063:            public AttributeImpl() {
064:                init();
065:            }
066:
067:            public AttributeImpl(String name, String value) {
068:                init();
069:                fQName = new QName(name);
070:                fValue = value;
071:            }
072:
073:            public AttributeImpl(String prefix, String name, String value) {
074:                this (prefix, null, name, value, null, null, false);
075:            }
076:
077:            public AttributeImpl(String prefix, String uri, String localPart,
078:                    String value, String type) {
079:                this (prefix, uri, localPart, value, null, type, false);
080:            }
081:
082:            public AttributeImpl(String prefix, String uri, String localPart,
083:                    String value, String nonNormalizedvalue, String type,
084:                    boolean isSpecified) {
085:                this (new QName(uri, localPart, prefix), value,
086:                        nonNormalizedvalue, type, isSpecified);
087:            }
088:
089:            public AttributeImpl(QName qname, String value,
090:                    String nonNormalizedvalue, String type, boolean isSpecified) {
091:                init();
092:                fQName = qname;
093:                fValue = value;
094:                if (type != null && !type.equals(""))
095:                    fAttributeType = type;
096:
097:                fNonNormalizedvalue = nonNormalizedvalue;
098:                fIsSpecified = isSpecified;
099:
100:            }
101:
102:            public String toString() {
103:                if (fQName.getPrefix() != null
104:                        && fQName.getPrefix().length() > 0)
105:                    return fQName.getPrefix() + ":" + fQName.getLocalPart()
106:                            + "='" + fValue + "'";
107:                else
108:                    return fQName.getLocalPart() + "='" + fValue + "'";
109:            }
110:
111:            public void setName(QName name) {
112:                fQName = name;
113:            }
114:
115:            public QName getName() {
116:                return fQName;
117:            }
118:
119:            public void setValue(String value) {
120:                fValue = value;
121:            }
122:
123:            public String getValue() {
124:                return fValue;
125:            }
126:
127:            public void setNonNormalizedValue(String nonNormalizedvalue) {
128:                fNonNormalizedvalue = nonNormalizedvalue;
129:            }
130:
131:            public String getNonNormalizedValue() {
132:                return fNonNormalizedvalue;
133:            }
134:
135:            public void setAttributeType(String attributeType) {
136:                fAttributeType = attributeType;
137:            }
138:
139:            /** Gets the type of this attribute, default is "CDATA   */
140:            // We dont need to take care of default value.. implementation takes care of it.
141:            public String getDTDType() {
142:                return fAttributeType;
143:            }
144:
145:            /** is this attribute is specified in the instance document */
146:
147:            public void setSpecified(boolean isSpecified) {
148:                fIsSpecified = isSpecified;
149:            }
150:
151:            public boolean isSpecified() {
152:                return fIsSpecified;
153:            }
154:
155:            /** This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
156:             *
157:             * No indentation or whitespace should be outputted.
158:             *
159:             *
160:             *
161:             * Any user defined event type SHALL have this method
162:             *
163:             * called when being written to on an output stream.
164:             *
165:             * Built in Event types MUST implement this method,
166:             *
167:             * but implementations MAY choose not call these methods
168:             *
169:             * for optimizations reasons when writing out built in
170:             *
171:             * Events to an output stream.
172:             *
173:             * The output generated MUST be equivalent in terms of the
174:             *
175:             * infoset expressed.
176:             *
177:             *
178:             *
179:             * @param writer The writer that will output the data
180:             *
181:             * @throws XMLStreamException if there is a fatal error writing the event
182:             *
183:             */
184:
185:            public void writeAsEncodedUnicode(Writer writer)
186:                    throws javax.xml.stream.XMLStreamException {
187:
188:            }
189:
190:            protected void init() {
191:                setEventType(XMLEvent.ATTRIBUTE);
192:            }
193:
194:        }//AttributeImpl
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.