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

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: k3po/k3po

public AstReadOptionNodeBuilder() {
  this(new AstReadOptionNode());
}
origin: k3po/k3po

@Override
protected final boolean equalTo(AstOptionNode that) {
  return that instanceof AstReadOptionNode &&
      equalTo((AstReadOptionNode) that);
}
origin: k3po/k3po

public AstReadOptionNodeBuilder setOptionName(String optionName) {
  node.setOptionName(optionName);
  return this;
}
origin: k3po/k3po

@Override
public Configuration visit(AstReadOptionNode node, State state) {
  TypeInfo<?> optionType = node.getOptionType();
  if (optionType == DefaultTypeSystem.OPTION_MASK) {
    AstValue<?> maskValue = node.getOptionValue();
    state.readUnmasker = maskValue.accept(new GenerateMaskOptionValueVisitor(), state);
  }
  else {
    ChannelHandler handler = behaviorSystem.newReadOptionHandler(node);
    String optionName = node.getOptionName();
    if (handler != null) {
      String handlerName = String.format("readOption#%d (%s)", state.pipelineAsMap.size() + 1, optionName);
      state.pipelineAsMap.put(handlerName, handler);
    }
    else {
      throw new IllegalArgumentException("Unrecognized read option : " + optionName);
    }
  }
  return state.configuration;
}
origin: k3po/k3po

  @Override
  public AstReadOptionNode visitReadOptionNode(ReadOptionNodeContext ctx) {
    String optionQName = ctx.optionName().getText();
    TypeInfo<?> optionType = TYPE_SYSTEM.readOption(optionQName);
    Class<?> expectedType = optionType.getType();
    AstValueVisitor<?> visitor = new AstValueVisitor<>(factory, environment, expectedType);
    AstValue<?> optionValue = visitor.visit(ctx);
    childInfos().add(optionValue.getRegionInfo());
    node = new AstReadOptionNode();
    node.setOptionType(optionType);
    node.setOptionName(optionQName);
    node.setOptionValue(optionValue);
    node.setRegionInfo(asSequentialRegion(childInfos, ctx));
    return node;
  }
}
origin: k3po/k3po

  @Override
  protected void describe(StringBuilder buf) {
    super.describe(buf);
    buf.append(format("read option %s %s\n", getOptionName(), getOptionValue()));
  }
}
origin: k3po/k3po

private static ReadOptionFileOffsetHandler newReadFileOffsetHandler(
  AstReadOptionNode node)
{
  AstLiteralTextValue offsetValue = (AstLiteralTextValue) node.getOptionValue();
  int offset = Integer.parseInt(offsetValue.getValue());
  ReadOptionFileOffsetHandler handler = new ReadOptionFileOffsetHandler(offset);
  handler.setRegionInfo(node.getRegionInfo());
  return handler;
}
origin: k3po/k3po

public AstReadOptionNodeBuilder setOptionValue(ValueExpression expression, ExpressionContext environment) {
  node.setOptionValue(new AstExpressionValue<>(expression, environment));
  return this;
}
origin: k3po/k3po

@Override
public AstReadOptionNode visitReadOptionNode(ReadOptionNodeContext ctx) {
  AstReadOptionNodeVisitor visitor = new AstReadOptionNodeVisitor(factory, environment);
  AstReadOptionNode optionNode = visitor.visitReadOptionNode(ctx);
  if (optionNode != null) {
    childInfos().add(optionNode.getRegionInfo());
  }
  return optionNode;
}
origin: k3po/k3po

public StreamNested<R> setOptionType(TypeInfo<?> optionType) {
  node.setOptionType(optionType);
  return this;
}
origin: k3po/k3po

public ChannelHandler newReadOptionHandler(
  AstReadOptionNode node) {
  TypeInfo<?> optionType = node.getOptionType();
  ReadOptionFactory factory = readOptions.getOrDefault(optionType, n -> null);
  return factory.newHandler(node);
}
origin: k3po/k3po

public StreamNested<R> setOptionValue(long optionValue) {
  node.setOptionValue(new AstLiteralLongValue(optionValue));
  return this;
}
origin: k3po/k3po

public AstReadOptionNodeBuilder setOptionType(TypeInfo<?> optionType) {
  node.setOptionType(optionType);
  return this;
}
origin: k3po/k3po

public AstReadOptionNodeBuilder setOptionValue(long optionValue) {
  node.setOptionValue(new AstLiteralLongValue(optionValue));
  return this;
}
origin: k3po/k3po

public StreamNested<R> setOptionName(String optionName) {
  node.setOptionName(optionName);
  return this;
}
origin: k3po/k3po

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

public StreamNested<R> setOptionValue(byte[] optionValue) {
  node.setOptionValue(new AstLiteralBytesValue(optionValue));
  return this;
}
origin: k3po/k3po

public StreamNested<R> setOptionValue(URI optionValue) {
  node.setOptionValue(new AstLiteralURIValue(optionValue));
  return this;
}
origin: k3po/k3po

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

public AstReadOptionNodeBuilder setOptionValue(int optionValue) {
  node.setOptionValue(new AstLiteralIntegerValue(optionValue));
  return this;
}
org.kaazing.k3po.lang.internal.astAstReadOptionNode

Most used methods

  • getOptionName
  • getOptionValue
  • getRegionInfo
  • <init>
  • equalTo
  • getOptionType
  • setOptionName
  • setOptionType
  • setOptionValue
  • setRegionInfo

Popular in Java

  • Running tasks concurrently on multiple threads
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JOptionPane (javax.swing)
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