Source Code Cross Referenced for SerializableLocatorImpl.java in  » XML » xalan » org » apache » xml » utils » 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 » xalan » org.apache.xml.utils 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 1999-2004 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of 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,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /*
017:         * $Id: SerializableLocatorImpl.java,v 1.5 2004/08/17 18:57:22 jycli Exp $
018:         */
019:        package org.apache.xml.utils;
020:
021:        /**
022:         * The standard SAX implementation of LocatorImpl is not serializable,
023:         * limiting its utility as "a persistent snapshot of a locator".
024:         * This is a quick hack to make it so. Note that it makes more sense
025:         * in many cases to set up fields to hold this data rather than pointing
026:         * at another object... but that decision should be made on architectural
027:         * grounds rather than serializability.
028:         *<p>
029:         * It isn't clear whether subclassing LocatorImpl and adding serialization
030:         * methods makes more sense than copying it and just adding Serializable
031:         * to its interface. Since it's so simple, I've taken the latter approach
032:         * for now.
033:         *
034:         * @see org.xml.sax.helpers.LocatorImpl
035:         * @see org.xml.sax.Locator Locator
036:         * @since XalanJ2
037:         * @author Joe Kesselman
038:         * @version 1.0
039:         */
040:        public class SerializableLocatorImpl implements  org.xml.sax.Locator,
041:                java.io.Serializable
042:
043:        {
044:            static final long serialVersionUID = -2660312888446371460L;
045:
046:            /**
047:             * Zero-argument constructor.
048:             *
049:             * <p>SAX says "This will not normally be useful, since the main purpose
050:             * of this class is to make a snapshot of an existing Locator." In fact,
051:             * it _is_ sometimes useful when you want to construct a new Locator
052:             * pointing to a specific location... which, after all, is why the
053:             * setter methods are provided.
054:             * </p>
055:             */
056:            public SerializableLocatorImpl() {
057:            }
058:
059:            /**
060:             * Copy constructor.
061:             *
062:             * <p>Create a persistent copy of the current state of a locator.
063:             * When the original locator changes, this copy will still keep
064:             * the original values (and it can be used outside the scope of
065:             * DocumentHandler methods).</p>
066:             *
067:             * @param locator The locator to copy.
068:             */
069:            public SerializableLocatorImpl(org.xml.sax.Locator locator) {
070:                setPublicId(locator.getPublicId());
071:                setSystemId(locator.getSystemId());
072:                setLineNumber(locator.getLineNumber());
073:                setColumnNumber(locator.getColumnNumber());
074:            }
075:
076:            ////////////////////////////////////////////////////////////////////
077:            // Implementation of org.xml.sax.Locator
078:            ////////////////////////////////////////////////////////////////////
079:
080:            /**
081:             * Return the saved public identifier.
082:             *
083:             * @return The public identifier as a string, or null if none
084:             *         is available.
085:             * @see org.xml.sax.Locator#getPublicId
086:             * @see #setPublicId
087:             */
088:            public String getPublicId() {
089:                return publicId;
090:            }
091:
092:            /**
093:             * Return the saved system identifier.
094:             *
095:             * @return The system identifier as a string, or null if none
096:             *         is available.
097:             * @see org.xml.sax.Locator#getSystemId
098:             * @see #setSystemId
099:             */
100:            public String getSystemId() {
101:                return systemId;
102:            }
103:
104:            /**
105:             * Return the saved line number (1-based).
106:             *
107:             * @return The line number as an integer, or -1 if none is available.
108:             * @see org.xml.sax.Locator#getLineNumber
109:             * @see #setLineNumber
110:             */
111:            public int getLineNumber() {
112:                return lineNumber;
113:            }
114:
115:            /**
116:             * Return the saved column number (1-based).
117:             *
118:             * @return The column number as an integer, or -1 if none is available.
119:             * @see org.xml.sax.Locator#getColumnNumber
120:             * @see #setColumnNumber
121:             */
122:            public int getColumnNumber() {
123:                return columnNumber;
124:            }
125:
126:            ////////////////////////////////////////////////////////////////////
127:            // Setters for the properties (not in org.xml.sax.Locator)
128:            ////////////////////////////////////////////////////////////////////
129:
130:            /**
131:             * Set the public identifier for this locator.
132:             *
133:             * @param publicId The new public identifier, or null 
134:             *        if none is available.
135:             * @see #getPublicId
136:             */
137:            public void setPublicId(String publicId) {
138:                this .publicId = publicId;
139:            }
140:
141:            /**
142:             * Set the system identifier for this locator.
143:             *
144:             * @param systemId The new system identifier, or null 
145:             *        if none is available.
146:             * @see #getSystemId
147:             */
148:            public void setSystemId(String systemId) {
149:                this .systemId = systemId;
150:            }
151:
152:            /**
153:             * Set the line number for this locator (1-based).
154:             *
155:             * @param lineNumber The line number, or -1 if none is available.
156:             * @see #getLineNumber
157:             */
158:            public void setLineNumber(int lineNumber) {
159:                this .lineNumber = lineNumber;
160:            }
161:
162:            /**
163:             * Set the column number for this locator (1-based).
164:             *
165:             * @param columnNumber The column number, or -1 if none is available.
166:             * @see #getColumnNumber
167:             */
168:            public void setColumnNumber(int columnNumber) {
169:                this .columnNumber = columnNumber;
170:            }
171:
172:            ////////////////////////////////////////////////////////////////////
173:            // Internal state.
174:            ////////////////////////////////////////////////////////////////////
175:
176:            /**
177:             * The public ID.
178:             * @serial
179:             */
180:            private String publicId;
181:
182:            /**
183:             * The system ID.
184:             * @serial
185:             */
186:            private String systemId;
187:
188:            /**
189:             * The line number.
190:             * @serial
191:             */
192:            private int lineNumber;
193:
194:            /**
195:             * The column number.
196:             * @serial
197:             */
198:            private int columnNumber;
199:
200:        }
201:
202:        // end of LocatorImpl.java
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.