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

How to use
AstLiteralBytesValue
in
org.kaazing.k3po.lang.internal.ast.value

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

origin: k3po/k3po

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

@Override
protected void describe(StringBuilder buf) {
  describe(buf, value);
}
origin: k3po/k3po

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

@Override
public AstLiteralBytesValue visitLiteralBytes(LiteralBytesContext ctx) {
  String literal = ctx.literal.getText();
  AstLiteralBytesValue value = new AstLiteralBytesValue(parseHexBytes(literal));
  value.setRegionInfo(asSequentialRegion(childInfos, ctx));
  return value;
}
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

@Override
public Masker visit(AstLiteralBytesValue value, State state) {
  byte[] literalBytes = value.getValue();
  for (byte literalByte : literalBytes) {
    if (literalByte != 0x00) {
      return Maskers.newMasker(literalBytes);
    }
  }
  // no need to unmask for all-zeros masking key
  return Masker.IDENTITY_MASKER;
}
origin: k3po/k3po

@Override
public AstValue<T> visitLiteralBytes(LiteralBytesContext ctx) {
  AstLiteralBytesValueVisitor visitor = new AstLiteralBytesValueVisitor(factory, environment);
  AstLiteralBytesValue value = visitor.visit(ctx);
  if (value != null) {
    childInfos().add(value.getRegionInfo());
  }
  return (AstValue<T>) value;
}
origin: k3po/k3po

@Override
protected Object decodeBuffer(ChannelBuffer buffer) throws Exception {
  final int resolvedLength;
  // TODO: Remove when JUEL sync bug is fixed https://github.com/k3po/k3po/issues/147
  synchronized (environment) {
    resolvedLength = (Integer) length.getValue(environment);
  }
  if (buffer.readableBytes() < resolvedLength) {
    return null;
  }
  if (captureName == null) {
    buffer.readSlice(resolvedLength);
  } else {
    byte[] bytes = new byte[resolvedLength];
    buffer.readBytes(bytes, 0, resolvedLength);
    // TODO: Remove when JUEL sync bug is fixed https://github.com/k3po/k3po/issues/147
    synchronized (environment) {
      environment.getELResolver().setValue(environment, null, captureName, bytes);
    }
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug(format("Setting value for ${%s} to %s", captureName, AstLiteralBytesValue.toString(bytes)));
    }
  }
  return buffer;
}
origin: k3po/k3po

@Override
public MessageEncoder visit(AstLiteralBytesValue value, Void parameter) {
  return new WriteBytesEncoder(value.getValue());
}
origin: k3po/k3po

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

@Override
protected Object decodeBuffer(ChannelBuffer buffer) throws Exception {
  if (buffer.readableBytes() < length) {
    return null;
  }
  if (captureName == null) {
    buffer.readSlice(length);
  } else {
    T value = readBuffer(buffer);
    // TODO: Remove when JUEL sync bug is fixed https://github.com/k3po/k3po/issues/147
    synchronized (environment) {
      environment.getELResolver().setValue(environment, null, captureName, value);
    }
    if (LOGGER.isDebugEnabled()) {
      Object formatValue = (value instanceof byte[]) ? AstLiteralBytesValue.toString((byte[]) value) : value;
      LOGGER.debug(format("Setting value for ${%s} to %s", captureName, formatValue));
    }
  }
  return buffer;
}
origin: k3po/k3po

public static String toString(byte[] value) {
  StringBuilder buf = new StringBuilder();
  describe(buf, value);
  return buf.toString();
}
origin: k3po/k3po

public AstWriteNodeBuilder addExactBytes(byte[] exactBytes) {
  node.addValue(new AstLiteralBytesValue(exactBytes));
  return this;
}
origin: k3po/k3po

@Override
protected Object decodeBufferLast(ChannelBuffer buffer) throws Exception {
  if (buffer.readableBytes() < length) {
    throw new ScriptProgressException(getRegionInfo(), String.format("Expected %d bytes, found %d", length, buffer.readableBytes()));
  }
  if (captureName == null) {
    buffer.readSlice(length);
  } else {
    T value = readBuffer(buffer);
    // TODO: Remove when JUEL sync bug is fixed https://github.com/k3po/k3po/issues/147
    synchronized (environment) {
      environment.getELResolver().setValue(environment, null, captureName, value);
    }
    if (LOGGER.isDebugEnabled()) {
      Object formatValue = (value instanceof byte[]) ? AstLiteralBytesValue.toString((byte[]) value) : value;
      LOGGER.debug(format("Setting value for ${%s} to %s", captureName, formatValue));
    }
  }
  return buffer;
}
origin: k3po/k3po

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

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

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

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

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

public AstWriteConfigNodeBuilder addValue(byte[] value) {
  node.addValue(new AstLiteralBytesValue(value));
  return this;
}
org.kaazing.k3po.lang.internal.ast.valueAstLiteralBytesValue

Most used methods

  • <init>
  • describe
  • equalTo
  • getRegionInfo
  • getValue
  • setRegionInfo
  • toString

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • String (java.lang)
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JOptionPane (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top Sublime Text 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