Package javax.annotation

Examples of javax.annotation.Resource.type()


   
    public static void addWebServiceContextInjections(Holder holder, ClassFinder finder) {       
        List<Field> fields = finder.findAnnotatedFields(Resource.class);
        for (Field field : fields) {
            Resource resource = (Resource) field.getAnnotation(Resource.class);
            Class type = getInjectionType(resource.type(), null, field);
            if (WebServiceContext.class == type) {
                holder.addInjection(field.getDeclaringClass().getName(),
                                    new Injection(field.getDeclaringClass().getName(), getInjectionName(null, field), ABSOLUTE_JNDI_NAME));
            }
        }
View Full Code Here


            }
        }
        List<Method> methods = finder.findAnnotatedMethods(Resource.class);
        for (Method method : methods) {
            Resource resource = (Resource) method.getAnnotation(Resource.class);
            Class type = getInjectionType(resource.type(), method, null);
            if (WebServiceContext.class == type) {
                holder.addInjection(method.getDeclaringClass().getName(),
                                    new Injection(method.getDeclaringClass().getName(), getInjectionName(method, null), ABSOLUTE_JNDI_NAME));
            }           
        }
View Full Code Here

            if (resource != null)
            {
               String name = resource.name();
               String mappedName = resource.mappedName();
               Resource.AuthenticationType auth = resource.authenticationType();
               Class type = resource.type();
               boolean shareable = resource.shareable();
              
               if (name==null || name.trim().equals(""))
                   throw new IllegalStateException ("Class level Resource annotations must contain a name (Common Annotations Spec Section 2.3)");
              
View Full Code Here

                //get other parts that can be specified in @Resource
                Resource.AuthenticationType auth = resource.authenticationType();
                boolean shareable = resource.shareable();

                //if @Resource specifies a type, check it is compatible with setter param
                if ((resource.type() != null)
                        &&
                        !resource.type().equals(Object.class)
                        &&
                        (!IntrospectionUtil.isTypeCompatible(type, resource.type(), false)))
                    throw new IllegalStateException("@Resource incompatible type="+resource.type()+ " with method param="+type+ " for "+m);
View Full Code Here

                boolean shareable = resource.shareable();

                //if @Resource specifies a type, check it is compatible with setter param
                if ((resource.type() != null)
                        &&
                        !resource.type().equals(Object.class)
                        &&
                        (!IntrospectionUtil.isTypeCompatible(type, resource.type(), false)))
                    throw new IllegalStateException("@Resource incompatible type="+resource.type()+ " with method param="+type+ " for "+m);
              
                //check if an injection has already been setup for this target by web.xml
View Full Code Here

                //if @Resource specifies a type, check it is compatible with setter param
                if ((resource.type() != null)
                        &&
                        !resource.type().equals(Object.class)
                        &&
                        (!IntrospectionUtil.isTypeCompatible(type, resource.type(), false)))
                    throw new IllegalStateException("@Resource incompatible type="+resource.type()+ " with method param="+type+ " for "+m);
              
                //check if an injection has already been setup for this target by web.xml
                Injection webXmlInjection = webXmlInjections.getInjection(getTargetClass(), m);
               
View Full Code Here

                if ((resource.type() != null)
                        &&
                        !resource.type().equals(Object.class)
                        &&
                        (!IntrospectionUtil.isTypeCompatible(type, resource.type(), false)))
                    throw new IllegalStateException("@Resource incompatible type="+resource.type()+ " with method param="+type+ " for "+m);
              
                //check if an injection has already been setup for this target by web.xml
                Injection webXmlInjection = webXmlInjections.getInjection(getTargetClass(), m);
               
                if (webXmlInjection == null)
View Full Code Here

                //get the type of the Field
                Class type = f.getType();
                //if @Resource specifies a type, check it is compatible with field type
                if ((resource.type() != null)
                        &&
                        !resource.type().equals(Object.class)
                        &&
                        (!IntrospectionUtil.isTypeCompatible(type, resource.type(), false)))
                    throw new IllegalStateException("@Resource incompatible type="+resource.type()+ " with field type ="+f.getType());
               
                //get the mappedName if there is one
View Full Code Here

                //if @Resource specifies a type, check it is compatible with field type
                if ((resource.type() != null)
                        &&
                        !resource.type().equals(Object.class)
                        &&
                        (!IntrospectionUtil.isTypeCompatible(type, resource.type(), false)))
                    throw new IllegalStateException("@Resource incompatible type="+resource.type()+ " with field type ="+f.getType());
               
                //get the mappedName if there is one
                String mappedName = (resource.mappedName()!=null && !resource.mappedName().trim().equals("")?resource.mappedName():null);
                //get other parts that can be specified in @Resource
View Full Code Here

        do {
            try {
                Field field = clazz.getDeclaredField(fieldName);
                Resource resource = field.getAnnotation(Resource.class);
                if (resource != null && resource.type()!=Object.class) {
                    type = chooseType(fieldName, field.getType(), resource.type());
                } else {
                    type = field.getType();
                }
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.