Package org.xml.sax.helpers

Examples of org.xml.sax.helpers.LocatorImpl


     * @param recording The recording that this player will play.
     */
    public SAXPlayerImpl(SAXRecordingImpl recording) {
        this.recording = recording;

        locator = new LocatorImpl();

        window = recording.createWindow();
    }
View Full Code Here


     * @throws SAXException if the content handler
     *      or lexical handler throws an exception
     */
    public void convert(Document doc) throws SAXException {
       
        locator = new LocatorImpl();
        locator.setSystemId(doc.getBaseURI());
        contentHandler.setDocumentLocator(locator);
        contentHandler.startDocument();
        for (int i = 0; i < doc.getChildCount(); i++) {
             process(doc.getChild(i));
View Full Code Here

       
        if (nodes.size() == 1 && nodes.get(0) instanceof Document) {
            convert((Document) nodes.get(0));
        }
        else {
            locator = new LocatorImpl();
            contentHandler.setDocumentLocator(locator);
            contentHandler.startDocument();
            for (int i = 0; i < nodes.size(); i++) {
                process(nodes.get(i));
            }
View Full Code Here

    /**
     * Test the method setDocumentLocator    
     */
    public void testSetDocumentLocator() throws Exception {
        final BooleanWrapper calledMethod = new BooleanWrapper(false);
        final LocatorImpl locatorImpl = new LocatorImpl();
       
        AbstractMarlinContentHandler defaultHandler = new TestHandler() {
            // Javadoc inherited from ContentHandler interface
            public void setDocumentLocator(Locator locator) {
                calledMethod.setValue(true);
View Full Code Here

     * and reset the state of this SAXEventRecorder.
     */
    public void clear() {
        events.clear();
        complex = false;
        playbackLocator = new LocatorImpl();
        documentLocator = null;
    }
View Full Code Here

    // Javadoc inherited from superclass
    public Object clone() throws CloneNotSupportedException {
        SAXEventRecorder clone = (SAXEventRecorder)super.clone();

        clone.events = (ArrayList)events.clone();
        clone.playbackLocator = new LocatorImpl(playbackLocator);

        return clone;
    }
View Full Code Here

        } catch (SourceException se) {
            throw new ProcessingException("Error during resolving of '" + this.source + "'.", se);
        }

        // setup a Locator in case parser detects input errors
        final LocatorImpl locator = new LocatorImpl();

        locator.setSystemId(this.inputSource.getURI());
        locator.setLineNumber(1);
        locator.setColumnNumber(1);

        contentHandler.setDocumentLocator(locator);

        // start parsing, read and process all input lines
        parser.startDocument(contentHandler);

        LineNumberReader reader = new LineNumberReader(in);
        String line, newline = null;

        while (true) {
            if (newline == null) {
                line = reader.readLine();
            } else {
                line = newline;
            }

            if (line == null) {
                break;
            }

            newline = reader.readLine();

            locator.setLineNumber(reader.getLineNumber());
            locator.setColumnNumber(1);
            parser.processLine(line);

            if (newline == null) {
                break;
            }
View Full Code Here

   /** Returns a locator implementation. */
   private LocatorImpl getLocatorImpl(LocatorImpl fillin) {

      Locator here = fErrorReporter.getLocator();
      if (fillin == null)
         return new LocatorImpl(here);
      fillin.setPublicId(here.getPublicId());
      fillin.setSystemId(here.getSystemId());
      fillin.setLineNumber(here.getLineNumber());
      fillin.setColumnNumber(here.getColumnNumber());
      return fillin;
View Full Code Here

    //
    //
    //
    private LocatorImpl getLocatorImpl(LocatorImpl fillin) {
        if (fillin == null)
            return new LocatorImpl(this);
        fillin.setPublicId(getPublicId());
        fillin.setSystemId(getSystemId());
        fillin.setLineNumber(getLineNumber());
        fillin.setColumnNumber(getColumnNumber());
        return fillin;
View Full Code Here

        return fNotationName[chunk][index];
    }
    class RequiredNotation {
        RequiredNotation(int notationName, Locator locator, int majorCode, int minorCode, Object[] args) {
            fNotationName = notationName;
            fLocator = new LocatorImpl(locator); // snapshot of the current location
            fMajorCode = majorCode;
            fMinorCode = minorCode;
            fArgs = args;
        }
View Full Code Here

TOP

Related Classes of org.xml.sax.helpers.LocatorImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.