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

org.jboss.resteasy.spi.metadata.SetterParameter Maven / Gradle / Ivy

The newest version!
package org.jboss.resteasy.spi.metadata;

import java.beans.Introspector;
import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
import java.lang.reflect.Type;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class SetterParameter extends Parameter
{
   protected Method setter;
   protected Method annotatedMethod;

   protected SetterParameter(ResourceClass declaredClass, Method setter, Method annotatedMethod)
   {
      super(declaredClass, setter.getParameterTypes()[0], setter.getGenericParameterTypes()[0]);
      this.setter = setter;
      this.annotatedMethod = annotatedMethod;
      this.paramName = Introspector.decapitalize(setter.getName().substring(3));
   }

   public Method getSetter()
   {
      return setter;
   }

   public Method getAnnotatedMethod()
   {
      return annotatedMethod;
   }

   @Override
   public AccessibleObject getAccessibleObject()
   {
      return setter;
   }

   @Override
   public Annotation[] getAnnotations()
   {
      return annotatedMethod.getAnnotations();
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy