Examples of ValidationException


Examples of org.agoncal.application.petstore.exception.ValidationException

    public Order createOrder(final Customer customer, final CreditCard creditCard, final List<CartItem> cartItems) {

        // OMake sure the object is valid
        if (cartItems == null || cartItems.size() == 0)
            throw new ValidationException("Shopping cart is empty"); // TODO exception bean validation

        // Creating the order
        Order order = new Order(em.merge(customer), creditCard, customer.getHomeAddress());

        // From the shopping cart we create the order lines
View Full Code Here

Examples of org.apache.camel.ValidationException

*/
public class MyValidator implements Processor {
    public void process(Exchange exchange) throws Exception {
        Object value = exchange.getIn().getHeader("foo");
        if (value == null || !value.equals("bar")) {
            throw new ValidationException(exchange, "The foo header does not equal bar! Was: " + value);
        }
    }
View Full Code Here

Examples of org.apache.cayenne.validation.ValidationException

                }
            }
        }

        if (result.hasFailures()) {
            throw new ValidationException(result);
        }

        return noop;
    }
View Full Code Here

Examples of org.apache.falcon.entity.parser.ValidationException

                newProp = PropertyUtils.getProperty(newEntity, prop);
            } catch (Exception e) {
                throw new FalconException(e);
            }
            if (!ObjectUtils.equals(oldProp, newProp)) {
                throw new ValidationException(oldEntity.toShortString() + ": " + prop + " can't be changed");
            }
        }
    }
View Full Code Here

Examples of org.apache.fop.fo.ValidationException

        //if (!AFPElementMapping.NAMESPACE.equals(parent.getNamespaceURI())
        //    || !AFPElementMapping.PAGE.equals(parent.getLocalName())) {
        //    throw new ValidationException(getName() + " must be a child of afp:page.");
        //}
        if (parent.getNameId() != Constants.FO_SIMPLE_PAGE_MASTER) {
            throw new ValidationException(getName() + " must be a child of fo:simple-page-master.");
        }
    }
View Full Code Here

Examples of org.apache.ivory.entity.parser.ValidationException

                newProp = PropertyUtils.getProperty(newEntity, prop);
            } catch (Exception e) {
                throw new IvoryException(e);
            }
            if (!ObjectUtils.equals(oldProp, newProp))
                throw new ValidationException(oldEntity.toShortString() + ": " + prop + " can't be changed");
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.util.ValidationException

        {
            //int lastComma = invalidFieldMessages.lastIndexOf(", ");
            int lastComma = new String(invalidFieldMessages).lastIndexOf(", ");
            String result = invalidFieldMessages.substring(0,lastComma);
            // System.err.println("Had a validation problem and am throwing: "+invalidFieldMessages);
            throw new ValidationException(result);
        }
    }
View Full Code Here

Examples of org.apache.openjpa.validation.ValidationException

            return null;
        Set<ConstraintViolation<T>> violations = AccessController.doPrivileged(
                J2DoPrivHelper.validateAction(_validator, arg0, getValidationGroup(event)));

        if (violations != null && violations.size() > 0) {
            return new ValidationException(
                new ConstraintViolationException(
                    // A validation constraint failure occurred for class "{0}".
                    _loc.get("validate-failed",
                        arg0.getClass().getName()).getMessage(),
                    (Set)violations),
View Full Code Here

Examples of org.apache.padaf.preflight.ValidationException

//      System.out.println("DECODED EEXEC : ");
//      System.out.println(new String(decryptedEexec));

      parseDecodedEexec(decryptedEexec);
    } catch (IOException e) {
      throw new ValidationException("Unable to compute the eexec portion : "
          + e.getMessage(), e);
    }
  }
View Full Code Here

Examples of org.apache.pdfbox.preflight.exception.ValidationException

            if (e instanceof ValidationException)
            {
                throw (ValidationException) e;
            }
            // TODO IOException probably due to Encrypt
            throw new ValidationException("Unable to access Annotation", 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.