Package javax.ws.rs

Examples of javax.ws.rs.Path


     * @throws IllegalArgumentException
     *             if the method is null.
     */
    public static PathRegExp createForMethod(Method annotatedMethod)
            throws IllegalPathOnMethodException, IllegalArgumentException {
        final Path pathAnno = Util.getPathAnnotationOrNull(annotatedMethod);
        if (pathAnno == null) {
            return EMPTY;
        }
        try {
            return new PathRegExp(pathAnno.value(), pathAnno);
        } catch (IllegalPathException ipe) {
            throw new IllegalPathOnMethodException(ipe);
        }
    }
View Full Code Here


            throws MissingAnnotationException, IllegalArgumentException {
        if (jaxRsClass == null) {
            throw new IllegalArgumentException(
                    "The jaxRsClass must not be null");
        }
        final Path path = jaxRsClass.getAnnotation(Path.class);
        if (path == null) {
            throw new MissingAnnotationException(
                    "The root resource class does not have a @Path annotation");
        }
        return path;
View Full Code Here

            throws IllegalArgumentException, MissingAnnotationException {
        if (method == null) {
            throw new IllegalArgumentException(
                    "The root resource class must not be null");
        }
        final Path path = method.getAnnotation(Path.class);
        if (path == null) {
            throw new MissingAnnotationException("The method "
                    + method.getName() + " does not have an annotation @Path");
        }
        return path;
View Full Code Here

     * @throws MissingAnnotationException
     */
    public static String getPathTemplateWithoutRegExps(Method method)
            throws IllegalArgumentException, IllegalPathOnMethodException,
            MissingAnnotationException {
        final Path path = getPathAnnotation(method);
        try {
            return getPathTemplateWithoutRegExps(path);
        } catch (IllegalPathException e) {
            throw new IllegalPathOnMethodException(e);
        }
View Full Code Here

        for (Method m : cri.getServiceClass().getMethods()) {
           
            Method annotatedMethod = AnnotationUtils.getAnnotatedMethod(m);
           
            String httpMethod = AnnotationUtils.getHttpMethodValue(annotatedMethod);
            Path path = AnnotationUtils.getMethodAnnotation(annotatedMethod, Path.class);
           
            if (httpMethod != null || path != null) {
                md.bind(createOperationInfo(m, annotatedMethod, cri, path, httpMethod), m);
                if (httpMethod == null) {
                    // subresource locator
View Full Code Here

  private SortedSet<MethodDescriptor> getSubThingMethodDescriptors(
      Class<?> clazz) {
    SortedSet<MethodDescriptor> result = new TreeSet<MethodDescriptor>();
    Set<Method> methods = MethodUtil.getAnnotatedMethods(clazz);
    for (Method method : methods) {
      final Path pathAnnotation = method.getAnnotation(Path.class);
      if (pathAnnotation != null) {
        result.add(new MethodDescriptor(method,
            templateUrlEncode(pathAnnotation.value())));
      }
    }
    return result;
  }
View Full Code Here

    component2PathPrefixMap.put(component, bundlePathPrefix);
  }

  protected void registerComponent(Object component, String pathPrefix) {     
    final Class<?> clazz = component.getClass();
    final Path path = clazz.getAnnotation(Path.class);
    if (path == null) {
      // Warn about and ignore classes that do not conform to the
      // requirements of root resource or provider classes.

      if (clazz.getAnnotation(Provider.class) != null) {
        logger.info("Register provider {} to path {}", component.getClass().getName(), pathPrefix);
        componentSpecifiedProviders.addInstance(component, pathPrefix);
      } else {
        logger.warn("Ignoring component: {} (Not a root resource or provider)",
            component);
      }
    } else {
      logger.info("Register resource {} to path {}{}",
          new Object[]{component.getClass().getName(), pathPrefix, path.value()});
      collectHttpMethods(component.getClass());
      final RootResourceDescriptor descriptor = new RootResourceDescriptor(
          clazz, component, pathPrefix + path.value(), providers);
      rootResources.add(descriptor);
      // FIXME An unbind will potentially remove the wrong
      // descriptor from the set. Solution: Use a list or a
      // lookup table.
    }
View Full Code Here

  }

  protected void registerSingleComponentOfApplication(Class<?> clazz,
      Object instance, CascadingProviders applicationProviders,
      String pathPrefix) {
    Path path = clazz.getAnnotation(Path.class);
    if (path != null) {
      RootResourceDescriptor rootResourceDescriptor;
      collectHttpMethods(clazz);
      String completePath = pathPrefix + path.value();
      if (instance == null) {
        rootResourceDescriptor = new RootResourceDescriptor(clazz,
            completePath);
      } else {
        rootResourceDescriptor = new RootResourceDescriptor(clazz,
View Full Code Here

        for (Method m : cri.getServiceClass().getMethods()) {
           
            Method annotatedMethod = AnnotationUtils.getAnnotatedMethod(m);
           
            String httpMethod = AnnotationUtils.getHttpMethodValue(annotatedMethod);
            Path path = AnnotationUtils.getMethodAnnotation(annotatedMethod, Path.class);
           
            if (httpMethod != null || path != null) {
                md.bind(createOperationInfo(m, annotatedMethod, cri, path, httpMethod), m);
                if (httpMethod == null) {
                    // subresource locator
View Full Code Here

        for (Method m : cri.getServiceClass().getMethods()) {
           
            Method annotatedMethod = AnnotationUtils.getAnnotatedMethod(m);
           
            String httpMethod = AnnotationUtils.getHttpMethodValue(annotatedMethod);
            Path path = AnnotationUtils.getMethodAnnotation(annotatedMethod, Path.class);
           
            if (httpMethod != null || path != null) {
                md.bind(createOperationInfo(m, annotatedMethod, cri, path, httpMethod), m);
                if (httpMethod == null) {
                    // subresource locator
View Full Code Here

TOP

Related Classes of javax.ws.rs.Path

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.