Package org.stringtemplate.v4.misc

Examples of org.stringtemplate.v4.misc.STNoSuchPropertyException


        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

    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

    public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName)
      throws STNoSuchPropertyException
    {
      if ( propertyName.equals("id") ) return ((User)o).id;
      if ( propertyName.equals("name") ) return ((User)o).getName();
      throw new STNoSuchPropertyException(null, o, "User."+propertyName);
    }
View Full Code Here

    public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName)
      throws STNoSuchPropertyException
    {
      if ( propertyName.equals("id") ) return "const id value";
      if ( propertyName.equals("name") ) return "const name value";
      throw new STNoSuchPropertyException(null, o, "User."+propertyName);
    }
View Full Code Here

    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("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("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.STNoSuchPropertyException

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.