Package org.jboss.resteasy.spi.touri

Source Code of org.jboss.resteasy.spi.touri.MappedByAnnotationResolver

package org.jboss.resteasy.spi.touri;

import org.jboss.resteasy.specimpl.UriBuilderImpl;

import java.lang.annotation.Annotation;

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

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

Related Classes of org.jboss.resteasy.spi.touri.MappedByAnnotationResolver

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.