Package org.jboss.errai.codegen.control.branch

Examples of org.jboss.errai.codegen.control.branch.Label


   * @param name  the name of the label.
   * @return the {@link LabelReference} found, can not be null.
   * @throws OutOfScopeException  if label with the given name can not be found.
   */
  public LabelReference getLabel(String name) {
    Label found = null;
    Context ctx = this;
    do {
      if (ctx.labels != null) {
        found = ctx.labels.get(name);
      }
    }
    while (found == null && (ctx = ctx.parent) != null);

    if (found == null)
      throw new OutOfScopeException("Label not found: " + name);

    return found.getReference();
  }
View Full Code Here


   *
   * @throws OutOfScopeException
   *     if label with the given name can not be found.
   */
  public LabelReference getLabel(final String name) {
    Label found = null;
    Context ctx = this;
    do {
      if (ctx.labels != null) {
        found = ctx.labels.get(name);
      }
    }
    while (found == null && (ctx = ctx.parent) != null);

    if (found == null) {
      throw new OutOfScopeException("Label not found: " + name);
    }

    return found.getReference();
  }
View Full Code Here

   * @throws OutOfScopeException
   *     if label with the given name can not be found.
   */
  public LabelReference getLabel(final String name) {
    checkThread();
    Label found = null;
    Context ctx = this;
    do {
      if (ctx.labels != null) {
        found = ctx.labels.get(name);
      }
    }
    while (found == null && (ctx = ctx.parent) != null);

    if (found == null) {
      throw new OutOfScopeException("Label not found: " + name);
    }

    return found.getReference();
  }
View Full Code Here

   * @param name  the name of the label.
   * @return the {@link LabelReference} found, can not be null.
   * @throws OutOfScopeException  if label with the given name can not be found.
   */
  public LabelReference getLabel(String name) {
    Label found = null;
    Context ctx = this;
    do {
      if (ctx.labels != null) {
        found = ctx.labels.get(name);
      }
    }
    while (found == null && (ctx = ctx.parent) != null);

    if (found == null)
      throw new OutOfScopeException("Label not found: " + name);

    return found.getReference();
  }
View Full Code Here

    this.name = name;
  }
 
  @Override
  public void handleCall(CallWriter writer, Context context, Statement statement) {
    Label label = Label.create(name);
    context.addLabel(label);
   
    writer.reset();
    writer.append(label.generate(context));
  }
View Full Code Here

   *
   * @throws OutOfScopeException
   *     if label with the given name can not be found.
   */
  public LabelReference getLabel(final String name) {
    Label found = null;
    Context ctx = this;
    do {
      if (ctx.labels != null) {
        found = ctx.labels.get(name);
      }
    }
    while (found == null && (ctx = ctx.parent) != null);

    if (found == null) {
      throw new OutOfScopeException("Label not found: " + name);
    }

    return found.getReference();
  }
View Full Code Here

  @Override
  public void handleCall(final CallWriter writer,
                         final Context context,
                         final Statement statement) {

    final Label label = Label.create(name);
    context.addLabel(label);
   
    writer.reset();
    writer.append(label.generate(context));
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.codegen.control.branch.Label

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.