Package org.jboss.resteasy.client

Examples of org.jboss.resteasy.client.EntityTypeFactory


            final Class<? extends EntityTypeFactory> entityTypeFactory = responseHint.entityTypeFactory();
            return new EntityExtractor()
            {
               public Object extractEntity(ClientRequestContext context, Object... args)
               {
                  EntityTypeFactory factory = null;
                  try
                  {
                     factory = entityTypeFactory.newInstance();
                  }
                  catch (InstantiationException e)
                  {
                     throw (context.getClientResponse())
                             .createResponseFailure("Could not create a default entity type factory of type "
                                     + entityTypeFactory.getClass().getName());
                  }
                  catch (IllegalAccessException e)
                  {
                     throw ((BaseClientResponse<?>) context.getClientResponse())
                             .createResponseFailure("Could not create a default entity type factory of type "
                                     + entityTypeFactory.getClass().getName() + ". " + e.getMessage());
                  }
                  context.getClientResponse().setReturnType(
                          factory.getEntityType(((BaseClientResponse<?>) context.getClientResponse()).getStatus(),
                                  ((BaseClientResponse<?>) context.getClientResponse()).getMetadata()));
                  return context.getClientResponse();
               }
            };
         }
View Full Code Here


   {
      Class returnType = responseHint.entityType();
      Class<? extends EntityTypeFactory> entityTypeFactory = responseHint.entityTypeFactory();
      if (isVoidReturnType(returnType))
      {
         EntityTypeFactory factory = null;
         try
         {
            factory = entityTypeFactory.newInstance();
         }
         catch (InstantiationException e)
         {
            throw clientResponse
                    .createResponseFailure("Could not create a default entity type factory of type "
                            + entityTypeFactory.getClass().getName());
         }
         catch (IllegalAccessException e)
         {
            throw clientResponse
                    .createResponseFailure("Could not create a default entity type factory of type "
                            + entityTypeFactory.getClass().getName()
                            + ". "
                            + e.getMessage());
         }
         returnType = factory.getEntityType(clientResponse.getStatus(), clientResponse.getMetadata());
      }
      if (!isVoidReturnType(returnType))
      {
         clientResponse.setReturnType(returnType);
      }
View Full Code Here

   {
      Class returnType = responseHint.entityType();
      Class<? extends EntityTypeFactory> entityTypeFactory = responseHint.entityTypeFactory();
      if (isVoidReturnType(returnType))
      {
         EntityTypeFactory factory = null;
         try
         {
            factory = entityTypeFactory.newInstance();
         }
         catch (InstantiationException e)
         {
            throw clientResponse
                    .createResponseFailure("Could not create a default entity type factory of type "
                            + entityTypeFactory.getClass().getName());
         }
         catch (IllegalAccessException e)
         {
            throw clientResponse
                    .createResponseFailure("Could not create a default entity type factory of type "
                            + entityTypeFactory.getClass().getName()
                            + ". "
                            + e.getMessage());
         }
         returnType = factory.getEntityType(clientResponse.getStatus(), clientResponse.getMetadata());
      }
      if (!isVoidReturnType(returnType))
      {
         clientResponse.setReturnType(returnType);
      }
View Full Code Here

            final Class<? extends EntityTypeFactory> entityTypeFactory = responseHint.entityTypeFactory();
            return new EntityExtractor()
            {
               public Object extractEntity(ClientRequestContext context, Object... args)
               {
                  EntityTypeFactory factory = null;
                  try
                  {
                     factory = entityTypeFactory.newInstance();
                  }
                  catch (InstantiationException e)
                  {
                     throw (context.getClientResponse())
                             .createResponseFailure("Could not create a default entity type factory of type "
                                     + entityTypeFactory.getClass().getName());
                  }
                  catch (IllegalAccessException e)
                  {
                     throw ((BaseClientResponse<?>) context.getClientResponse())
                             .createResponseFailure("Could not create a default entity type factory of type "
                                     + entityTypeFactory.getClass().getName() + ". " + e.getMessage());
                  }
                  context.getClientResponse().setReturnType(
                          factory.getEntityType(((BaseClientResponse<?>) context.getClientResponse()).getStatus(),
                                  ((BaseClientResponse<?>) context.getClientResponse()).getMetadata()));
                  return context.getClientResponse();
               }
            };
         }
View Full Code Here

   {
      Class returnType = responseHint.entityType();
      Class<? extends EntityTypeFactory> entityTypeFactory = responseHint.entityTypeFactory();
      if (isVoidReturnType(returnType))
      {
         EntityTypeFactory factory = null;
         try
         {
            factory = entityTypeFactory.newInstance();
         }
         catch (InstantiationException e)
         {
            throw clientResponse
                    .createResponseFailure("Could not create a default entity type factory of type "
                            + entityTypeFactory.getClass().getName());
         }
         catch (IllegalAccessException e)
         {
            throw clientResponse
                    .createResponseFailure("Could not create a default entity type factory of type "
                            + entityTypeFactory.getClass().getName()
                            + ". "
                            + e.getMessage());
         }
         returnType = factory.getEntityType(clientResponse.getStatus(), clientResponse.getMetadata());
      }
      if (!isVoidReturnType(returnType))
      {
         clientResponse.setReturnType(returnType);
      }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.client.EntityTypeFactory

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.