Package org.xml.sax

Examples of org.xml.sax.Locator


  /**
   * Overrides {@link RDFParserBase#reportWarning(String)}, adding line- and
   * column number information to the error.
   */
  protected void reportWarning(String msg) {
    Locator locator = saxFilter.getLocator();
    if (locator != null) {
      reportWarning(msg, locator.getLineNumber(), locator.getColumnNumber());
    }
    else {
      reportWarning(msg, -1, -1);
    }
  }
View Full Code Here


   * column number information to the error.
   */
  protected void reportError(String msg)
    throws RDFParseException
  {
    Locator locator = saxFilter.getLocator();
    if (locator != null) {
      reportError(msg, locator.getLineNumber(), locator.getColumnNumber());
    }
    else {
      reportError(msg, -1, -1);
    }
  }
View Full Code Here

   * column number information to the error.
   */
  protected void reportFatalError(String msg)
    throws RDFParseException
  {
    Locator locator = saxFilter.getLocator();
    if (locator != null) {
      reportFatalError(msg, locator.getLineNumber(), locator.getColumnNumber());
    }
    else {
      reportFatalError(msg, -1, -1);
    }
  }
View Full Code Here

   * and column number information to the error.
   */
  protected void reportFatalError(Exception e)
    throws RDFParseException
  {
    Locator locator = saxFilter.getLocator();
    if (locator != null) {
      reportFatalError(e, locator.getLineNumber(), locator.getColumnNumber());
    }
    else {
      reportFatalError(e, -1, -1);
    }
  }
View Full Code Here

      ((NodeConsumer) m_contentHandler).setOriginatingNode(node);
    }
               
                if (node instanceof Locator)
                {
                        Locator loc = (Locator)node;
                        m_locator.setColumnNumber(loc.getColumnNumber());
                        m_locator.setLineNumber(loc.getLineNumber());
                        m_locator.setPublicId(loc.getPublicId());
                        m_locator.setSystemId(loc.getSystemId());
                }
                else
                {
                        m_locator.setColumnNumber(0);
      m_locator.setLineNumber(0);
View Full Code Here

        }

        // stylesheet.setDOMBackPointer(handler.getOriginatingNode());
        // ***** Note that we're assigning an empty locator. Is this necessary?
        SAXSourceLocator slocator = new SAXSourceLocator();
        Locator locator = handler.getLocator();
        if(null != locator)
        {
          slocator.setLineNumber(locator.getLineNumber());
          slocator.setColumnNumber(locator.getColumnNumber());
          slocator.setPublicId(locator.getPublicId());
          slocator.setSystemId(locator.getSystemId());
        }
        stylesheet.setLocaterInfo(slocator);
        stylesheet.setPrefixes(handler.getNamespaceSupport());
        handler.pushStylesheet(stylesheet);

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;

   } // getLocatorImpl(LocatorImpl):LocatorImpl
View Full Code Here

    return rslt;
  }

  static private void lineNumber() {
    if (numbers) {
      Locator locator = arp.getLocator();
      if (locator != null)
        print(
          "# "
            + locator.getSystemId()
            + ":"
            + locator.getLineNumber()
            + "("
            + locator.getColumnNumber()
            + ")\n");
    }
  }
View Full Code Here

        boolean mappedSuper = "mapped-superclass".equals(elem);
        boolean embeddable = "embeddable".equals(elem);

        if (isMetaDataMode()) {
            Locator locator = getLocation().getLocator();
            meta.setSource(getSourceFile(), SourceTracker.SRC_XML, locator != null ? locator.getSystemId() : "" );
            meta.setSourceMode(MODE_META, true);
       
            if (locator != null) {
                meta.setLineNumber(locator.getLineNumber());
                meta.setColNumber(locator.getColumnNumber());
            }
            meta.setListingIndex(_clsPos);
            String name = attrs.getValue("name");
            if (!StringUtils.isEmpty(name))
                meta.setTypeAlias(name);
View Full Code Here

        Object cur = currentElement();
        Object scope = (cur instanceof ClassMetaData)
            ? ((ClassMetaData) cur).getDescribedType() : null;
        meta.setSource(getSourceFile(), scope, SourceTracker.SRC_XML);
        Locator locator = getLocation().getLocator();
        if (locator != null) {
            meta.setLineNumber(locator.getLineNumber());
            meta.setColNumber(locator.getColumnNumber());
        }
        return true;
    }
View Full Code Here

TOP

Related Classes of org.xml.sax.Locator

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.