Package org.jboss.resteasy.spi

Examples of org.jboss.resteasy.spi.ReaderException


         {
            throw (ReaderException) e;
         }
         else
         {
            throw new ReaderException(e);
         }
      }
   }
View Full Code Here


            {
               throw (ReaderException) e;
            }
            else
            {
               throw new ReaderException(e);
            }
         }
      }
   }
View Full Code Here

         {
            throw (ReaderException) e;
         }
         else
         {
            throw new ReaderException(e);
         }
      }
   }
View Full Code Here

      {
         obj = type.newInstance();
      }
      catch (InstantiationException e)
      {
         throw new ReaderException(e.getCause());
      }
      catch (IllegalAccessException e)
      {
         throw new ReaderException(e);
      }

      Class<?> theType = type;
      while (theType != null && !theType.equals(Object.class))
      {
         setFields(theType, input, obj);
         theType = theType.getSuperclass();
      }

      for (Method method : type.getMethods())
      {
         if (method.isAnnotationPresent(FormParam.class)
                 && method.getName().startsWith("set")
                 && method.getParameterTypes().length == 1)
         {
            FormParam param = method.getAnnotation(FormParam.class);
            List<InputPart> list = input.getFormDataMap()
                    .get(param.value());
            if (list == null || list.isEmpty())
               continue;
            InputPart part = list.get(0);
            // if (part == null) throw new
            // LoggableFailure("Unable to find @FormParam in multipart: " +
            // param.value());
            if (part == null)
               continue;
            Object data = part.getBody(method.getParameterTypes()[0],
                    method.getGenericParameterTypes()[0]);
            try
            {
               method.invoke(obj, data);
            }
            catch (IllegalAccessException e)
            {
               throw new ReaderException(e);
            }
            catch (InvocationTargetException e)
            {
               throw new ReaderException(e.getCause());
            }
         }
      }

      return obj;
View Full Code Here

            {
               field.set(obj, data);
            }
            catch (IllegalAccessException e)
            {
               throw new ReaderException(e);
            }
         }
      }
   }
View Full Code Here

         {
            throw (ReaderException) e;
         }
         else
         {
            throw new ReaderException(e);
         }
      }
   }
View Full Code Here

      {
         return documentBuilder.newDocumentBuilder().parse(input);
      }
      catch (Exception e)
      {
         throw new ReaderException(e);
      }
   }
View Full Code Here

*/
public class ReaderExceptionMapperTest extends TestExceptionMapperBase {

    @Test
    public void handleExceptionWithoutResponse() {
        ReaderException nfe = new ReaderException("unacceptable");
        ReaderExceptionMapper nfem = injector.getInstance(ReaderExceptionMapper.class);
        Response r = nfem.toResponse(nfe);
        assertEquals(500, r.getStatus());
        verifyMessage(r, rtmsg("unacceptable"));
    }
View Full Code Here

    @Test
    public void handleExceptionWithResponse() {
        Response mockr = mock(Response.class);
        when(mockr.getStatus()).thenReturn(400);
        ReaderException nfe = new ReaderException("unacceptable", mockr);
        ReaderExceptionMapper nfem = injector.getInstance(ReaderExceptionMapper.class);
        Response r = nfem.toResponse(nfe);
        assertEquals(400, r.getStatus());
        verifyMessage(r, rtmsg("unacceptable"));
    }
View Full Code Here

      {
         body = new MimeBodyPart(new SequenceInputStream(is, entityStream));
      }
      catch (MessagingException e)
      {
         throw new ReaderException(e);
      }
      Providers providers = ResteasyProviderFactory.getContextData(Providers.class);
      input.setProviders(providers);
      input.setAnnotations(annotations);
      input.setBody(body);
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.spi.ReaderException

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.