Package javax.ws.rs.core

Examples of javax.ws.rs.core.GenericEntity


      Type generic = genericType;
      Class type = entity.getClass();
      Object ent = entity;
      if (entity instanceof GenericEntity)
      {
         GenericEntity ge = (GenericEntity) entity;
         generic = ge.getType();
         ent = ge.getEntity();
         type = ent.getClass();
      }
      MediaType contentType = resolveContentType();
      MessageBodyWriter writer = providerFactory.getMessageBodyWriter(
              type, generic, annotations, contentType);
View Full Code Here


        Type entityType = entity.getClass();

        // if the entity is generic, get specific type and class
        if (entity instanceof GenericEntity) {
            final GenericEntity generic = (GenericEntity)entity;
            entityType = generic.getType(); // overwrite
            entity = generic.getEntity();
        }

        final Class entityClass = entity.getClass();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
View Full Code Here

      status = response.getStatus();
      headers = response.getMetadata();
      entity = response.getEntity();
      if (entity instanceof GenericEntity)
      {
         GenericEntity ge = (GenericEntity)entity;
         entity = ge.getEntity();
         entityType = ge.getType();
      }
      else
      {
         if (entity != null)
            entityType = entity.getClass();
View Full Code Here

        }

        GenericType responseGenericType = new GenericType(method.getGenericReturnType());
        if (entity != null) {
            if (entityType instanceof ParameterizedType) {
                entity = new GenericEntity(entity, entityType);
            }
            result = b.method(httpMethod, Entity.entity(entity, contentType), responseGenericType);
        } else {
            result = b.method(httpMethod, responseGenericType);
        }
View Full Code Here

TOP

Related Classes of javax.ws.rs.core.GenericEntity

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.