org.jboss.windup.config.Variables.setVariable()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.jboss.windup.config.Variables.setVariable()方法的一些代码示例,展示了Variables.setVariable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Variables.setVariable()方法的具体详情如下:
包路径:org.jboss.windup.config.Variables
类名称:Variables
方法名:setVariable

Variables.setVariable介绍

[英]Set a variable in the top variables layer to given "collection" of the vertex frames. Can't be reassigned - throws on attempt to reassign.
[中]将顶层变量层中的变量设置为给定的顶点帧“集合”。无法重新分配-尝试重新分配时抛出。

代码示例

代码示例来源:origin: org.jboss.windup.config/windup-config-api

/**
 * Type-safe wrapper around setVariable which sets only one framed vertex.
 */
public void setSingletonVariable(String name, WindupVertexFrame frame)
{
  setVariable(name, Collections.singletonList(frame));
}

代码示例来源:origin: windup/windup

/**
 * Type-safe wrapper around setVariable which sets only one framed vertex.
 */
public void setSingletonVariable(String name, WindupVertexFrame frame)
{
  setVariable(name, Collections.singletonList(frame));
}

代码示例来源:origin: org.jboss.windup.config/windup-config-api

/**
   * This sets the variable with the given name to the given value. If there is already a variable with the same name in the top-most stack frame,
   * we will combine them here.
   *
   * This helps in the case of multiple conditions tied together with "or" or "and".
   */
  protected void setResults(GraphRewrite event, String variable, Iterable<? extends WindupVertexFrame> results)
  {
    Variables variables = Variables.instance(event);
    Iterable<? extends WindupVertexFrame> existingVariables = variables.findVariable(variable, 1);
    if (existingVariables != null)
    {
      variables.setVariable(variable, Iterables.concat(existingVariables, results));
    }
    else
    {
      variables.setVariable(variable, results);
    }
  }
}

代码示例来源:origin: windup/windup

/**
   * This sets the variable with the given name to the given value. If there is already a variable with the same name in the top-most stack frame,
   * we will combine them here.
   *
   * This helps in the case of multiple conditions tied together with "or" or "and".
   */
  protected void setResults(GraphRewrite event, String variable, Iterable<? extends WindupVertexFrame> results)
  {
    Variables variables = Variables.instance(event);
    Iterable<? extends WindupVertexFrame> existingVariables = variables.findVariable(variable, 1);
    if (existingVariables != null)
    {
      variables.setVariable(variable, Iterables.concat(existingVariables, results));
    }
    else
    {
      variables.setVariable(variable, results);
    }
  }
}

代码示例来源:origin: windup/windup

@Override
public boolean evaluate(GraphRewrite event, EvaluationContext context)
{
  wrappedCondition.evaluate(event,context);
  Iterable<? extends WindupVertexFrame> vertices= Variables.instance(event).findVariable(wrappedCondition.getOutputVariablesName());
  Iterable<FileModel> resultIterable = FluentIterable.from(vertices).transformAndConcat(new Function<WindupVertexFrame, Iterable<FileModel>>()
  {
    @Nullable @Override
    public Iterable<FileModel> apply(WindupVertexFrame windupVertexFrame)
    {
      if (!(windupVertexFrame instanceof ToFileModelTransformable))
      {
        throw new WindupException("ToFileModel may work only with the objects that implements ToFileModelTransformable interface");
      }
      return ((ToFileModelTransformable) windupVertexFrame).transformToFileModel();
    }
  });
  Variables.instance(event).setVariable(getOutputVariablesName(),new FramesSetIterable(resultIterable));
  return resultIterable.iterator().hasNext();
}

代码示例来源:origin: windup/windup

Variables.instance(event).setVariable(getVarname(), resultSet);
return result;

代码示例来源:origin: org.jboss.windup.config/windup-config-api

Variables.instance(event).setVariable(getVarname(), resultSet);
return result;

代码示例来源:origin: org.jboss.windup.rules.apps/rules-xml

Variables.instance(event).setVariable(getOutputVariablesName(), resultLocations);
ExecutionStatistics.get().end("XmlFile.evaluate");
return !resultLocations.isEmpty();

代码示例来源:origin: org.jboss.windup.rules.apps/rules-java

try
  Variables.instance(event).setVariable(getVarname(), allFrameResults);

代码示例来源:origin: windup/windup

return false;
Variables.instance(event).setVariable(
      initialQueryID,
      new FramedVertexIterable<>(event.getGraphContext().getFramed(), resolvedTextSearch.toList(),

代码示例来源:origin: org.jboss.windup.rules.apps/windup-rules-java-api

return false;
Variables.instance(event).setVariable(
      initialQueryID,
      new FramedVertexIterable<>(event.getGraphContext().getFramed(), resolvedTextSearch.toList(),

相关文章