Package anvil

Examples of anvil.Location


  }


  public Location getLocation()
  {
    return new Location(_url, _startLine, _startColumn);
  }
View Full Code Here



  public synchronized void init(Address address)
  {
    _address = address;
    _location = new Location(address.getURL());
    _assert = address.getZone().getAssert();
    _name = address.getPathinfo();
   
    Class scriptclass = getClass();
    try {
View Full Code Here

  }


  public void parse(TemplateParser parser, Tag tag)
  {
    Location location = getLocation();
    Parent parameters;
  
    String params = tag.getValue("params");
    if (params != null) {
      ExpressionParser p = new ExpressionParser(parser, location, params);
View Full Code Here

      ErrorListener listener = ((ForgingException)exception).getErrorListener();
      Enumeration e = listener.getEvents();
      int count = 0;
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        String url;
        if (loc != null) {
          url = loc.getURL().toString();
          out.print(url);
          if (loc.getLine()>0) {
            out.print(" [");
            out.print(loc.getLine());
            if (loc.getColumn()>0) {
              out.print(":");
              out.print(loc.getColumn());
            }
            out.print("]");
          }
          out.println();
View Full Code Here

  }


  public Any execute(Context context, Any[] parameters)
  {
    Location loc = _locator.getLocation();
    URL url = loc.getURL();
    Any[] list = new Any[3];
    list[0] = Any.create(url != null ? new anvil.core.net.AnyURL(loc.getURL()) : Any.NULL);
    list[1] = Any.create(loc.getLine());
    list[2] = Any.create(loc.getColumn());
    return new AnyTuple(list);
  }
View Full Code Here

    ExpressionList childs = new ExpressionList(n);
    for(int i=0; i<n; i++) {
      childs.setChild(i, (Node)nodes.get(i));
    }

    Location location = getLocation();
   
    _init = buildExpr(location,
      _tagdef.getInitHandler(),
      null,
      new ExpressionList(
View Full Code Here

      int count = 0;
      URL last = null;
      URL url;
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        if (loc != null) {
          url = loc.getURL();
          if (url != null) {
            if (last == null || !last.equals(url)) {
              last = url;
              out.print(url);
              out.println(':');
            }
          }
          out.print("  ");
          if (loc.getLine() > 0) {
            out.print('[');
            out.print(loc.getLine());
            if (loc.getColumn() > 0) {
              out.print(':');
              out.print(loc.getColumn());
            }
            out.print("] ");
          }
        }
        out.println(evt.getMessage());
View Full Code Here

    if (_listener != null) {
      buffer.append("\n");
      Enumeration e = _listener.getEvents();
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        URL url;
        int line, column;
        if (loc != null) {
          url = loc.getURL();
          line = loc.getLine();
          column = loc.getColumn();
        } else {
          url = null;
          line = 0;
          column = 0;
        }
        url = (loc != null) ? loc.getURL() : null;
        if (url != null) {
          buffer.append(url.toString());
        } else {
          buffer.append("unknown");
        }
View Full Code Here

    if (_listener != null) {
      Array errors = new Array(_listener.errors());
      Enumeration e = _listener.getEvents();
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        URL url;
        int line;
        int column;
        if (loc != null) {
          url = loc.getURL();
          line = loc.getLine();
          column = loc.getColumn();
        } else {
          url = null;
          line = 0;
          column = 0;
        }
        url = (loc != null) ? loc.getURL() : null;
        Array error = new Array(7);
        error.append(STR_URL, (url != null) ? new anvil.core.net.AnyURL(url) : Any.NULL);
        error.append(STR_LINE, Any.create(line));
        error.append(STR_COLUMN, Any.create(column));
        error.append(STR_MESSAGE, Any.create(evt.getMessage()));
View Full Code Here

      int count = 0;
      URL last = null;
      URL url;
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        _errors++;
      if (loc != null) {
          url = loc.getURL();
          if (url != null) {
            if (last == null || !last.equals(url)) {
              last = url;
              out.print(url);
              out.println(':');
            }
          }
          out.print("  ");
          if (loc.getLine() > 0) {
            out.print('[');
            out.print(loc.getLine());
            if (loc.getColumn() > 0) {
              out.print(':');
              out.print(loc.getColumn());
            }
            out.print("] ");
          }
        }
        out.println(evt.getMessage());
View Full Code Here

TOP

Related Classes of anvil.Location

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.