Package org.chromium.sdk.internal.wip.WipExpressionBuilder

Examples of org.chromium.sdk.internal.wip.WipExpressionBuilder.QualifiedNameBuilder


    }

    public String getFullyQualifiedName() {
      String result = qualifiedName;
      if (result == null) {
        QualifiedNameBuilder qualifiedNameBuilder = nameBuilder.getQualifiedNameBuilder();
        if (qualifiedNameBuilder == null) {
          return null;
        }
        StringBuilder builder = new StringBuilder();
        qualifiedNameBuilder.append(builder);
        result = builder.toString();
        qualifiedName = result;
      }
      return result;
    }
View Full Code Here


    }
  }

  public JsObjectProperty createObjectProperty(final PropertyDescriptorValue propertyDescriptor,
      final String hostObjectRefId, ValueNameBuilder nameBuilder) {
    final QualifiedNameBuilder qualifiedNameBuilder = nameBuilder.getQualifiedNameBuilder();
    JsValue jsValue = wrap(propertyDescriptor.value(), qualifiedNameBuilder);

    final JsValue getter = wrapPropertyDescriptorFunction(propertyDescriptor.get(),
        qualifiedNameBuilder, "getter");

    final JsValue setter = wrapPropertyDescriptorFunction(propertyDescriptor.set(),
        qualifiedNameBuilder, "setter");

    return new ObjectPropertyBase(jsValue, nameBuilder) {
      @Override public JsDeclarativeVariable asDeclarativeVariable() {
        return null;
      }
      @Override public boolean isWritable() {
        return propertyDescriptor.writable() == Boolean.TRUE;
      }
      @Override public JsValue getGetter() {
        return getter;
      }
      @Override public JsValue getSetter() {
        return setter;
      }
      @Override public boolean isConfigurable() {
        return propertyDescriptor.configurable() == Boolean.TRUE;
      }
      @Override public boolean isEnumerable() {
        return propertyDescriptor.enumerable() == Boolean.TRUE;
      }

      @Override
      public JsFunction getGetterAsFunction() {
        JsObject getterObject = getter.asObject();
        if (getterObject == null) {
          return null;
        }
        return getterObject.asFunction();
      }

      @Override
      public RelayOk evaluateGet(EvaluateCallback callback, SyncCallback syncCallback) {
        WipContextBuilder.GlobalEvaluateContext evaluateContext =
            new WipContextBuilder.GlobalEvaluateContext(valueLoader);

        JsFunction getterFunction = getGetterAsFunction();
        if (getterFunction == null) {
          throw new RuntimeException("Getter is not a function");
        }

        Map<String, SerializableValue> context = new HashMap<String, SerializableValue>(2);
        context.put(GETTER_VAR_NAME, (SerializableValue) getterFunction);
        context.put(OBJECT_VAR_NAME, SerializableValue.Util.wrapRefId(hostObjectRefId));
        final QualifiedNameBuilder pseudoPropertyNameBuilder =
            createPseudoPropertyNameBuilder(qualifiedNameBuilder, "value");
        ValueNameBuilder valueNameBuilder = new ValueNameBuilder() {
          @Override
          public String getShortName() {
            return "value";
View Full Code Here

    };
  }

  private static QualifiedNameBuilder createPseudoPropertyNameBuilder(
      final QualifiedNameBuilder propertyValueNameBuilder, final String symbolicName) {
    return new QualifiedNameBuilder() {
      @Override public boolean needsParentheses() {
        return false;
      }

      @Override
View Full Code Here

      QualifiedNameBuilder propertyValueNameBuilder, String symbolicName) {
    if (value == null) {
      return null;
    }

    QualifiedNameBuilder qualifiedNameBuilder =
        createPseudoPropertyNameBuilder(propertyValueNameBuilder, symbolicName);

    return wrap(value, qualifiedNameBuilder);
  }
View Full Code Here

    return wrap(value, qualifiedNameBuilder);
  }

  public JsVariable createVariable(RemoteObjectValue valueData, ValueNameBuilder nameBuilder) {
    QualifiedNameBuilder qualifiedNameBuilder;
    if (nameBuilder == null) {
      qualifiedNameBuilder = null;
    } else {
      qualifiedNameBuilder = nameBuilder.getQualifiedNameBuilder();
    }
View Full Code Here

    return createVariable(jsValue, nameBuilder);
  }

  public JsDeclarativeVariable createDeclarativeVariable(RemoteObjectValue valueData,
      ValueNameBuilder nameBuilder) {
    QualifiedNameBuilder qualifiedNameBuilder;
    if (nameBuilder == null) {
      qualifiedNameBuilder = null;
    } else {
      qualifiedNameBuilder = nameBuilder.getQualifiedNameBuilder();
    }
View Full Code Here

    @Override
    public String getFullyQualifiedName() {
      String result = qualifiedName;
      if (result == null) {
        QualifiedNameBuilder qualifiedNameBuilder = nameBuilder.getQualifiedNameBuilder();
        if (qualifiedNameBuilder == null) {
          return null;
        }
        StringBuilder builder = new StringBuilder();
        qualifiedNameBuilder.append(builder);
        result = builder.toString();
        qualifiedName = result;
      }
      return result;
    }
View Full Code Here

    this.valueLoader = valueLoader;
  }

  public JsObjectProperty createObjectProperty(final PropertyDescriptorValue propertyDescriptor,
      final String hostObjectRefId, ValueNameBuilder nameBuilder) {
    final QualifiedNameBuilder qualifiedNameBuilder = nameBuilder.getQualifiedNameBuilder();
    JsValue jsValue = wrap(propertyDescriptor.value(), qualifiedNameBuilder);

    final JsValue getter = wrapPropertyDescriptorFunction(propertyDescriptor.get(),
        qualifiedNameBuilder, "getter");

    final JsValue setter = wrapPropertyDescriptorFunction(propertyDescriptor.set(),
        qualifiedNameBuilder, "setter");

    return new ObjectPropertyBase(jsValue, nameBuilder) {
      @Override public boolean isWritable() {
        return propertyDescriptor.writable() == Boolean.TRUE;
      }
      @Override public JsValue getGetter() {
        return getter;
      }
      @Override public JsValue getSetter() {
        return setter;
      }
      @Override public boolean isConfigurable() {
        return propertyDescriptor.configurable() == Boolean.TRUE;
      }
      @Override public boolean isEnumerable() {
        return propertyDescriptor.enumerable() == Boolean.TRUE;
      }

      @Override
      public JsFunction getGetterAsFunction() {
        JsObject getterObject = getter.asObject();
        if (getterObject == null) {
          return null;
        }
        return getterObject.asFunction();
      }

      @Override
      public RelayOk evaluateGet(EvaluateCallback callback, SyncCallback syncCallback) {
        WipContextBuilder.GlobalEvaluateContext evaluateContext =
            new WipContextBuilder.GlobalEvaluateContext(valueLoader);

        JsFunction getterFunction = getGetterAsFunction();
        if (getterFunction == null) {
          throw new RuntimeException("Getter is not a function");
        }

        Map<String, String> context = new HashMap<String, String>(2);
        context.put(GETTER_VAR_NAME, getterFunction.getRefId());
        context.put(OBJECT_VAR_NAME, hostObjectRefId);
        final QualifiedNameBuilder pseudoPropertyNameBuilder =
            createPseudoPropertyNameBuilder(qualifiedNameBuilder, "value");
        ValueNameBuilder valueNameBuilder = new ValueNameBuilder() {
          @Override
          public String getShortName() {
            return "value";
View Full Code Here

    };
  }

  private static QualifiedNameBuilder createPseudoPropertyNameBuilder(
      final QualifiedNameBuilder propertyValueNameBuilder, final String symbolicName) {
    return new QualifiedNameBuilder() {
      @Override public boolean needsParentheses() {
        return false;
      }

      @Override
View Full Code Here

      QualifiedNameBuilder propertyValueNameBuilder, String symbolicName) {
    if (value == null) {
      return null;
    }

    QualifiedNameBuilder qualifiedNameBuilder =
        createPseudoPropertyNameBuilder(propertyValueNameBuilder, symbolicName);

    return wrap(value, qualifiedNameBuilder);
  }
View Full Code Here

TOP

Related Classes of org.chromium.sdk.internal.wip.WipExpressionBuilder.QualifiedNameBuilder

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.