Package org.xml.sax

Examples of org.xml.sax.Locator


  {
    int line;
    int column;
    String systemId;

    Locator locator = context.getLocator();
    if (locator == null)
    {
      line   = -1;
      column = -1;
      systemId = null;
    }
    else
    {
      line = locator.getLineNumber();
      column = locator.getColumnNumber();
      systemId = locator.getSystemId();
    }

    return _getErrorMessage(message, line, column, systemId);
  }
View Full Code Here


    return this.getClass().getName();
  }

  protected int getColumnNumber(ExecutionContext ec) {
    Interpreter jp = ec.getJoranInterpreter();
    Locator locator = jp.getLocator();
    if (locator != null) {
      return locator.getColumnNumber();
    }
    return -1;
  }
View Full Code Here

    return -1;
  }

  protected int getLineNumber(ExecutionContext ec) {
    Interpreter jp = ec.getJoranInterpreter();
    Locator locator = jp.getLocator();
    if (locator != null) {
      return locator.getLineNumber();
    }
    return -1;
  }
View Full Code Here

        if (stackName == null) {
          // we only care about the real object stack
         
          // note that a Locator object can also provide
          // publicId and systemId info.
          Locator l = d.getDocumentLocator();
          StringBuffer locn = new StringBuffer();
          locn.append("line=");
          locn.append(l.getLineNumber());
          locations.put(o, locn.toString());
        }
        return o;
      }
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

     *
     * @throws org.xml.sax.SAXException
     */
    protected void startNode(Node node) throws org.xml.sax.SAXException {
        if (node instanceof Locator) {
            Locator loc = (Locator) node;
            fLocator.setColumnNumber(loc.getColumnNumber());
            fLocator.setLineNumber(loc.getLineNumber());
            fLocator.setPublicId(loc.getPublicId());
            fLocator.setSystemId(loc.getSystemId());
        } else {
            fLocator.setColumnNumber(0);
            fLocator.setLineNumber(0);
        }

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

        boolean mappedSuper = "mapped-superclass".equals(elem);
        if (isMetaDataMode()) {
            meta.setSource(getSourceFile(), meta.SRC_XML);
            meta.setSourceMode(MODE_META, true);
            Locator locator = getLocation().getLocator();
            if (locator != null) {
                meta.setLineNumber(Numbers.valueOf(locator.getLineNumber()));
                meta.setColNumber(Numbers.valueOf(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, meta.SRC_XML);
        Locator locator = getLocation().getLocator();
        if (locator != null) {
            meta.setLineNumber(Numbers.valueOf(locator.getLineNumber()));
            meta.setColNumber(Numbers.valueOf(locator.getColumnNumber()));
        }
        return true;
    }
View Full Code Here

        meta = getRepository().addQueryMetaData(null, name);
        meta.setDefiningType(_cls);
        meta.setQueryString(attrs.getValue("query"));
        meta.setLanguage(JPQLParser.LANG_JPQL);
        Locator locator = getLocation().getLocator();
        if (locator != null) {
            meta.setLineNumber(Numbers.valueOf(locator.getLineNumber()));
            meta.setColNumber(Numbers.valueOf(locator.getColumnNumber()));
        }
        Object cur = currentElement();
        Object scope = (cur instanceof ClassMetaData)
            ? ((ClassMetaData) cur).getDescribedType() : null;
        meta.setSource(getSourceFile(), scope, meta.SRC_XML);
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.