Package org.apache.isis.core.metamodel.spec

Examples of org.apache.isis.core.metamodel.spec.DomainModelException


            // if no options, or not the right number of pojos, then default
            if (parameterChoicesPojos == null) {
                parameterChoicesPojos = new Object[parameterCount][];
            } else if (parameterChoicesPojos.length != parameterCount) {
                throw new DomainModelException("Choices array of incompatible size; expected " + parameterCount + " elements, but was " + parameterChoicesPojos.length + " for " + facet);
            }
        } else {
            // use the new choicesNXxx approach for each param in turn
            // (the reflector will have made sure both aren't installed).
View Full Code Here


           
            final ObjectSpecification choiceWrappedSpec = specificationLookup.loadSpecification(choiceWrappedClass);
            final ObjectSpecification paramWrappedSpec = specificationLookup.loadSpecification(paramWrappedClass);
           
            if (!choiceWrappedSpec.isOfType(paramWrappedSpec)) {
                throw new DomainModelException("Type incompatible with parameter type; expected " + paramSpec.getFullIdentifier() + ", but was " + choiceClass.getName());
            }
        }
    }
View Full Code Here

        final CallbackFacet facet = (CallbackFacet) object.getSpecification().getFacet(cls);
        if (facet != null) {
            try {
                facet.invoke(object);
            } catch (RuntimeException e) {
                throw new DomainModelException("Callback failed.  Calling " + facet + " on " + object, e);
            }
        }
    }
View Full Code Here

    protected static void checkChoicesType(final SpecificationLookup specificationLookup, final Object[] objects,
        final ObjectSpecification paramSpec) {
        for (final Object object : objects) {
            final ObjectSpecification componentSpec = specificationLookup.loadSpecification(object.getClass());
            if (!componentSpec.isOfType(paramSpec)) {
                throw new DomainModelException("Choice type incompatible with parameter type; expected "
                    + paramSpec.getFullIdentifier() + ", but was " + componentSpec.getFullIdentifier());
            }
        }
    }
View Full Code Here

        final ActionDefaultsFacet facet = getFacet(ActionDefaultsFacet.class);
        if (!facet.isNoop()) {
            // use the old defaultXxx approach
            parameterDefaultPojos = facet.getDefaults(realTarget);
            if (parameterDefaultPojos.length != parameterCount) {
                throw new DomainModelException("Defaults array of incompatible size; expected " + parameterCount
                    + " elements, but was " + parameterDefaultPojos.length + " for " + facet);
            }
            for (int i = 0; i < parameterCount; i++) {
                if (parameterDefaultPojos[i] != null) {
                    final ObjectSpecification componentSpec =
                        getSpecificationLookup().loadSpecification(parameterDefaultPojos[i].getClass());
                    final ObjectSpecification parameterSpec = parameters.get(i).getSpecification();
                    if (!componentSpec.isOfType(parameterSpec)) {
                        throw new DomainModelException("Defaults type incompatible with parameter " + (i + 1)
                            + " type; expected " + parameterSpec.getFullIdentifier() + ", but was "
                            + componentSpec.getFullIdentifier());
                    }
                }
            }
View Full Code Here

            // if no options, or not the right number of pojos, then default
            if (parameterChoicesPojos == null) {
                parameterChoicesPojos = new Object[parameterCount][];
            } else if (parameterChoicesPojos.length != parameterCount) {
                throw new DomainModelException("Choices array of incompatible size; expected " + parameterCount
                    + " elements, but was " + parameterChoicesPojos.length + " for " + facet);
            }
        } else {
            // use the new choicesNXxx approach for each param in turn
            // (the reflector will have made sure both aren't installed).
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.spec.DomainModelException

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.