Example usage for com.google.gwt.dev.cfg BindingProperty isAllowedValue

List of usage examples for com.google.gwt.dev.cfg BindingProperty isAllowedValue

Introduction

In this page you can find the example usage for com.google.gwt.dev.cfg BindingProperty isAllowedValue.

Prototype

public boolean isAllowedValue(String value) 

Source Link

Document

Returns true if the supplied value is legal under some condition.

Usage

From source file:com.googlecode.gwt.test.internal.handlers.StaticPropertyOracle.java

License:Apache License

/**
 * Create a property oracle that will return the supplied values.
 *
 * @param orderedProps array of binding properties
 * @param orderedPropValues values of the above binding properties
 * @param configProps array of config properties
 *//*from w ww .j  a va 2  s .  co m*/
public StaticPropertyOracle(BindingProperty[] orderedProps, String[] orderedPropValues,
        ConfigurationProperty[] configProps) {
    this.orderedProps = orderedProps;
    this.orderedPropValues = orderedPropValues;
    this.configPropertiesByName = Maps.uniqueIndex(Arrays.asList(configProps), getConfigNameExtractor());
    // Reject illegal values at construction time
    int len = orderedProps.length;
    for (int i = 0; i < len; i++) {
        BindingProperty prop = orderedProps[i];
        String value = orderedPropValues[i];
        if (!prop.isAllowedValue(value)) {
            throw new IllegalArgumentException("Property " + prop.getName() + " cannot have value " + value);
        }
    }
}