Codota Logo
AstWriteConfigNode
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: k3po/k3po

@Override
public AstScriptNode visit(AstWriteConfigNode node, State state) {
  conditionallyInjectWriteBarrier(state, node.getRegionInfo());
  state.streamables.add(node);
  state.readWriteState = ReadWriteState.WRITE;
  return null;
}
origin: k3po/k3po

public StreamNested(R builder) {
  super(new AstWriteConfigNode(), builder);
}
origin: k3po/k3po

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

private static WriteConfigHandler newWriteHttpTrailerHandler(
  AstWriteConfigNode node,
  Function<AstValue<?>, MessageEncoder> encoderFactory)
{
  AstValue<?> name = node.getValue("name");
  MessageEncoder nameEncoder = encoderFactory.apply(name);
  List<MessageEncoder> valueEncoders = new ArrayList<>();
  for (AstValue<?> value : node.getValues()) {
    valueEncoders.add(encoderFactory.apply(value));
  }
  WriteConfigHandler handler = new WriteConfigHandler(new HttpTrailerEncoder(nameEncoder, valueEncoders));
  handler.setRegionInfo(node.getRegionInfo());
  return handler;
}
origin: k3po/k3po

private static WriteConfigHandler newWriteHttpStatusHandler(
  AstWriteConfigNode node,
  Function<AstValue<?>, MessageEncoder> encoderFactory)
{
  AstValue<?> code = node.getValue("code");
  AstValue<?> reason = node.getValue("reason");
  MessageEncoder codeEncoder = encoderFactory.apply(code);
  MessageEncoder reasonEncoder = encoderFactory.apply(reason);
  WriteConfigHandler handler = new WriteConfigHandler(new HttpStatusEncoder(codeEncoder, reasonEncoder));
  handler.setRegionInfo(node.getRegionInfo());
  return handler;
}
origin: k3po/k3po

  @Override
  public AstWriteConfigNode visitWriteValue(WriteValueContext ctx) {
    AstValueVisitor<?> visitor = new AstValueVisitor<>(factory, environment, Object.class);
    AstValue<?> value = visitor.visit(ctx);
    if (value != null) {
      if (namedFields.hasNext()) {
        TypeInfo<?> field = namedFields.next();
        node.setValue(field.getName(), value);
      }
      else if (anonymousFields > 0) {
        anonymousFields--;
        node.addValue(value);
      }
      else {
        throw new IllegalStateException(String.format("Unexpected %s syntax", node.getType()));
      }
      childInfos().add(value.getRegionInfo());
    }
    return node;
  }
}
origin: k3po/k3po

@Override
public AstWriteConfigNode visitWriteConfigNode(WriteConfigNodeContext ctx) {
  String configQName = ctx.QualifiedName().getText();
  node = new AstWriteConfigNode();
  StructuredTypeInfo configType = TYPE_SYSTEM.writeConfig(configQName);
  namedFields = configType.getNamedFields().iterator();
  anonymousFields = configType.getAnonymousFields();
  node.setType(configType);
  super.visitWriteConfigNode(ctx);
  node.setRegionInfo(asSequentialRegion(childInfos, ctx));
  return node;
}
origin: k3po/k3po

public ChannelHandler newWriteConfigHandler(
  AstWriteConfigNode node,
  Function<AstValue<?>, MessageEncoder> encoderFactory) {
  StructuredTypeInfo type = node.getType();
  WriteConfigFactory factory = writeConfigs.getOrDefault(type, (n, f) -> null);
  return factory.newHandler(node, encoderFactory);
}
origin: k3po/k3po

public AstWriteConfigNodeBuilder setValue(String name, String value) {
  node.setValue(name, new AstLiteralTextValue(value));
  return this;
}
origin: k3po/k3po

public AstWriteConfigNodeBuilder addValue(ValueExpression value, ExpressionContext environment) {
  node.addValue(new AstExpressionValue<>(value, environment));
  return this;
}
origin: k3po/k3po

public StreamNested<R> setType(StructuredTypeInfo type) {
  node.setType(type);
  return this;
}
origin: k3po/k3po

