Tabnine Logo
AstPropertyNode
Code IndexAdd Tabnine to your IDE (free)

How to use
AstPropertyNode
in
org.kaazing.k3po.lang.internal.ast

Best Java code snippets using org.kaazing.k3po.lang.internal.ast.AstPropertyNode (Showing top 12 results out of 315)

origin: k3po/k3po

public ScriptNested(R builder) {
  super(new AstPropertyNode(), builder);
}
origin: k3po/k3po

@Override
protected boolean equalTo(AstRegion that) {
  return that instanceof AstPropertyNode && equalTo((AstPropertyNode) that);
}
origin: k3po/k3po

public AstPropertyNodeBuilder setPropertyName(String propertyName) {
  node.setPropertyName(propertyName);
  return this;
}
origin: k3po/k3po

@Override
public AstPropertyNode visitPropertyNode(PropertyNodeContext ctx) {
  AstValueVisitor<?> visitor = new AstValueVisitor<>(factory, environment, Object.class);
  AstValue<?> value = visitor.visit(ctx.value);
  childInfos().add(value.getRegionInfo());
  node = new AstPropertyNode();
  node.setRegionInfo(asSequentialRegion(childInfos, ctx));
  node.setPropertyName(ctx.name.getText());
  node.setPropertyValue(value);
  node.setEnvironment(environment);
  return node;
}
origin: k3po/k3po

@Override
protected void describe(StringBuilder buf) {
  super.describe(buf);
  buf.append(format("property %s %s\n", getPropertyName(), getPropertyValue()));
}
origin: k3po/k3po

@Override
public Configuration visit(AstPropertyNode propertyNode, State state) {
  String propertyName = propertyNode.getPropertyName();
  Object value = propertyNode.resolve();
  if (value instanceof AutoCloseable) {
    state.configuration.getResources().add((AutoCloseable) value);
  }
  if (LOGGER.isDebugEnabled()) {
    Object formatValue = (value instanceof byte[]) ? AstLiteralBytesValue.toString((byte[]) value) : value;
    LOGGER.debug(format("Setting value for ${%s} to %s", propertyName, formatValue));
  }
  return state.configuration;
}
origin: k3po/k3po

private String injectOverridenProperties(String aggregatedScript, List<String> scriptProperties)
    throws Exception, ScriptParseException {
  ScriptParserImpl parser = new ScriptParserImpl();
  for (String propertyToInject : scriptProperties) {
    String propertyName = parser.parseWithStrategy(propertyToInject, PROPERTY_NODE).getPropertyName();
    StringBuilder replacementScript = new StringBuilder();
    Pattern pattern = Pattern.compile("property\\s+" + propertyName + "\\s+.+");
    boolean matchFound = false;
    for (String scriptLine : aggregatedScript.split("\\r?\\n")) {
      if (pattern.matcher(scriptLine).matches()) {
        matchFound = true;
        replacementScript.append(propertyToInject + "\n");
      } else {
        replacementScript.append(scriptLine + "\n");
      }
    }
    if (!matchFound) {
      String errorMsg = "Received " + propertyToInject + " in PREPARE but found no where to substitute it";
      LOGGER.error(errorMsg);
      throw new Exception(errorMsg);
    }
    aggregatedScript = replacementScript.toString();
  }
  return aggregatedScript;
}
origin: k3po/k3po

  @Override
  protected void describe(StringBuilder buf) {
    if (properties != null) {
      for (AstPropertyNode property : properties) {
        property.describe(buf);
      }
    }
    if (streams != null) {
      for (AstStreamNode stream : streams) {
        stream.describe(buf);
      }
    }
  }
}
origin: k3po/k3po

@Override
public AstScriptNode visitPropertyNode(PropertyNodeContext ctx) {
  AstPropertyNodeVisitor visitor = new AstPropertyNodeVisitor(factory, environment);
  AstPropertyNode propertyNode = visitor.visitPropertyNode(ctx);
  if (propertyNode != null) {
    node.getProperties().add(propertyNode);
    childInfos().add(propertyNode.getRegionInfo());
  }
  return node;
}
origin: k3po/k3po

@Override
public Configuration visit(AstScriptNode script, State state) {
  state.configuration = new Configuration();
  for (AstPropertyNode property : script.getProperties()) {
    property.accept(this, state);
  }
  for (AstStreamNode stream : script.getStreams()) {
    stream.accept(this, state);
  }
  return state.configuration;
}
origin: k3po/k3po

public ScriptNested<R> setOptionName(String propertyName) {
  node.setPropertyName(propertyName);
  return this;
}
origin: k3po/k3po

public AstPropertyNodeBuilder() {
  this(new AstPropertyNode());
}
org.kaazing.k3po.lang.internal.astAstPropertyNode

Most used methods

  • getPropertyName
  • <init>
  • accept
  • describe
  • equalTo
  • getPropertyValue
  • getRegionInfo
  • resolve
  • setEnvironment
  • setPropertyName
  • setPropertyValue
  • setRegionInfo
  • setPropertyValue,
  • setRegionInfo

Popular in Java

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • requestLocationUpdates (LocationManager)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now