Package org.waveprotocol.wave.model.experimental.schema.AttributeValidationResult

Examples of org.waveprotocol.wave.model.experimental.schema.AttributeValidationResult.AttributeNotAllowed


  /**
   * Checks that the validation result is ATTRIBUTE_NOT_ALLOWED.
   */
  private static void checkValidation_ANA(AttributeValidationResult result, String name) {
    assertEquals(Type.ATTRIBUTE_NOT_ALLOWED, result.getType());
    AttributeNotAllowed ana = result.asAttributeNotAllowed();
    assertEquals(name, ana.getName());
  }
View Full Code Here


    }
    for (Map.Entry<String, String> attribute : attributes.entrySet()) {
      String name = attribute.getKey();
      ValueValidator validator = valueValidators.get(name);
      if (validator == null) {
        return new AttributeNotAllowed(name);
      }
      String value = attribute.getValue();
      if (!validator.validate(value)) {
        return new InvalidAttributeValue(name, value);
      }
View Full Code Here

  AttributeValidationResult validate(AttributesUpdate update) {
    for (int i = 0; i < update.changeSize(); ++i) {
      String name = update.getChangeKey(i);
      ValueValidator validator = valueValidators.get(name);
      if (validator == null) {
        return new AttributeNotAllowed(name);
      }
      String value = update.getNewValue(i);
      if (value == null) {
        if (requiredAttributes.contains(name)) {
          return new RemovingRequiredAttribute(name);
View Full Code Here

    }
    for (Map.Entry<String, String> attribute : attributes.entrySet()) {
      String name = attribute.getKey();
      ValueValidator validator = valueValidators.get(name);
      if (validator == null) {
        return new AttributeNotAllowed(name);
      }
      String value = attribute.getValue();
      if (!validator.validate(value)) {
        return new InvalidAttributeValue(name, value);
      }
View Full Code Here

  AttributeValidationResult validate(AttributesUpdate update) {
    for (int i = 0; i < update.changeSize(); ++i) {
      String name = update.getChangeKey(i);
      ValueValidator validator = valueValidators.get(name);
      if (validator == null) {
        return new AttributeNotAllowed(name);
      }
      String value = update.getNewValue(i);
      if (value == null) {
        if (requiredAttributes.contains(name)) {
          return new RemovingRequiredAttribute(name);
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.experimental.schema.AttributeValidationResult.AttributeNotAllowed

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.