Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.AnnotationProvider


        return _defaultProvider.defaultTranslator("value", _resources);
    }

    final AnnotationProvider defaultAnnotationProvider()
    {
        return new AnnotationProvider()
        {
            public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
            {
                return _resources.getParameterAnnotation("value", annotationClass);
            }
View Full Code Here


    @SuppressWarnings("unchecked")
    public boolean provideInjection(final String fieldName, Class fieldType, ObjectLocator locator,
                                    final ClassTransformation transformation, MutableComponentModel componentModel)
    {
        AnnotationProvider annotationProvider = new AnnotationProvider()
        {
            public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
            {
                return transformation.getFieldAnnotation(fieldName, annotationClass);
            }
View Full Code Here

    @SuppressWarnings("unchecked")
    private static Object calculateParameterValue(Class parameterType,
            final Annotation[] parameterAnnotations, ObjectLocator locator,
            Map<Class, Object> parameterDefaults)
    {
        AnnotationProvider provider = new AnnotationProvider()
        {
            public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
            {
                return findAnnotation(parameterAnnotations, annotationClass);
            }

        };

        InjectService is = provider.getAnnotation(InjectService.class);

        if (is != null)
        {
            String serviceId = is.value();

            return locator.getService(serviceId, parameterType);
        }

        // In the absence of @InjectService, try some autowiring. First, does the
        // parameter type match on of the resources (the parameter defaults)?

        if (provider.getAnnotation(Inject.class) == null)
        {
            Object result = parameterDefaults.get(parameterType);

            if (result != null) return result;
        }
View Full Code Here

                rootClass.getName(),
                expression);

        Class conduitClass = classFab.createClass();

        AnnotationProvider provider = new AnnotationProvider()
        {

            public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
            {
                T result = readMethod == null ? null : readMethod.getAnnotation(annotationClass);
View Full Code Here

        ObjectProvider masterProvider = getService(
                IOCConstants.MASTER_OBJECT_PROVIDER_SERVICE_ID,
                ObjectProvider.class);

        AnnotationProvider effectiveProvider = annotationProvider != null ? annotationProvider
                : new NullAnnotationProvider();

        return masterProvider.provide(objectType, effectiveProvider, locator);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.AnnotationProvider

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.