Package org.jboss.wsf.common.injection

Examples of org.jboss.wsf.common.injection.InjectionException


   {
      for (Class<?> type : method.getParameterTypes())
      {
         if (type.isPrimitive())
         {
            throw new InjectionException("Method " + getAnnotationMessage(annotation) + "can't declare primitive parameters: " + method);
         }
      }
   }
View Full Code Here


    */
   public static void assertNotPrimitiveType(final Field field, Class<? extends Annotation> annotation)
   {
      if (field.getType().isPrimitive())
      {
         throw new InjectionException("Field " + getAnnotationMessage(annotation) + "can't be of primitive type: " + field);
      }
   }
View Full Code Here

    */
   public static void assertNoParameters(final Method method, Class<? extends Annotation> annotation)
   {
      if (method.getParameterTypes().length != 0)
      {
         throw new InjectionException("Method " + getAnnotationMessage(annotation) + "have to have no parameters: " + method);
      }
   }
View Full Code Here

    */
   public static void assertVoidReturnType(final Method method, Class<? extends Annotation> annotation)
   {
      if ((!method.getReturnType().equals(Void.class)) && (!method.getReturnType().equals(Void.TYPE)))
      {
         throw new InjectionException("Method " + getAnnotationMessage(annotation) + "have to return void: " + method);
      }
   }
View Full Code Here

    */
   public static void assertNotVoidType(final Field field, Class<? extends Annotation> annotation)
   {
      if ((field.getClass().equals(Void.class)) && (field.getClass().equals(Void.TYPE)))
      {
         throw new InjectionException("Field " + getAnnotationMessage(annotation) + "cannot be of void type: " + field);
      }
   }
View Full Code Here

      for (int i = 0; i < declaredExceptions.length; i++)
      {
         Class<?> exception = declaredExceptions[i];
         if (!exception.isAssignableFrom(RuntimeException.class))
         {
            throw new InjectionException("Method " + getAnnotationMessage(annotation) + "cannot throw checked exceptions: " + method);
         }
      }
   }
View Full Code Here

    */
   public static void assertNotStatic(final Method method, Class<? extends Annotation> annotation)
   {
      if (Modifier.isStatic(method.getModifiers()))
      {
         throw new InjectionException("Method " + getAnnotationMessage(annotation) + "cannot be static: " + method);
      }
   }
View Full Code Here

    */
   public static void assertNotStatic(final Field field, Class<? extends Annotation> annotation)
   {
      if (Modifier.isStatic(field.getModifiers()))
      {
         throw new InjectionException("Field " + getAnnotationMessage(annotation) + "cannot be static: " + field);
      }
   }
View Full Code Here

    */
   public static void assertNotFinal(final Field field, Class<? extends Annotation> annotation)
   {
      if (Modifier.isFinal(field.getModifiers()))
      {
         throw new InjectionException("Field " + getAnnotationMessage(annotation) + "cannot be final: " + field);
      }
   }
View Full Code Here

    */
   public static void assertOneParameter(final Method method, Class<? extends Annotation> annotation)
   {
      if (method.getParameterTypes().length != 1)
      {
         throw new InjectionException("Method " + getAnnotationMessage(annotation) + "have to declare exactly one parameter: " + method);
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.wsf.common.injection.InjectionException

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.