Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / libjava / external / sax / org / xml / sax / ext / Locator2Impl.java
blobe20af1e864786c74b308ebde27764f32259ceb44
1 // Locator2Impl.java - extended LocatorImpl
2 // http://www.saxproject.org
3 // Public Domain: no warranty.
4 // $Id: Locator2Impl.java,v 1.1 2005/02/02 00:41:52 tromey Exp $
6 package org.xml.sax.ext;
8 import org.xml.sax.Locator;
9 import org.xml.sax.helpers.LocatorImpl;
12 /**
13 * SAX2 extension helper for holding additional Entity information,
14 * implementing the {@link Locator2} interface.
16 * <blockquote>
17 * <em>This module, both source code and documentation, is in the
18 * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
19 * </blockquote>
21 * <p> This is not part of core-only SAX2 distributions.</p>
23 * @since SAX 2.0.2
24 * @author David Brownell
25 * @version TBS
27 public class Locator2Impl extends LocatorImpl implements Locator2
29 private String encoding;
30 private String version;
33 /**
34 * Construct a new, empty Locator2Impl object.
35 * This will not normally be useful, since the main purpose
36 * of this class is to make a snapshot of an existing Locator.
38 public Locator2Impl () { }
40 /**
41 * Copy an existing Locator or Locator2 object.
42 * If the object implements Locator2, values of the
43 * <em>encoding</em> and <em>version</em>strings are copied,
44 * otherwise they set to <em>null</em>.
46 * @param locator The existing Locator object.
48 public Locator2Impl (Locator locator)
50 super (locator);
51 if (locator instanceof Locator2) {
52 Locator2 l2 = (Locator2) locator;
54 version = l2.getXMLVersion ();
55 encoding = l2.getEncoding ();
59 ////////////////////////////////////////////////////////////////////
60 // Locator2 method implementations
61 ////////////////////////////////////////////////////////////////////
63 /**
64 * Returns the current value of the version property.
66 * @see #setXMLVersion
68 public String getXMLVersion ()
69 { return version; }
71 /**
72 * Returns the current value of the encoding property.
74 * @see #setEncoding
76 public String getEncoding ()
77 { return encoding; }
80 ////////////////////////////////////////////////////////////////////
81 // Setters
82 ////////////////////////////////////////////////////////////////////
84 /**
85 * Assigns the current value of the version property.
87 * @param version the new "version" value
88 * @see #getXMLVersion
90 public void setXMLVersion (String version)
91 { this.version = version; }
93 /**
94 * Assigns the current value of the encoding property.
96 * @param encoding the new "encoding" value
97 * @see #getEncoding
99 public void setEncoding (String encoding)
100 { this.encoding = encoding; }