Example usage for org.xml.sax.helpers LocatorImpl LocatorImpl

List of usage examples for org.xml.sax.helpers LocatorImpl LocatorImpl

Introduction

In this page you can find the example usage for org.xml.sax.helpers LocatorImpl LocatorImpl.

Prototype

public LocatorImpl(Locator locator) 

Source Link

Document

Copy constructor.

Usage

From source file:org.apache.cocoon.template.script.Parser.java

public void characters(char[] ch, int start, int length) throws SAXException {
    if (charBuf == null) {
        charBuf = new StringBuffer(length);
        charLocation = locator != null ? new LocatorImpl(locator) : NULL_LOCATOR;
    }//ww w  .j  av a  2 s. c o m
    charBuf.append(ch, start, length);
}

From source file:org.apache.fop.fo.FONode.java

/**
 * Set the location information for this element
 * @param locator the org.xml.sax.Locator object
 *//*from   ww w. ja v  a  2  s .c  o m*/
public void setLocator(Locator locator) {
    if (locator != null) {
        //Create a copy of the locator so the info is preserved when we need to
        //give pointers during layout.
        this.locator = new LocatorImpl(locator);
    }
}