Examples of adaptables()


Examples of org.apache.sling.models.annotations.Model.adaptables()

                                for (Class<?> adapterType : adapterTypes) {
                                    if (adapterType != implType) {
                                        adapterImplementations.add(adapterType, implType);
                                    }
                                }
                                ServiceRegistration reg = registerAdapterFactory(adapterTypes, annotation.adaptables(), implType, annotation.condition());
                                regs.add(reg);
                            }
                        }
                    } catch (ClassNotFoundException e) {
                        log.warn("Unable to load class", e);
View Full Code Here

Examples of org.apache.sling.models.annotations.Model.adaptables()

        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)) {
                return true;
            }
        }
View Full Code Here

Examples of org.apache.sling.models.annotations.Model.adaptables()

                result.addFailure(FailureType.NO_MODEL_ANNOTATION, type);
                return result;
            }
            boolean isAdaptable = false;

            Class<?>[] declaredAdaptable = modelAnnotation.adaptables();
            for (Class<?> clazz : declaredAdaptable) {
                if (clazz.isInstance(adaptable)) {
                    isAdaptable = true;
                }
            }
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.