Package com.google.web.bindery.requestfactory.shared.messages

Examples of com.google.web.bindery.requestfactory.shared.messages.ViolationMessage


      if (domainObject != null) {
        Set<ConstraintViolation<Object>> errors = service.validate(domainObject);
        if (errors != null && !errors.isEmpty()) {
          SimpleProxyId<?> id = entry.getKey();
          for (ConstraintViolation<Object> error : errors) {
            ViolationMessage message = FACTORY.violation().as();
            message.setClientId(id.getClientId());
            message.setMessage(error.getMessage());
            message.setPath(error.getPropertyPath().toString());
            if (id.isEphemeral()) {
              message.setClientId(id.getClientId());
              message.setStrength(Strength.EPHEMERAL);
            } else {
              message.setServerId(toBase64(id.getServerId()));
            }
            message.setTypeToken(service.resolveTypeToken(id.getProxyClass()));
            errorMessages.add(message);
          }
        }
      }
    }
View Full Code Here


                  leafId.setServerId(toBase64(stableId.getServerId()));
                }
              }
            }

            ViolationMessage message = FACTORY.violation().as();
            message.setLeafBeanId(leafId);
            message.setMessage(error.getMessage());
            message.setMessageTemplate(error.getMessageTemplate());
            message.setPath(error.getPropertyPath().toString());
            message.setRootBeanId(rootId);
            errorMessages.add(message);
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.google.web.bindery.requestfactory.shared.messages.ViolationMessage

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.