Package javax.annotation

Examples of javax.annotation.Resource.type()


            throw new DeploymentUnitProcessingException("Failed to get method '" + methodName + "' from class '" + owningClass + "'", e);
        }
        final Resource resource = method.getAnnotation(Resource.class);
        if (resource != null) {
            final String contextNameSuffix = methodName.substring(3, 4).toLowerCase() + methodName.substring(4);
            final Class<?> injectionType = resource.type().equals(Object.class) ? method.getReturnType() : resource.type();
            final String localContextName = resource.name().isEmpty() ? contextNameSuffix : resource.name();
            return new ResourceConfiguration(methodName, method, ResourceConfiguration.TargetType.METHOD, injectionType, localContextName, getTargetContextName(resource, contextNameSuffix, injectionType));
        }
        return null;
    }
View Full Code Here


            throw new DeploymentUnitProcessingException("Failed to get method '" + methodName + "' from class '" + owningClass + "'", e);
        }
        final Resource resource = method.getAnnotation(Resource.class);
        if (resource != null) {
            final String contextNameSuffix = methodName.substring(3, 4).toLowerCase() + methodName.substring(4);
            final Class<?> injectionType = resource.type().equals(Object.class) ? method.getReturnType() : resource.type();
            final String localContextName = resource.name().isEmpty() ? contextNameSuffix : resource.name();
            return new ResourceConfiguration(methodName, method, ResourceConfiguration.TargetType.METHOD, injectionType, localContextName, getTargetContextName(resource, contextNameSuffix, injectionType));
        }
        return null;
    }
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.