Package org.stringtemplate.v4.misc

Examples of org.stringtemplate.v4.misc.STRuntimeMessage


    EvalTemplateEvent e = ((Wrapper)parent).event;
    return new Wrapper(e.scope.childEvalTemplateEvents.get(index));
  }

  public int getChildCount(Object parent) {
    EvalTemplateEvent e = ((Wrapper)parent).event;
    return e.scope.childEvalTemplateEvents.size();
  }
View Full Code Here


    EvalTemplateEvent e = ((Wrapper)parent).event;
    return e.scope.childEvalTemplateEvents.size();
  }

  public int getIndexOfChild(Object parent, Object child) {
    EvalTemplateEvent p = ((Wrapper)parent).event;
    EvalTemplateEvent c = ((Wrapper)parent).event;
        int i = 0;
        for (EvalTemplateEvent e : p.scope.childEvalTemplateEvents) {
            if ( e.scope.st == c.scope.st ) {
//        System.out.println(i);
//        System.out.println("found "+e.self+" as child of "+parentST);
View Full Code Here

        viewFrame.trace.setText(Misc.join(trace.iterator(), "\n"));

        CaretListener caretListenerLabel = new CaretListener() {
            public void caretUpdate(CaretEvent e) {
                int dot = e.getDot();
                InterpEvent de = findEventAtOutputLocation(allEvents, dot);
                if ( de==null ) currentScope = tmodel.root.event.scope;
        else currentScope = de.scope;

        // update tree view of template hierarchy
        // compute path from root to currentST, create TreePath for tree widget
View Full Code Here

      new Interpreter(groupThatCreatedThisInstance, locale, true);
    interp.exec(wr, this); // render and track events
    List<InterpEvent> events = interp.getEvents();
    EvalTemplateEvent overallTemplateEval =
      (EvalTemplateEvent)events.get(events.size()-1);
    STViz viz = new STViz(errMgr, overallTemplateEval, out.toString(), interp,
                interp.getExecutionTrace(), errors.errors);
    viz.open();
    return viz;
  }
View Full Code Here

    gen.writeVocabFile();
  }

  protected void writeRecognizer(ST template, CodeGenerator gen) {
    if ( g.tool.launch_ST_inspector ) {
      STViz viz = template.inspect();
      if (g.tool.ST_inspector_wait_for_close) {
        try {
          viz.waitForClose();
        }
        catch (InterruptedException ex) {
          g.tool.errMgr.toolError(ErrorType.INTERNAL_ERROR, ex);
        }
      }
View Full Code Here

    {
      boolean can_break = false;
      Object tok = tokens.get(i);
      if( tok instanceof Aggregate )
      {
        Aggregate atok = (Aggregate) tok;
        for (Map.Entry<String, Object> pairs : atok.properties.entrySet()) {
          if( pairs.getValue().equals("EOF") )
          {
            tokens.remove(i);
            can_break = true;
View Full Code Here

    st.add("x", new User(100, "parrt"));
    String expecting = "";
    String result = st.render();
    assertEquals(expecting, result);

    STRuntimeMessage msg = (STRuntimeMessage)errors.errors.get(0);
    STNoSuchPropertyException e = (STNoSuchPropertyException)msg.cause;
    assertEquals("User.qqq", e.propertyName);
  }
View Full Code Here

    ST st = new ST(group, template);
    st.add("u", new User(1, "parrt"));
    String expected = "";
    String result = st.render();
    assertEquals(expected, result);
    STRuntimeMessage msg = (STRuntimeMessage)errors.errors.get(0);
    STNoSuchPropertyException e = (STNoSuchPropertyException)msg.cause;
    assertEquals("org.stringtemplate.v4.test.BaseTest$User.qqq", e.propertyName);
  }
View Full Code Here

    st.add("u", new User(1, "parrt"));
    st.add("qqq", null);
    String expected = "";
    String result = st.render();
    assertEquals(expected, result);
    STRuntimeMessage msg = (STRuntimeMessage)errors.errors.get(0);
    STNoSuchPropertyException e = (STNoSuchPropertyException)msg.cause;
    assertEquals("org.stringtemplate.v4.test.BaseTest$User.null", e.propertyName);
  }
View Full Code Here

    st.add("u", new User(1, "parrt"));
    st.add("name", 100);
    String expected = "";
    String result = st.render();
    assertEquals(expected, result);
    STRuntimeMessage msg = (STRuntimeMessage)errors.errors.get(0);
    STNoSuchPropertyException e = (STNoSuchPropertyException)msg.cause;
    assertEquals("org.stringtemplate.v4.test.BaseTest$User.100", e.propertyName);
  }
View Full Code Here

TOP

Related Classes of org.stringtemplate.v4.misc.STRuntimeMessage

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.