private static WriteConfigHandler newWriteHttpParameterHandler(
  AstWriteConfigNode node,
  Function<AstValue<?>, MessageEncoder> encoderFactory)
{
  AstValue<?> name = node.getValue("name");
  MessageEncoder nameEncoder = encoderFactory.apply(name);
  List<MessageEncoder> valueEncoders = new ArrayList<>();
  for (AstValue<?> value : node.getValues()) {
    valueEncoders.add(encoderFactory.apply(value));
  }
  WriteConfigHandler handler = new WriteConfigHandler(new HttpParameterEncoder(nameEncoder, valueEncoders));
  handler.setRegionInfo(node.getRegionInfo());
  return handler;
}
origin: k3po/k3po

private static WriteConfigHandler newWriteHttpMethodHandler(
  AstWriteConfigNode node,
  Function<AstValue<?>, MessageEncoder> encoderFactory)
{
  AstValue<?> methodName = node.getValue();
  requireNonNull(methodName);
  MessageEncoder methodEncoder = encoderFactory.apply(methodName);
  WriteConfigHandler handler = new WriteConfigHandler(new HttpMethodEncoder(methodEncoder));
  handler.setRegionInfo(node.getRegionInfo());
  return handler;
}
origin: k3po/k3po

@Override
public Configuration visit(AstWriteConfigNode node, State state) {
  Function<AstValue<?>, MessageEncoder> encoderFactory = v -> v.accept(new GenerateWriteEncoderVisitor(), null);
  ChannelHandler handler = behaviorSystem.newWriteConfigHandler(node, encoderFactory);
  if (handler != null) {
    Map<String, ChannelHandler> pipelineAsMap = state.pipelineAsMap;
    String handlerName = String.format("writeConfig#%d (%s)", pipelineAsMap.size() + 1, node.getType().getName());
    pipelineAsMap.put(handlerName, handler);
    return state.configuration;
  }
  else {
    throw new IllegalStateException("Unrecognized configuration type: " + node.getType());
  }
}
origin: k3po/k3po

public StreamNested<R> setValue(String name, String value) {
  node.setValue(name, new AstLiteralTextValue(value));
  return this;
}
origin: k3po/k3po

public StreamNested<R> addValue(String value) {
  node.addValue(new AstLiteralTextValue(value));
  return this;
}
origin: k3po/k3po

public AstWriteConfigNodeBuilder setType(StructuredTypeInfo type) {
  node.setType(type);
  return this;
}
origin: k3po/k3po

private static WriteConfigHandler newWriteHttpHeaderHandler(
  AstWriteConfigNode node,
  Function<AstValue<?>, MessageEncoder> encoderFactory)
{
  AstValue<?> name = node.getValue("name");
  MessageEncoder nameEncoder = encoderFactory.apply(name);
  List<MessageEncoder> valueEncoders = new ArrayList<>();
  for (AstValue<?> value : node.getValues()) {
    valueEncoders.add(encoderFactory.apply(value));
  }
  WriteConfigHandler handler = new WriteConfigHandler(new HttpHeaderEncoder(nameEncoder, valueEncoders));
  handler.setRegionInfo(node.getRegionInfo());
  return handler;
}
origin: k3po/k3po

private static WriteConfigHandler newWriteHttpVersionHandler(
  AstWriteConfigNode node,
  Function<AstValue<?>, MessageEncoder> encoderFactory)
{
  AstValue<?> version = node.getValue();
  MessageEncoder versionEncoder = encoderFactory.apply(version);
  WriteConfigHandler handler = new WriteConfigHandler(new HttpVersionEncoder(versionEncoder));
  handler.setRegionInfo(node.getRegionInfo());
  return handler;
}
origin: k3po/k3po

@Override
public AstWriteConfigNode visitWriteConfigNode(WriteConfigNodeContext ctx) {
  AstWriteConfigNodeVisitor visitor = new AstWriteConfigNodeVisitor(factory, environment);
  AstWriteConfigNode writeConfigNode = visitor.visitWriteConfigNode(ctx);
  if (writeConfigNode != null) {
    childInfos().add(writeConfigNode.getRegionInfo());
  }
  return writeConfigNode;
}
org.kaazing.k3po.lang.internal.astAstWriteConfigNode

Most used methods

  • getRegionInfo
  • getType
  • <init>
  • addValue
  • equalTo
  • getValue
  • getValues
  • setRegionInfo
  • setType
  • setValue
  • toString
  • toString

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getSystemService (Context)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now