Package org.chromium.sdk.JsValue

Examples of org.chromium.sdk.JsValue.Type


    }
    return new LoadableString.Immutable(handle.text());
  }

  public static Type calculateType(String typeString, String className, boolean tolerateNullType) {
    Type type = JsDataTypeUtil.fromJsonTypeAndClassName(typeString, className);
    if (type == null) {
      if (tolerateNullType) {
        type = Type.TYPE_OBJECT;
      } else {
        throw new ValueLoadException("Bad value object");
View Full Code Here


    this.rawName = rawName;
    this.value = createValue(valueLoader, valueData);
  }

  public static JsValueBase createValue(ValueLoader valueLoader, ValueMirror valueData) {
    Type type = valueData.getType();
    switch (type) {
      case TYPE_FUNCTION:
        return new JsFunctionImpl(valueLoader, valueData);
      case TYPE_ERROR:
      case TYPE_OBJECT:
View Full Code Here

   * Tries to construct the full {@link ValueMirror} from V8 debugger display data (preview)
   * if it's possible.
   */
  public static ValueMirror createIfSure(final RefWithDisplayData refWithDisplayData) {
    long ref = refWithDisplayData.ref();
    final Type type = V8Helper.calculateType(refWithDisplayData.type(),
        refWithDisplayData.className(), false);

    if (!TYPES_WITH_ACCURATE_DISPLAY.contains(type)) {
      return null;
    }
View Full Code Here

   * @param valueHandle containing the object specification from the V8 debugger
   */
  public static ValueMirror create(final ValueHandle valueHandle, final Factory factory) {
    Long ref = valueHandle.handle();

    final Type type = V8Helper.calculateType(valueHandle.type(), valueHandle.className(), true);

    return new ValueMirror(ref) {
      @Override
      public Type getType() {
        return type;
View Full Code Here

  private void renderInternal(JsValue value, int maxLength, boolean descend, StringBuilder output) {
    if (!descend) {
      renderPrimitive(value, maxLength, output);
      return;
    }
    Type type = value.getType();
    // TODO(apavlov): implement good stringification of other types?
    switch (type) {
      case TYPE_ARRAY:
        renderArray(value.asObject().asArray(), maxLength, output);
        break;
View Full Code Here

    this.value = createValue(valueLoader, valueData, qualifiedName);
  }

  public static JsValueBase createValue(ValueLoader valueLoader, ValueMirror valueData,
      String qualifiedName) {
    Type type = valueData.getType();
    switch (type) {
      case TYPE_FUNCTION:
        return new JsFunctionImpl(valueLoader, qualifiedName, valueData);
      case TYPE_ERROR:
      case TYPE_OBJECT:
View Full Code Here

  private void renderInternal(JsValue value, int maxLength, boolean descend, StringBuilder output) {
    if (!descend) {
      renderPrimitive(value, maxLength, output);
      return;
    }
    Type type = value.getType();
    // TODO(apavlov): implement good stringification of other types?
    switch (type) {
      case TYPE_ARRAY:
        renderArray(value.asObject().asArray(), maxLength, output);
        break;
View Full Code Here

    }
    return new LoadableString.Immutable(handle.text());
  }

  public static Type calculateType(String typeString, String className, boolean tolerateNullType) {
    Type type = JsDataTypeUtil.fromJsonTypeAndClassName(typeString, className);
    if (type == null) {
      if (tolerateNullType) {
        type = Type.TYPE_OBJECT;
      } else {
        throw new ValueLoadException("Bad value object");
View Full Code Here

   * Constructs a {@link ValueMirror} given a V8 debugger object specification if it's possible.
   */
  public static ValueMirror create(final RefWithDisplayData refWithDisplayData,
      Factory loadableStringFactory) {
    Long ref = refWithDisplayData.ref();
    final Type type = V8Helper.calculateType(refWithDisplayData.type(),
        refWithDisplayData.className(), false);

    return new ValueMirror(ref) {
      @Override
      public Type getType() {
View Full Code Here

   * @param valueHandle containing the object specification from the V8 debugger
   */
  public static ValueMirror create(final ValueHandle valueHandle, final Factory factory) {
    Long ref = valueHandle.handle();

    final Type type = V8Helper.calculateType(valueHandle.type(), valueHandle.className(), true);

    return new ValueMirror(ref) {
      @Override
      public Type getType() {
        return type;
View Full Code Here

TOP

Related Classes of org.chromium.sdk.JsValue.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.