Package juzu.impl.common

Examples of juzu.impl.common.Location


        while (true) {
          int to = text.indexOf('\n', from);
          if (to != -1) {
            String chunk = text.substring(from, to);
            ctx.appendText(chunk);
            ctx.appendLineBreak(new Location(colNumber + (to - from), lineNumber));
            from = to + 1;
            lineNumber++;
            colNumber = 1;
          }
          else {
View Full Code Here


        StringBuilder controller = new StringBuilder();
        if (typeName != null && typeName.length() > 0) {
          controller.append(typeName).append('.');
        }
        controller.append(methodName).append('(').append(parameters).append(')');
        Location location = urlNode.getBegin().getPosition();
        throw TemplateMetaModel.CONTROLLER_NOT_RESOLVED.failure(
            controller,
            templateModel.getPath().getCanonical(),
            location.getLine(),
            location.getCol());
      } else {
        urlNode.setInvocation(mi);
      }
    }
    else if (node instanceof ASTNode.Tag) {
View Full Code Here

      TemplateParser parser = new TemplateParser(new OffsetTokenManager(new OffsetCharStream(new OffsetReader(new StringReader(s.toString())))));
      return parser.parse();
    }

    public Template() {
      super(new Location(0, 0), new ArrayList<Block<?>>());
    }
View Full Code Here

    else {
      builder.append("[").append(sep);
      for (Iterator<Map.Entry<Integer, Foo>> i = locationTable.entrySet().iterator();i.hasNext();) {
        Map.Entry<Integer, Foo> entry = i.next();
        Foo text = entry.getValue();
        Location location = text.getPosition();
        builder.append(entry.getKey()).append(':').
          append("new ").append(Foo.class.getName()).append("(").
          append("new ").append(Location.class.getName()).append("(").append(location.getCol()).append(',').append(location.getLine()).append("),").
          append("'");
        Tools.escape(text.getValue(), builder);
        builder.append("')");
        if (i.hasNext()) {
          builder.append(",").append(sep);
View Full Code Here

    texts.add(text);
    lineNumber++;
  }

  public void appendLineBreak(SectionType currentType, Location position) {
    this.pos = new Location(1, position.getLine() + 1);
    switch (currentType) {
      case SCRIPTLET:
        out.append(sep);
        lineNumber++;
        break;
View Full Code Here

    DiagnosticListener<JavaFileObject> listener = new DiagnosticListener<JavaFileObject>() {
      public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
        if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
          int columnNumber = (int)diagnostic.getColumnNumber();
          int lineNumber = (int)diagnostic.getLineNumber();
          Location location = (columnNumber > 0 && lineNumber > 0) ? new Location(columnNumber, lineNumber) : null;

          // We pass the default locale instead of null as ECJ has issues with null
          String s = diagnostic.getMessage(Locale.getDefault());

          //
View Full Code Here

TOP

Related Classes of juzu.impl.common.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.