congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AstWriteConfigNode
Code IndexAdd Tabnine 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)

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 AstWriteConfigNodeBuilder setValue(String name, byte[] value) {
  node.setValue(name, new AstLiteralBytesValue(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

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Option (scala)
  • Best plugins for Eclipse
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