Example usage for com.google.gwt.core.ext PropertyOracle getPropertyValue

List of usage examples for com.google.gwt.core.ext PropertyOracle getPropertyValue

Introduction

In this page you can find the example usage for com.google.gwt.core.ext PropertyOracle getPropertyValue.

Prototype

@Deprecated
String getPropertyValue(TreeLogger logger, String propertyName) throws BadPropertyValueException;

Source Link

Document

Attempts to get a named deferred binding property or configuration property.

Usage

From source file:com.totsp.gwt.freezedry.rebind.SerializableTypeOracleBuilder.java

License:Apache License

private void initializeProperties(TreeLogger logger, PropertyOracle propertyOracle) {
    // Assume subtype warnings unless user explicitly turns it off.
    allowUnserializableSubtypesOfAutoSerializableTypes = false;

    try {/*www . jav  a2  s.  c o m*/
        String propVal = propertyOracle.getPropertyValue(logger,
                "gwt.allowUnserializableSubtypesOfAutoSerializableTypes");
        if (propVal.equals("true")) {
            allowUnserializableSubtypesOfAutoSerializableTypes = true;
        }
    } catch (BadPropertyValueException e) {
        // Purposely ignored, because we do not want to allow subtypes that are
        // not serializable by default.
    }

    suppressNonStaticFinalFieldWarnings = false;
    try {
        String propVal = propertyOracle.getPropertyValue(logger, "gwt.suppressNonStaticFinalFieldWarnings");
        if (propVal.equals("true")) {
            suppressNonStaticFinalFieldWarnings = true;
        }
    } catch (BadPropertyValueException e) {
        // Purposely ignored, because we do want to warn if non-static, final
        // are part of a serializable type
    }
}

From source file:com.totsp.gwt.freezedry.rebind.Shared.java

License:Apache License

/**
 * Returns <code>true</code> if the generated code should enforce type
 * versioning./*w w w.j  a va2 s.c o m*/
 */
static boolean shouldEnforceTypeVersioning(TreeLogger logger, PropertyOracle propertyOracle) {
    try {
        String propVal = propertyOracle.getPropertyValue(logger, RPC_PROP_ENFORCE_TYPE_VERSIONING);
        if (propVal.equals("false")) {
            return false;
        }
    } catch (BadPropertyValueException e) {
        // Purposely ignored, because we want to enforce RPC versioning if
        // the property is not defined.
    }
    // Assume type versioning unless the user explicitly turns it off.
    return true;
}