jaxp/src/share/classes/org/xml/sax/ext/Locator2.java
author ohair
Mon, 14 Apr 2008 14:52:27 -0700
changeset 311 3c14f21bf3f7
parent 6 7f561c08de6b
permissions -rw-r--r--
6484686: The next directory looks like it is no longer part of the build (deploy makefiles) Summary: Getting rid of the _OUTPUTDIR settings. Using BUILD_PARENT_DIRECTORY instead. This solves problems with the "/build/windows-i586*" paths getting mangled on Windows builds (fastdebug builds in particular). Reviewed-by: tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * Copyright 2004-2005 Sun Microsystems, Inc.  All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 * have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
// Locator2.java - extended Locator
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
// http://www.saxproject.org
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
// Public Domain: no warranty.
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
// $Id: Locator2.java,v 1.2 2004/11/03 22:49:08 jsuttor Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
package org.xml.sax.ext;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
import org.xml.sax.Locator;
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * SAX2 extension to augment the entity information provided
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * though a {@link Locator}.
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * If an implementation supports this extension, the Locator
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * provided in {@link org.xml.sax.ContentHandler#setDocumentLocator
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * ContentHandler.setDocumentLocator() } will implement this
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * interface, and the
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * <em>http://xml.org/sax/features/use-locator2</em> feature
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * flag will have the value <em>true</em>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * <blockquote>
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * <em>This module, both source code and documentation, is in the
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * </blockquote>
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * <p> XMLReader implementations are not required to support this
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * information, and it is not part of core-only SAX2 distributions.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * @since SAX 2.0 (extensions 1.1 alpha)
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * @author David Brownell
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
public interface Locator2 extends Locator
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
     * Returns the version of XML used for the entity.  This will
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
     * normally be the identifier from the current entity's
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
     * <em>&lt;?xml&nbsp;version='...'&nbsp;...?&gt;</em> declaration,
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
     * or be defaulted by the parser.
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
     * @return Identifier for the XML version being used to interpret
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
     * the entity's text, or null if that information is not yet
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
     * available in the current parsing state.
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
    public String getXMLVersion ();
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     * Returns the name of the character encoding for the entity.
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     * If the encoding was declared externally (for example, in a MIME
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     * Content-Type header), that will be the name returned.  Else if there
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
     * was an <em>&lt;?xml&nbsp;...encoding='...'?&gt;</em> declaration at
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     * the start of the document, that encoding name will be returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
     * Otherwise the encoding will been inferred (normally to be UTF-8, or
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     * some UTF-16 variant), and that inferred name will be returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     * <p>When an {@link org.xml.sax.InputSource InputSource} is used
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
     * to provide an entity's character stream, this method returns the
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     * encoding provided in that input stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
     * <p> Note that some recent W3C specifications require that text
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
     * in some encodings be normalized, using Unicode Normalization
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
     * Form C, before processing.  Such normalization must be performed
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
     * by applications, and would normally be triggered based on the
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
     * value returned by this method.
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
     * <p> Encoding names may be those used by the underlying JVM,
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
     * and comparisons should be case-insensitive.
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
     * @return Name of the character encoding being used to interpret
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
     * * the entity's text, or null if this was not provided for a *
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
     * character stream passed through an InputSource or is otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
     * not yet available in the current parsing state.
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
    public String getEncoding ();
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
}