Examples of FixedMessage


Examples of org.vraptor.i18n.FixedMessage

                    Object object = paramFor(names, path, paramValues);
                    BasicValidationErrors newErrors = new BasicValidationErrors();
                    HibernateLogicMethod.validateParam(locator, request, bundle, newErrors, object, path);
                    for (org.vraptor.i18n.ValidationMessage msg : newErrors) {
                        if (msg instanceof FixedMessage) {
                            FixedMessage m = (FixedMessage) msg;
                            String content = bundle.getString(m.getKey());
                            errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                        } else if (msg instanceof Message) {
                            Message m = (Message) msg;
                            String content = bundle.getString(m.getKey());
                            content = MessageFormat.format(content, new Object[]{m.getParameters()});
                            errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                        } else {
                            throw new IllegalArgumentException("Unsupported validation message type: " + msg.getClass().getName());
                        }
                    }
                } catch (GettingException e) {
View Full Code Here

Examples of org.vraptor.i18n.FixedMessage

    }
  }

  public void add(Message message) {
    containsErrors = true;
    this.errors.add(new FixedMessage(message.getCategory(), message.getMessage(), message.getCategory()));
  }
View Full Code Here

Examples of org.vraptor.i18n.FixedMessage

                    throw new InterceptionException("Unable to validate.", e);
                } catch (InvocationTargetException e) {
                    throw new InterceptionException("Unable to validate.", e.getCause());
                }
                for (Message msg : convertionErrors) {
                    errors.add(new FixedMessage(msg.getCategory(), msg.getMessage(), msg.getCategory()));
                }
                for (org.vraptor.i18n.ValidationMessage msg : newErrors) {
                    if (msg instanceof FixedMessage) {
                        errors.add(msg);
                    } else if (msg instanceof org.vraptor.i18n.Message) {
                        org.vraptor.i18n.Message m = (org.vraptor.i18n.Message) msg;
                        String content = localization.getMessage(m.getKey(), m.getParameters());
                        errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                    } else {
                        throw new IllegalArgumentException("Unsupported validation message type: " + msg.getClass().getName());
                    }
                }
            }
View Full Code Here

Examples of org.vraptor.i18n.FixedMessage

    }
  }

  public void add(Message message) {
    containsErrors = true;
    this.errors.add(new FixedMessage(message.getCategory(), message.getMessage(), message.getCategory()));
  }
View Full Code Here

Examples of org.vraptor.i18n.FixedMessage

    }
  }

  public void add(Message message) {
    containsErrors = true;
    this.errors.add(new FixedMessage(message.getCategory(), message.getMessage(), message.getCategory()));
  }
View Full Code Here

Examples of org.vraptor.i18n.FixedMessage

    return validationParameters;
  }

  private void addConvertionErrors(List<Message> convertionErrors) {
    for (Message msg : convertionErrors) {
        errors.add(new FixedMessage(msg.getCategory(), msg.getMessage(), msg.getCategory()));
    }
  }
View Full Code Here

Examples of org.vraptor.i18n.FixedMessage

        if (msg instanceof FixedMessage) {
            errors.add(msg);
        } else if (msg instanceof org.vraptor.i18n.Message) {
            org.vraptor.i18n.Message m = (org.vraptor.i18n.Message) msg;
            String content = localization.getMessage(m.getKey(), (Object[]) m.getParameters());
            errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
        } else {
            throw new IllegalArgumentException("Unsupported validation message type: " + msg.getClass().getName());
        }
    }
  }
View Full Code Here

Examples of org.vraptor.i18n.FixedMessage

                    Object object = paramFor(names, path, paramValues);
                    BasicValidationErrors newErrors = new BasicValidationErrors();
                    HibernateLogicMethod.validateParam(locator, request, bundle, newErrors, object, path);
                    for (org.vraptor.i18n.ValidationMessage msg : newErrors) {
                        if (msg instanceof FixedMessage) {
                            FixedMessage m = (FixedMessage) msg;
                            String content = bundle.getString(m.getKey());
                            errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                        } else if (msg instanceof Message) {
                            Message m = (Message) msg;
                            String content = bundle.getString(m.getKey());
                            content = MessageFormat.format(content, new Object[]{m.getParameters()});
                            errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                        } else {
                            throw new IllegalArgumentException("Unsupported validation message type: " + msg.getClass().getName());
                        }
                    }
                } catch (GettingException e) {
View Full Code Here

Examples of org.vraptor.i18n.FixedMessage

                    throw new InterceptionException("Unable to validate.", e);
                } catch (InvocationTargetException e) {
                    throw new InterceptionException("Unable to validate.", e.getCause());
                }
                for (Message msg : convertionErrors) {
                    errors.add(new FixedMessage(msg.getCategory(), msg.getMessage(), msg.getCategory()));
                }
                for (org.vraptor.i18n.ValidationMessage msg : newErrors) {
                    if (msg instanceof FixedMessage) {
                        errors.add(msg);
                    } else if (msg instanceof org.vraptor.i18n.Message) {
                        org.vraptor.i18n.Message m = (org.vraptor.i18n.Message) msg;
                        String content = localization.getMessage(m.getKey(), m.getParameters());
                        errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                    } else {
                        throw new IllegalArgumentException("Unsupported validation message type: " + msg.getClass().getName());
                    }
                }
            }
View Full Code Here

Examples of org.vraptor.i18n.FixedMessage

                    Object object = paramFor(names, path, paramValues);
                    BasicValidationErrors newErrors = new BasicValidationErrors();
                    HibernateLogicMethod.validateParam(locator, request, bundle, newErrors, object, path);
                    for (org.vraptor.i18n.ValidationMessage msg : newErrors) {
                        if (msg instanceof FixedMessage) {
                            FixedMessage m = (FixedMessage) msg;
                            String content = bundle.getString(m.getKey());
                            errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                        } else if (msg instanceof Message) {
                            Message m = (Message) msg;
                            String content = bundle.getString(m.getKey());
                            content = MessageFormat.format(content, new Object[]{m.getParameters()});
                            errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                        } else {
                            throw new IllegalArgumentException("Unsupported validation message type: " + msg.getClass().getName());
                        }
                    }
                } catch (GettingException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.