< prev index next >

src/java.xml/share/classes/org/xml/sax/Locator.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 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 // SAX locator interface for document events.
  27 // http://www.saxproject.org
  28 // No warranty; no copyright -- use this as you will.
  29 // $Id: Locator.java,v 1.2 2004/11/03 22:55:32 jsuttor Exp $
  30 
  31 package org.xml.sax;
  32 
  33 
  34 /**
  35  * Interface for associating a SAX event with a document location.
  36  *
  37  * <blockquote>
  38  * <em>This module, both source code and documentation, is in the
  39  * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
  40  * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
  41  * for further information.
  42  * </blockquote>
  43  *
  44  * <p>If a SAX parser provides location information to the SAX
  45  * application, it does so by implementing this interface and then
  46  * passing an instance to the application using the content
  47  * handler's {@link org.xml.sax.ContentHandler#setDocumentLocator
  48  * setDocumentLocator} method.  The application can use the
  49  * object to obtain the location of any other SAX event
  50  * in the XML source document.</p>
  51  *
  52  * <p>Note that the results returned by the object will be valid only
  53  * during the scope of each callback method: the application
  54  * will receive unpredictable results if it attempts to use the
  55  * locator at any other time, or after parsing completes.</p>
  56  *
  57  * <p>SAX parsers are not required to supply a locator, but they are
  58  * very strongly encouraged to do so.  If the parser supplies a
  59  * locator, it must do so before reporting any other document events.
  60  * If no locator has been set by the time the application receives
  61  * the {@link org.xml.sax.ContentHandler#startDocument startDocument}
  62  * event, the application should assume that a locator is not


   1 /*
   2  * Copyright (c) 2000, 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;
  27 
  28 
  29 /**
  30  * Interface for associating a SAX event with a document location.







  31  *
  32  * <p>If a SAX parser provides location information to the SAX
  33  * application, it does so by implementing this interface and then
  34  * passing an instance to the application using the content
  35  * handler's {@link org.xml.sax.ContentHandler#setDocumentLocator
  36  * setDocumentLocator} method.  The application can use the
  37  * object to obtain the location of any other SAX event
  38  * in the XML source document.</p>
  39  *
  40  * <p>Note that the results returned by the object will be valid only
  41  * during the scope of each callback method: the application
  42  * will receive unpredictable results if it attempts to use the
  43  * locator at any other time, or after parsing completes.</p>
  44  *
  45  * <p>SAX parsers are not required to supply a locator, but they are
  46  * very strongly encouraged to do so.  If the parser supplies a
  47  * locator, it must do so before reporting any other document events.
  48  * If no locator has been set by the time the application receives
  49  * the {@link org.xml.sax.ContentHandler#startDocument startDocument}
  50  * event, the application should assume that a locator is not


< prev index next >