Package org.springmodules.xt.model.specifications.support

Examples of org.springmodules.xt.model.specifications.support.SpecificationNotComposedException


     * Apply the logical <code>and</code> operator to this composite specification and the supplied one.
     * @param specification The supplied specification to compose.
     */
    public CompositeSpecification and(S specification) {
        if (this.specificationsList.isEmpty()) {
            throw new SpecificationNotComposedException("You have to compose your specification first.");
        }
        this.operatorsList.add(this.operatorFactory.getAndOperator());
        this.specificationsList.add(this.adaptSpecification(specification));
        return this;
    }
View Full Code Here


     * Apply the logical <code>or</code> operator to this composite specification and the supplied one.
     * @param specification The supplied specification to compose.
     */
    public CompositeSpecification or(S specification) {
        if (this.specificationsList.isEmpty()) {
            throw new SpecificationNotComposedException("You have to compose your specification first.");
        }
        this.operatorsList.add(this.operatorFactory.getOrOperator());
        this.specificationsList.add(this.adaptSpecification(specification));
        return this;
    }
View Full Code Here

    public CompositeSpecification and(CompositeSpecification<S, O> specification) {
        if (!specification.equals(this)) {
            throw new IllegalArgumentException("You cannot compose specifications with different descriptions.");
        }
        if (this.specificationsList.isEmpty()) {
            throw new SpecificationNotComposedException("You have to compose your specification first.");
        }
        this.operatorsList.add(this.operatorFactory.getAndOperator());
        this.specificationsList.add(specification);
        return this;
    }
View Full Code Here

    public CompositeSpecification or(CompositeSpecification<S, O> specification) {
        if (!specification.equals(this)) {
            throw new IllegalArgumentException("You cannot compose specifications with different descriptions.");
        }
        if (this.specificationsList.isEmpty()) {
            throw new SpecificationNotComposedException("You have to compose your specification first.");
        }
        this.operatorsList.add(this.operatorFactory.getOrOperator());
        this.specificationsList.add(specification);
        return this;
    }
View Full Code Here

     * Apply the logical, negated, <code>and</code> operator to this composite specification and the supplied one.
     * @param specification The supplied specification to compose.
     */
    public CompositeSpecification andNot(S specification) {
        if (this.specificationsList.isEmpty()) {
            throw new SpecificationNotComposedException("You have to compose your specification first.");
        }
        this.operatorsList.add(this.operatorFactory.getAndOperator());
        this.specificationsList.add(new InverseSpecification(this.adaptSpecification(specification)));
        return this;
    }
View Full Code Here

     * Apply the logical, negated, <code>or</code> operator to this composite specification and the supplied one.
     * @param specification The actual specification to compose.
     */
    public CompositeSpecification orNot(S specification) {
        if (this.specificationsList.isEmpty()) {
            throw new SpecificationNotComposedException("You have to compose your specification first.");
        }
        this.operatorsList.add(this.operatorFactory.getOrOperator());
        this.specificationsList.add(new InverseSpecification(this.adaptSpecification(specification)));
        return this;
    }
View Full Code Here

    public CompositeSpecification andNot(CompositeSpecification<S, O> specification) {
        if (!specification.equals(this)) {
            throw new IllegalArgumentException("You cannot compose specifications with different descriptions.");
        }
        if (this.specificationsList.isEmpty()) {
            throw new SpecificationNotComposedException("You have to compose your specification first.");
        }
        this.operatorsList.add(this.operatorFactory.getAndOperator());
        this.specificationsList.add(new InverseSpecification(specification));
        return this;
    }
View Full Code Here

    public CompositeSpecification orNot(CompositeSpecification<S, O> specification) {
        if (!specification.equals(this)) {
            throw new IllegalArgumentException("You cannot compose specifications with different descriptions.");
        }
        if (this.specificationsList.isEmpty()) {
            throw new SpecificationNotComposedException("You have to compose your specification first.");
        }
        this.operatorsList.add(this.operatorFactory.getOrOperator());
        this.specificationsList.add(new InverseSpecification(specification));
        return this;
    }
View Full Code Here

                              .toHashCode();
    }
   
    protected boolean internalEvaluate(O object, Notification notification) {
        if (this.specificationsList.isEmpty()) {
            throw new SpecificationNotComposedException("You have to compose your specification first.");
        }
        Iterator<Specification> specificationsIt = this.specificationsList.iterator();
        boolean result = specificationsIt.next().evaluate(object, notification);
        for (BinaryOperator op : operatorsList) {
            result = op.evaluate(specificationsIt.next(), result, object, notification);
View Full Code Here

TOP

Related Classes of org.springmodules.xt.model.specifications.support.SpecificationNotComposedException

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.