All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.spi.touri.MappedByAnnotationResolver Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package org.jboss.resteasy.spi.touri;

import org.jboss.resteasy.specimpl.ResteasyUriBuilder;

import java.lang.annotation.Annotation;

public class MappedByAnnotationResolver extends
        AbstractURITemplateAnnotationResolver
{
   protected Class getAnnotationType()
   {
      return MappedBy.class;
   }

   protected ResteasyUriBuilder getUriBuilder(Class clazz)
   {
      MappedBy mappedBy = clazz.getAnnotation(MappedBy.class);
      ResteasyUriBuilder uriBuilderImpl = new ResteasyUriBuilder();
      Class resourceType = mappedBy.resource();
      uriBuilderImpl.path(resourceType);
      String method = mappedBy.method();
      if (method != null && method.length() > 0)
      {
         uriBuilderImpl.path(resourceType, method);
      }
      return uriBuilderImpl;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy