1 /* 2 * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 // Locator2.java - extended Locator 27 // http://www.saxproject.org 28 // Public Domain: no warranty. 29 // $Id: Locator2.java,v 1.2 2004/11/03 22:49:08 jsuttor Exp $ 30 31 package org.xml.sax.ext; 32 33 import org.xml.sax.Locator; 34 35 36 /** 37 * SAX2 extension to augment the entity information provided 38 * though a {@link Locator}. 39 * If an implementation supports this extension, the Locator 40 * provided in {@link org.xml.sax.ContentHandler#setDocumentLocator 41 * ContentHandler.setDocumentLocator() } will implement this 42 * interface, and the 43 * <em>http://xml.org/sax/features/use-locator2</em> feature 44 * flag will have the value <em>true</em>. 45 * 46 * <blockquote> 47 * <em>This module, both source code and documentation, is in the 48 * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> 49 * </blockquote> 50 * 51 * <p> XMLReader implementations are not required to support this 52 * information, and it is not part of core-only SAX2 distributions.</p> 53 * 54 * @since 1.5, SAX 2.0 (extensions 1.1 alpha) 55 * @author David Brownell 56 */ 57 public interface Locator2 extends Locator 58 { 59 /** 60 * Returns the version of XML used for the entity. This will 61 * normally be the identifier from the current entity's 62 * <em><?xml version='...' ...?></em> declaration, 63 * or be defaulted by the parser. 64 * 65 * @return Identifier for the XML version being used to interpret 66 * the entity's text, or null if that information is not yet 67 * available in the current parsing state. 68 */ 69 public String getXMLVersion (); | 1 /* 2 * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package org.xml.sax.ext; 27 28 import org.xml.sax.Locator; 29 30 31 /** 32 * SAX2 extension to augment the entity information provided 33 * through a {@link Locator}. 34 * If an implementation supports this extension, the Locator 35 * provided in {@link org.xml.sax.ContentHandler#setDocumentLocator 36 * ContentHandler.setDocumentLocator() } will implement this 37 * interface, and the 38 * <em>http://xml.org/sax/features/use-locator2</em> feature 39 * flag will have the value <em>true</em>. 40 * 41 * <p> XMLReader implementations are not required to support this 42 * information, and it is not part of core-only SAX2 distributions.</p> 43 * 44 * @since 1.5, SAX 2.0 (extensions 1.1 alpha) 45 * @author David Brownell 46 */ 47 public interface Locator2 extends Locator 48 { 49 /** 50 * Returns the version of XML used for the entity. This will 51 * normally be the identifier from the current entity's 52 * <em><?xml version='...' ...?></em> declaration, 53 * or be defaulted by the parser. 54 * 55 * @return Identifier for the XML version being used to interpret 56 * the entity's text, or null if that information is not yet 57 * available in the current parsing state. 58 */ 59 public String getXMLVersion (); |