本文整理了Java中javax.ws.rs.client.Entity.getEntity()
方法的一些代码示例,展示了Entity.getEntity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getEntity()
方法的具体详情如下:
包路径:javax.ws.rs.client.Entity
类名称:Entity
方法名:getEntity
[英]Get entity data.
[中]获取实体数据。
代码示例来源:origin: jersey/jersey
private void storeEntity(final Entity<?> entity) {
if (entity != null) {
requestContext.variant(entity.getVariant());
requestContext.setEntity(entity.getEntity());
requestContext.setEntityAnnotations(entity.getAnnotations());
}
}
代码示例来源:origin: jersey/jersey
private void storeEntity(final Entity<?> entity) {
if (entity != null) {
requestContext.variant(entity.getVariant());
requestContext.setEntity(entity.getEntity());
requestContext.setEntityAnnotations(entity.getAnnotations());
}
}
代码示例来源:origin: org.glassfish.jersey.core/jersey-client
private void storeEntity(final Entity<?> entity) {
if (entity != null) {
requestContext.variant(entity.getVariant());
requestContext.setEntity(entity.getEntity());
requestContext.setEntityAnnotations(entity.getAnnotations());
}
}
代码示例来源:origin: apache/nifi
getLogger().debug("Sending metrics {} to Ambari", new Object[]{entity.getEntity()});
代码示例来源:origin: resteasy/Resteasy
public void setEntity(Entity<?> entity)
{
if (entity == null)
{
this.entity = null;
this.entityAnnotations = null;
this.entityClass = null;
this.entityGenericType = null;
}
else
{
Object ent = entity.getEntity();
setEntityObject(ent);
this.entityAnnotations = entity.getAnnotations();
Variant v = entity.getVariant();
headers.setMediaType(v.getMediaType());
headers.setLanguage(v.getLanguage());
headers.header("Content-Encoding", null);
headers.header("Content-Encoding", v.getEncoding());
}
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
@Override
public <T> Future<T> method(String name, Entity<?> entity, Class<T> responseType) {
WebClient.this.setEntityHeaders(entity);
return doInvokeAsync(name,
entity == null ? null : entity.getEntity(),
entity == null ? null : entity.getEntity().getClass(),
null,
responseType, responseType, null);
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
@Override
public <T> Future<T> method(String name, Entity<?> entity, InvocationCallback<T> callback) {
WebClient.this.setEntityHeaders(entity);
return doInvokeAsyncCallback(name,
entity == null ? null : entity.getEntity(),
entity == null ? null : entity.getEntity().getClass(),
null, callback);
}
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
@Override
public <T> T method(String method, Entity<?> entity, GenericType<T> genericType) {
WebClient.this.setEntityHeaders(entity);
return invoke(method, entity.getEntity(), genericType);
}
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
@Override
public <T> T method(String method, Entity<?> entity, Class<T> cls) {
WebClient.this.setEntityHeaders(entity);
return invoke(method, entity.getEntity(), cls);
}
代码示例来源:origin: org.pacesys.openstack4j.connectors/openstack4j-jersey2
private boolean isInputStreamEntity() {
return (hasEntity() && InputStream.class.isAssignableFrom(entity.getEntity().getClass()));
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
@Override
public <T> Future<T> method(String name, Entity<?> entity, GenericType<T> responseType) {
WebClient.this.setEntityHeaders(entity);
return doInvokeAsync(name,
entity == null ? null : entity.getEntity(),
entity == null ? null : entity.getEntity().getClass(),
null,
responseType.getRawType(), responseType.getType(), null);
}
代码示例来源:origin: com.erudika/para
/**
* Builds, signs and executes a request to an API endpoint using the provided credentials.
* Signs the request using the Amazon Signature 4 algorithm and returns the response.
* @param accessKey access key
* @param secretKey secret key
* @param httpMethod the method (GET, POST...)
* @param endpointURL protocol://host:port
* @param reqPath the API resource path relative to the endpointURL
* @param headers headers map
* @param params parameters map
* @param entity an entity containing any Java object (payload), could be null
* @return a response object
*/
public static Response invokeSignedRequest(String accessKey, String secretKey,
String httpMethod, String endpointURL, String reqPath,
Map<String, String> headers, MultivaluedMap<String, String> params, Entity<?> entity) {
byte[] jsonEntity = null;
if (entity != null) {
try {
jsonEntity = Utils.getJsonWriter().writeValueAsBytes(entity.getEntity());
} catch (JsonProcessingException ex) {
jsonEntity = null;
logger.error(null, ex);
}
}
return invokeSignedRequest(accessKey, secretKey, httpMethod, endpointURL, reqPath, headers, params, jsonEntity);
}
代码示例来源:origin: org.minijax/minijax-core
public static InputStream convertToInputStream(final Entity<?> entity) throws IOException {
if (entity == null || entity.getEntity() == null) {
return null;
final Object obj = entity.getEntity();
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
private void storeEntity(final Entity<?> entity) {
if (entity != null) {
requestContext.variant(entity.getVariant());
requestContext.setEntity(entity.getEntity());
requestContext.setEntityAnnotations(entity.getAnnotations());
}
}
代码示例来源:origin: org.glassfish.jersey.bundles/jaxrs-ri
private void storeEntity(final Entity<?> entity) {
if (entity != null) {
requestContext.variant(entity.getVariant());
requestContext.setEntity(entity.getEntity());
requestContext.setEntityAnnotations(entity.getAnnotations());
}
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
private void storeEntity(final Entity<?> entity) {
if (entity != null) {
requestContext.variant(entity.getVariant());
requestContext.setEntity(entity.getEntity());
requestContext.setEntityAnnotations(entity.getAnnotations());
}
}
代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all
private void storeEntity(final Entity<?> entity) {
if (entity != null) {
requestContext.variant(entity.getVariant());
requestContext.setEntity(entity.getEntity());
requestContext.setEntityAnnotations(entity.getAnnotations());
}
}
代码示例来源:origin: apache/cxf
Entity<?> entity = (Entity<?>)body;
setEntityHeaders(entity);
body = entity.getEntity();
requestClass = body.getClass();
inType = body.getClass();
代码示例来源:origin: org.jboss.resteasy/resteasy-client
public void setEntity(Entity<?> entity)
{
if (entity == null)
{
this.entity = null;
this.entityAnnotations = null;
this.entityClass = null;
this.entityGenericType = null;
}
else
{
Object ent = entity.getEntity();
setEntityObject(ent);
this.entityAnnotations = entity.getAnnotations();
Variant v = entity.getVariant();
headers.setMediaType(v.getMediaType());
headers.setLanguage(v.getLanguage());
headers.header("Content-Encoding", null);
headers.header("Content-Encoding", v.getEncoding());
}
}
代码示例来源:origin: org.jboss.resteasy/resteasy-client-20
public void setEntity(Entity<?> entity)
{
if (entity == null)
{
this.entity = null;
this.entityAnnotations = null;
this.entityClass = null;
this.entityGenericType = null;
}
else
{
Object ent = entity.getEntity();
setEntityObject(ent);
this.entityAnnotations = entity.getAnnotations();
Variant v = entity.getVariant();
headers.setMediaType(v.getMediaType());
headers.setLanguage(v.getLanguage());
headers.header("Content-Encoding", null);
headers.header("Content-Encoding", v.getEncoding());
}
}
内容来源于网络,如有侵权,请联系作者删除!