Source Code Cross Referenced for LocatorImpl.java in  » Web-Server » Rimfaxe-Web-Server » org » xml » sax » helpers » 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 » Web Server » Rimfaxe Web Server » org.xml.sax.helpers 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // SAX default implementation for Locator.
002:        // http://www.saxproject.org
003:        // No warranty; no copyright -- use this as you will.
004:        // $Id: LocatorImpl.java,v 1.7 2002/02/01 20:06:20 db Exp $
005:
006:        package org.xml.sax.helpers;
007:
008:        import org.xml.sax.Locator;
009:
010:        /**
011:         * Provide an optional convenience implementation of Locator.
012:         *
013:         * <blockquote>
014:         * <em>This module, both source code and documentation, is in the
015:         * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
016:         * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
017:         * for further information.
018:         * </blockquote>
019:         *
020:         * <p>This class is available mainly for application writers, who
021:         * can use it to make a persistent snapshot of a locator at any
022:         * point during a document parse:</p>
023:         *
024:         * <pre>
025:         * Locator locator;
026:         * Locator startloc;
027:         *
028:         * public void setLocator (Locator locator)
029:         * {
030:         *         // note the locator
031:         *   this.locator = locator;
032:         * }
033:         *
034:         * public void startDocument ()
035:         * {
036:         *         // save the location of the start of the document
037:         *         // for future use.
038:         *   Locator startloc = new LocatorImpl(locator);
039:         * }
040:         *</pre>
041:         *
042:         * <p>Normally, parser writers will not use this class, since it
043:         * is more efficient to provide location information only when
044:         * requested, rather than constantly updating a Locator object.</p>
045:         *
046:         * @since SAX 1.0
047:         * @author David Megginson
048:         * @version 2.0.1 (sax2r2)
049:         * @see org.xml.sax.Locator Locator
050:         */
051:        public class LocatorImpl implements  Locator {
052:
053:            /**
054:             * Zero-argument constructor.
055:             *
056:             * <p>This will not normally be useful, since the main purpose
057:             * of this class is to make a snapshot of an existing Locator.</p>
058:             */
059:            public LocatorImpl() {
060:            }
061:
062:            /**
063:             * Copy constructor.
064:             *
065:             * <p>Create a persistent copy of the current state of a locator.
066:             * When the original locator changes, this copy will still keep
067:             * the original values (and it can be used outside the scope of
068:             * DocumentHandler methods).</p>
069:             *
070:             * @param locator The locator to copy.
071:             */
072:            public LocatorImpl(Locator locator) {
073:                setPublicId(locator.getPublicId());
074:                setSystemId(locator.getSystemId());
075:                setLineNumber(locator.getLineNumber());
076:                setColumnNumber(locator.getColumnNumber());
077:            }
078:
079:            ////////////////////////////////////////////////////////////////////
080:            // Implementation of org.xml.sax.Locator
081:            ////////////////////////////////////////////////////////////////////
082:
083:            /**
084:             * Return the saved public identifier.
085:             *
086:             * @return The public identifier as a string, or null if none
087:             *         is available.
088:             * @see org.xml.sax.Locator#getPublicId
089:             * @see #setPublicId
090:             */
091:            public String getPublicId() {
092:                return publicId;
093:            }
094:
095:            /**
096:             * Return the saved system identifier.
097:             *
098:             * @return The system identifier as a string, or null if none
099:             *         is available.
100:             * @see org.xml.sax.Locator#getSystemId
101:             * @see #setSystemId
102:             */
103:            public String getSystemId() {
104:                return systemId;
105:            }
106:
107:            /**
108:             * Return the saved line number (1-based).
109:             *
110:             * @return The line number as an integer, or -1 if none is available.
111:             * @see org.xml.sax.Locator#getLineNumber
112:             * @see #setLineNumber
113:             */
114:            public int getLineNumber() {
115:                return lineNumber;
116:            }
117:
118:            /**
119:             * Return the saved column number (1-based).
120:             *
121:             * @return The column number as an integer, or -1 if none is available.
122:             * @see org.xml.sax.Locator#getColumnNumber
123:             * @see #setColumnNumber
124:             */
125:            public int getColumnNumber() {
126:                return columnNumber;
127:            }
128:
129:            ////////////////////////////////////////////////////////////////////
130:            // Setters for the properties (not in org.xml.sax.Locator)
131:            ////////////////////////////////////////////////////////////////////
132:
133:            /**
134:             * Set the public identifier for this locator.
135:             *
136:             * @param publicId The new public identifier, or null 
137:             *        if none is available.
138:             * @see #getPublicId
139:             */
140:            public void setPublicId(String publicId) {
141:                this .publicId = publicId;
142:            }
143:
144:            /**
145:             * Set the system identifier for this locator.
146:             *
147:             * @param systemId The new system identifier, or null 
148:             *        if none is available.
149:             * @see #getSystemId
150:             */
151:            public void setSystemId(String systemId) {
152:                this .systemId = systemId;
153:            }
154:
155:            /**
156:             * Set the line number for this locator (1-based).
157:             *
158:             * @param lineNumber The line number, or -1 if none is available.
159:             * @see #getLineNumber
160:             */
161:            public void setLineNumber(int lineNumber) {
162:                this .lineNumber = lineNumber;
163:            }
164:
165:            /**
166:             * Set the column number for this locator (1-based).
167:             *
168:             * @param columnNumber The column number, or -1 if none is available.
169:             * @see #getColumnNumber
170:             */
171:            public void setColumnNumber(int columnNumber) {
172:                this .columnNumber = columnNumber;
173:            }
174:
175:            ////////////////////////////////////////////////////////////////////
176:            // Internal state.
177:            ////////////////////////////////////////////////////////////////////
178:
179:            private String publicId;
180:            private String systemId;
181:            private int lineNumber;
182:            private int columnNumber;
183:
184:        }
185:
186:        // 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.