Examples of FormalArgument


Examples of org.stringtemplate.v4.compiler.FormalArgument

    if ( STGroup.trackCreationEvents ) {
      if ( debugState==null ) debugState = new ST.DebugState();
      debugState.addAttrEvents.map(name, new AddAttributeEvent(name, value));
    }

    FormalArgument arg = null;
    if ( impl.hasFormalArgs ) {
      if ( impl.formalArguments!=null ) arg = impl.formalArguments.get(name);
      if ( arg==null ) {
        throw new IllegalArgumentException("no such attribute: "+name);
      }
    }
    else {
      // define and make room in locals (a hack to make new ST("simple template") work.)
      if ( impl.formalArguments!=null ) {
        arg = impl.formalArguments.get(name);
      }
      if ( arg==null ) { // not defined
        arg = new FormalArgument(name);
        impl.addArg(arg);
        if ( locals==null ) locals = new Object[1];
        //else locals = Arrays.copyOf(locals, impl.formalArguments.size());
        else {
          Object[] copy = new Object[impl.formalArguments.size()];
View Full Code Here

Examples of org.stringtemplate.v4.compiler.FormalArgument

      if ( impl.hasFormalArgs ) {
        throw new IllegalArgumentException("no such attribute: "+name);
      }
      return;
    }
    FormalArgument arg = impl.formalArguments.get(name);
    if ( arg==null ) {
      throw new IllegalArgumentException("no such attribute: "+name);
    }
    locals[arg.index] = EMPTY_ATTR; // reset value
  }
View Full Code Here

Examples of org.stringtemplate.v4.compiler.FormalArgument

   */
    protected void rawSetAttribute(String name, Object value) {
    if ( impl.formalArguments==null ) {
      throw new IllegalArgumentException("no such attribute: "+name);
    }
    FormalArgument arg = impl.formalArguments.get(name);
    if ( arg==null ) {
      throw new IllegalArgumentException("no such attribute: "+name);
    }
    locals[arg.index] = value;
  }
View Full Code Here

Examples of org.stringtemplate.v4.compiler.FormalArgument

    locals[arg.index] = value;
  }

  /** Find an attr in this template only. */
  public Object getAttribute(String name) {
    FormalArgument localArg = null;
    if ( impl.formalArguments!=null ) localArg = impl.formalArguments.get(name);
    if ( localArg!=null ) {
      Object o = locals[localArg.index];
      if ( o==ST.EMPTY_ATTR ) o = null;
      return o;
View Full Code Here

Examples of org.stringtemplate.v4.compiler.FormalArgument

    if ( STGroup.trackCreationEvents ) {
      if ( debugState==null ) debugState = new ST.DebugState();
      debugState.addAttrEvents.map(name, new AddAttributeEvent(name, value));
    }

    FormalArgument arg = null;
    if ( impl.hasFormalArgs ) {
      if ( impl.formalArguments!=null ) arg = impl.formalArguments.get(name);
      if ( arg==null ) {
        throw new IllegalArgumentException("no such attribute: "+name);
      }
    }
    else {
      // define and make room in locals (a hack to make new ST("simple template") work.)
      if ( impl.formalArguments!=null ) {
        arg = impl.formalArguments.get(name);
      }
      if ( arg==null ) { // not defined
        arg = new FormalArgument(name);
        impl.addArg(arg);
        if ( locals==null ) locals = new Object[1];
        //else locals = Arrays.copyOf(locals, impl.formalArguments.size());
        else {
          Object[] copy = new Object[impl.formalArguments.size()];
View Full Code Here

Examples of org.stringtemplate.v4.compiler.FormalArgument

      if ( impl.hasFormalArgs ) {
        throw new IllegalArgumentException("no such attribute: "+name);
      }
      return;
    }
    FormalArgument arg = impl.formalArguments.get(name);
    if ( arg==null ) {
      throw new IllegalArgumentException("no such attribute: "+name);
    }
    locals[arg.index] = EMPTY_ATTR; // reset value
  }
View Full Code Here

Examples of org.stringtemplate.v4.compiler.FormalArgument

   */
    protected void rawSetAttribute(String name, Object value) {
    if ( impl.formalArguments==null ) {
      throw new IllegalArgumentException("no such attribute: "+name);
    }
    FormalArgument arg = impl.formalArguments.get(name);
    if ( arg==null ) {
      throw new IllegalArgumentException("no such attribute: "+name);
    }
    locals[arg.index] = value;
  }
View Full Code Here

Examples of org.stringtemplate.v4.compiler.FormalArgument

    locals[arg.index] = value;
  }

  /** Find an attribute in this template only. */
  public Object getAttribute(String name) {
    FormalArgument localArg = null;
    if ( impl.formalArguments!=null ) localArg = impl.formalArguments.get(name);
    if ( localArg!=null ) {
      Object o = locals[localArg.index];
      if ( o==ST.EMPTY_ATTR ) o = null;
      return o;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.