All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.epubcheck.xml.DocumentLocatorImpl Maven / Gradle / Ivy

Go to download

EPUBCheck is a tool to validate the conformance of EPUB publications against the EPUB specifications. EPUBCheck can be run as a standalone command-line tool or used as a Java library.

There is a newer version: 5.1.0
Show newest version
package com.adobe.epubcheck.xml;

import org.xml.sax.Locator;
import org.xml.sax.ext.Locator2;

class DocumentLocatorImpl implements Locator2
{

  private final Locator locator;
  private Locator2 locator2 = null;

  public DocumentLocatorImpl(Locator locator)
  {
    this.locator = locator;
    if (locator instanceof Locator2)
    {
      locator2 = (Locator2) locator;
    }
  }

  @Override
  public int getColumnNumber()
  {
    return locator.getColumnNumber();
  }

  @Override
  public int getLineNumber()
  {
    return locator.getLineNumber();
  }

  @Override
  public String getPublicId()
  {
    return locator.getPublicId();
  }

  @Override
  public String getSystemId()
  {
    return locator.getSystemId();
  }

  @Override
  public String getEncoding()
  {
    if (locator2 != null)
    {
      return locator2.getEncoding();
    }
    return null;
  }

  @Override
  public String getXMLVersion()
  {
    if (locator2 != null)
    {
      return locator2.getXMLVersion();
    }
    return null;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy