Package javax.annotation

Examples of javax.annotation.Resource.type()


        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();
                }

            } catch (NoSuchFieldException e) {
View Full Code Here


                    if (methodName.startsWith("set")) {
                        String setName = Introspector.decapitalize(methodName.substring(3));
                        if (fieldName.equals(setName)) {
                            Resource resource = method.getAnnotation(Resource.class);
                            if (resource != null && resource.type()!=Object.class) {
                                type = chooseType(fieldName, method.getParameterTypes()[0], resource.type());
                            } else {
                                type = method.getParameterTypes()[0];
                            }
                        }
                    }
View Full Code Here

    public static void addWebServiceContextInjections(Holder holder, ClassFinder finder) {
        List<Field> fields = finder.findAnnotatedFields(Resource.class);
        for (Field field : fields) {
            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), BINDING_WEBSERVICE_CONTEXR_JNDI_NAME, ReferenceType.RESOURCE_ENV));
            }
        }
View Full Code Here

            }
        }
        List<Method> methods = finder.findAnnotatedMethods(Resource.class);
        for (Method method : methods) {
            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), BINDING_WEBSERVICE_CONTEXR_JNDI_NAME, ReferenceType.RESOURCE_ENV));
            }
        }
View Full Code Here

    }

    protected void initAnnotation(AnnotatedElement ae) {
      Resource resource = ae.getAnnotation(Resource.class);
      String resourceName = resource.name();
      Class resourceType = resource.type();
      this.isDefaultName = !StringUtils.hasLength(resourceName);
      if (this.isDefaultName) {
        resourceName = this.member.getName();
        if (this.member instanceof Method && resourceName.startsWith("set") && resourceName.length() > 3) {
          resourceName = Introspector.decapitalize(resourceName.substring(3));
View Full Code Here

    @Override
    protected void initAnnotation(AnnotatedElement ae) {
      Resource resource = ae.getAnnotation(Resource.class);
      String resourceName = resource.name();
      Class<?> resourceType = resource.type();
      this.isDefaultName = !StringUtils.hasLength(resourceName);
      if (this.isDefaultName) {
        resourceName = this.member.getName();
        if (this.member instanceof Method && resourceName.startsWith("set") && resourceName.length() > 3) {
          resourceName = Introspector.decapitalize(resourceName.substring(3));
View Full Code Here

    @Override
    protected void initAnnotation(AnnotatedElement ae) {
      Resource resource = ae.getAnnotation(Resource.class);
      String resourceName = resource.name();
      Class<?> resourceType = resource.type();
      this.isDefaultName = !StringUtils.hasLength(resourceName);
      if (this.isDefaultName) {
        resourceName = this.member.getName();
        if (this.member instanceof Method && resourceName.startsWith("set") && resourceName.length() > 3) {
          resourceName = Introspector.decapitalize(resourceName.substring(3));
View Full Code Here

    }

    protected void initAnnotation(AnnotatedElement ae) {
      Resource resource = ae.getAnnotation(Resource.class);
      String resourceName = resource.name();
      Class resourceType = resource.type();
      this.isDefaultName = !StringUtils.hasLength(resourceName);
      if (this.isDefaultName) {
        resourceName = this.member.getName();
        if (this.member instanceof Method && resourceName.startsWith("set") && resourceName.length() > 3) {
          resourceName = Introspector.decapitalize(resourceName.substring(3));
View Full Code Here

            Annotation[] annotations = field.getAnnotations();
            for (Annotation an : annotations) {
                if (Resource.class.isAssignableFrom(an.getClass())) {
                    //check to make sure it is a @Resource for WebServiceContext.
                    Resource atResource = (Resource)an;
                    Class type = atResource.type();
                    if (isWebServiceContextResource(atResource, field)) {
                        return field;
                    }
                }
            }
View Full Code Here

            Annotation[] annotations = field.getAnnotations();
            for (Annotation an : annotations) {
                if (Resource.class.isAssignableFrom(an.getClass())) {
                    //check to make sure it is a @Resource for WebServiceContext.
                    Resource atResource = (Resource)an;
                    Class type = atResource.type();
                    if (isWebServiceContextResource(atResource, field)) {
                        return field;
                    }
                }
            }
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.