Package org.apache.sling.models.factory

Examples of org.apache.sling.models.factory.InvalidModelException


                    e = new InvalidAdaptableException(msg);
                    break;
                case FAILED_CALLING_POST_CONSTRUCT:
                case NO_MODEL_ANNOTATION:
                case NO_USABLE_CONSTRUCTOR:
                    e = new InvalidModelException(msg);
                    break;
                case MISSING_CONSTRUCTOR_PARAMS:
                case MISSING_FIELDS:
                case MISSING_METHODS:
                    e = new MissingElementsException(failureType.message, missingElements, clazz);
View Full Code Here


    private boolean innerCanCreateFromAdaptable(Object adaptable, Class<?> modelClass) throws InvalidModelException {
        modelClass = getImplementationTypeForAdapterType(modelClass, adaptable);
        Model modelAnnotation = modelClass.getAnnotation(Model.class);
        if (modelAnnotation == null) {
            throw new InvalidModelException(String.format("Model class '%s' does not have a model annotation", modelClass));
        }

        Class<?>[] declaredAdaptable = modelAnnotation.adaptables();
        for (Class<?> clazz : declaredAdaptable) {
            if (clazz.isInstance(adaptable)) {
View Full Code Here

TOP

Related Classes of org.apache.sling.models.factory.InvalidModelException

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.