congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
AstReadOptionNode
Code IndexAdd Tabnine 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)

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 AstReadOptionNodeBuilder 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 StreamNested<R> 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(URI optionValue) {
  node.setOptionValue(new AstLiteralURIValue(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

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • setContentView (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JList (javax.swing)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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