alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (Locator2Impl.java)

This example Java source code file (Locator2Impl.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

locator2, locator2impl, locatorimpl, sax, string

The Locator2Impl.java Java example source code

/*
 * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

// Locator2Impl.java - extended LocatorImpl
// http://www.saxproject.org
// Public Domain: no warranty.
// $Id: Locator2Impl.java,v 1.2 2004/11/03 22:49:08 jsuttor Exp $

package org.xml.sax.ext;

import org.xml.sax.Locator;
import org.xml.sax.helpers.LocatorImpl;


/**
 * SAX2 extension helper for holding additional Entity information,
 * implementing the {@link Locator2} interface.
 *
 * <blockquote>
 * <em>This module, both source code and documentation, is in the
 * Public Domain, and comes with <strong>NO WARRANTY.
 * </blockquote>
 *
 * <p> This is not part of core-only SAX2 distributions.

* * @since SAX 2.0.2 * @author David Brownell */ public class Locator2Impl extends LocatorImpl implements Locator2 { private String encoding; private String version; /** * Construct a new, empty Locator2Impl object. * This will not normally be useful, since the main purpose * of this class is to make a snapshot of an existing Locator. */ public Locator2Impl () { } /** * Copy an existing Locator or Locator2 object. * If the object implements Locator2, values of the * <em>encoding and versionstrings are copied, * otherwise they set to <em>null. * * @param locator The existing Locator object. */ public Locator2Impl (Locator locator) { super (locator); if (locator instanceof Locator2) { Locator2 l2 = (Locator2) locator; version = l2.getXMLVersion (); encoding = l2.getEncoding (); } } //////////////////////////////////////////////////////////////////// // Locator2 method implementations //////////////////////////////////////////////////////////////////// /** * Returns the current value of the version property. * * @see #setXMLVersion */ public String getXMLVersion () { return version; } /** * Returns the current value of the encoding property. * * @see #setEncoding */ public String getEncoding () { return encoding; } //////////////////////////////////////////////////////////////////// // Setters //////////////////////////////////////////////////////////////////// /** * Assigns the current value of the version property. * * @param version the new "version" value * @see #getXMLVersion */ public void setXMLVersion (String version) { this.version = version; } /** * Assigns the current value of the encoding property. * * @param encoding the new "encoding" value * @see #getEncoding */ public void setEncoding (String encoding) { this.encoding = encoding; } }

Other Java examples (source code examples)

Here is a short list of links related to this Java Locator2Impl.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.