• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SerializerResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.olingo.server.api.serializer.SerializerResult的典型用法代码示例。如果您正苦于以下问题:Java SerializerResult类的具体用法?Java SerializerResult怎么用?Java SerializerResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SerializerResult类属于org.apache.olingo.server.api.serializer包,在下文中一共展示了SerializerResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: read

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
/**
 * Method is a template to provide behavior for all read processors.
 */
@Override
public void read(ODataRequest request, ODataResponse response, UriInfo uriInfo,
        ContentType responseFormat) throws ODataApplicationException, ODataLibraryException {
    this.request = request;
    ESRequest searchRequest = createRequest(uriInfo);
    ElasticEdmEntitySet entitySet = searchRequest.getEntitySet();
    SearchResponse searchResponse = searchRequest.execute();
    InstanceData<T, V> data = parseResponse(searchResponse, entitySet);

    ODataSerializer serializer = odata.createSerializer(responseFormat);
    SerializerResult serializerResult = serialize(serializer, data, entitySet, uriInfo);
    response.setContent(serializerResult.getContent());
    response.setStatusCode(HttpStatusCode.OK.getStatusCode());
    response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
}
 
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:19,代码来源:AbstractESReadProcessor.java


示例2: serialize

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Override
protected SerializerResult serialize(ODataSerializer serializer,
        InstanceData<EdmPrimitiveType, Property> data, ElasticEdmEntitySet entitySet,
        UriInfo uriInfo) throws SerializerException {
    List<UriResource> resourceParts = uriInfo.getUriResourceParts();
    UriResourceProperty uriProperty = (UriResourceProperty) resourceParts
            .get(resourceParts.size() - 1);
    ElasticEdmProperty edmProperty = (ElasticEdmProperty) uriProperty.getProperty();
    String propertyName = edmProperty.getName();
    return serializer.primitive(serviceMetadata, data.getType(), data.getValue(),
            PrimitiveSerializerOptions.with()
                    .contextURL(createContextUrl(entitySet, true, null, null, propertyName))
                    .scale(edmProperty.getScale()).nullable(edmProperty.isNullable())
                    .precision(edmProperty.getPrecision()).maxLength(edmProperty.getMaxLength())
                    .unicode(edmProperty.isUnicode()).build());
}
 
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:17,代码来源:PrimitiveProcessorImpl.java


示例3: serializeDeltaPayloads

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
private SerializerResult serializeDeltaPayloads(final ODataRequest request, final Delta delta, 
    final EdmEntitySet edmEntitySet, final EdmEntityType edmEntityType,
    final ContentType requestedFormat, final ExpandOption expand, final SelectOption select,
    final CountOption countOption, String id) throws ODataLibraryException {

  return odata.createEdmDeltaSerializer(requestedFormat, request.getHeaders(HttpHeader.ODATA_VERSION))
      .entityCollection(serviceMetadata,
      edmEntityType, delta,
      EntityCollectionSerializerOptions.with()
      .contextURL(isODataMetadataNone(requestedFormat) ? null :
        getContextUrl(request.getRawODataPath(), edmEntitySet, edmEntityType, false, expand, select, false))
    .count(countOption)
    .expand(expand).select(select)
    .id(id)
    .build());
 
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:18,代码来源:TechnicalEntityProcessor.java


示例4: serializeEntityCollection

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
private SerializerResult serializeEntityCollection(final ODataRequest request, final EntityCollection
    entityCollection, final EdmEntitySet edmEntitySet, final EdmEntityType edmEntityType,
    final ContentType requestedFormat, final ExpandOption expand, final SelectOption select,
    final CountOption countOption, String id, final boolean isContNav) throws ODataLibraryException {

  return odata.createSerializer(requestedFormat, request.getHeaders(HttpHeader.ODATA_VERSION))
      .entityCollection(
      serviceMetadata,
      edmEntityType,
      entityCollection,
      EntityCollectionSerializerOptions.with()
          .contextURL(isODataMetadataNone(requestedFormat) ? null :
              getContextUrl(request.getRawODataPath(), edmEntitySet, edmEntityType, false, expand, select, isContNav))
          .count(countOption)
          .expand(expand).select(select)
          .id(id)
          .build());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:19,代码来源:TechnicalEntityProcessor.java


示例5: serializeEntity

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
private SerializerResult serializeEntity(final ODataRequest request, final Entity entity,
    final EdmEntitySet edmEntitySet, final EdmEntityType edmEntityType,
    final ContentType requestedFormat,
    final ExpandOption expand, final SelectOption select, final boolean isContNav)
    throws ODataLibraryException {

  ContextURL contextUrl = isODataMetadataNone(requestedFormat) ? null :
      getContextUrl(request.getRawODataPath(), edmEntitySet, edmEntityType, true, expand, null,isContNav);
  return odata.createSerializer(requestedFormat, request.getHeaders(HttpHeader.ODATA_VERSION)).entity(
      serviceMetadata,
      edmEntityType,
      entity,
      EntitySerializerOptions.with()
          .contextURL(contextUrl)
          .expand(expand).select(select)
          .build());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:18,代码来源:TechnicalEntityProcessor.java


示例6: entityCollectionReference

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Test
public void entityCollectionReference() throws Exception {
  final EdmEntitySet edmEntitySet = entityContainer.getEntitySet("ESAllPrim");
  final EntityCollection entityCollection = data.readAll(edmEntitySet);

  final SerializerResult serializerResult = serializer.referenceCollection(metadata,
      edmEntitySet,
      entityCollection,
      ReferenceCollectionSerializerOptions.with()
          .contextURL(ContextURL.with().asCollection().suffix(Suffix.REFERENCE).build())
          .build());

  final String resultString = IOUtils.toString(serializerResult.getContent());

  Assert.assertEquals("{\"@odata.context\":\"$metadata#Collection($ref)\","
      + "\"value\":[{\"@odata.id\":\"ESAllPrim(32767)\"},"
      + "{\"@odata.id\":\"ESAllPrim(-32768)\"},"
      + "{\"@odata.id\":\"ESAllPrim(0)\"}]}",
      resultString);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:21,代码来源:ODataJsonSerializerTest.java


示例7: entityCollectionReferenceEmpty

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Test
public void entityCollectionReferenceEmpty() throws Exception {
  final EdmEntitySet edmEntitySet = entityContainer.getEntitySet("ESAllPrim");
  final EntityCollection entityCollection = new EntityCollection();

  final SerializerResult serializerResult = serializer.referenceCollection(metadata,
      edmEntitySet, entityCollection,
      ReferenceCollectionSerializerOptions.with()
          .contextURL(ContextURL.with().asCollection().suffix(Suffix.REFERENCE).build())
          .build());

  final String resultString = IOUtils.toString(serializerResult.getContent());

  Assert.assertEquals("{\"@odata.context\":\"$metadata#Collection($ref)\","
      + "\"value\":[]}", resultString);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:17,代码来源:ODataJsonSerializerTest.java


示例8: entityCollectionReference

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Test
public void entityCollectionReference() throws Exception {
  final EdmEntitySet edmEntitySet = entityContainer.getEntitySet("ESAllPrim");
  final EntityCollection entityCollection = data.readAll(edmEntitySet);

  final SerializerResult serializerResult = serializer.referenceCollection(metadata,
      edmEntitySet,
      entityCollection,
      ReferenceCollectionSerializerOptions.with()
          .contextURL(ContextURL.with().asCollection().suffix(Suffix.REFERENCE).build())
          .build());

  final String resultString = IOUtils.toString(serializerResult.getContent());

  Assert.assertEquals("{\"@context\":\"$metadata#Collection($ref)\","
      + "\"value\":[{\"@id\":\"ESAllPrim(32767)\"},"
      + "{\"@id\":\"ESAllPrim(-32768)\"},"
      + "{\"@id\":\"ESAllPrim(0)\"}]}",
      resultString);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:21,代码来源:ODataJsonSerializerv01Test.java


示例9: entityCollectionReferenceEmpty

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Test
public void entityCollectionReferenceEmpty() throws Exception {
  final EdmEntitySet edmEntitySet = entityContainer.getEntitySet("ESAllPrim");
  final EntityCollection entityCollection = new EntityCollection();

  final SerializerResult serializerResult = serializer.referenceCollection(metadata,
      edmEntitySet, entityCollection,
      ReferenceCollectionSerializerOptions.with()
          .contextURL(ContextURL.with().asCollection().suffix(Suffix.REFERENCE).build())
          .build());

  final String resultString = IOUtils.toString(serializerResult.getContent());

  Assert.assertEquals("{\"@context\":\"$metadata#Collection($ref)\","
      + "\"value\":[]}", resultString);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:17,代码来源:ODataJsonSerializerv01Test.java


示例10: entityCollectionReference

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Test
public void entityCollectionReference() throws Exception {
  final EdmEntitySet edmEntitySet = entityContainer.getEntitySet("ESAllPrim");
  final EntityCollection entityCollection = data.readAll(edmEntitySet);

  ReferenceCollectionSerializerOptions options = ReferenceCollectionSerializerOptions.with()
      .contextURL(ContextURL.with().asCollection().suffix(Suffix.REFERENCE).build()).build();

  final SerializerResult serializerResult = serializer.referenceCollection(metadata,
      edmEntitySet,
      entityCollection, options);

  final String resultString = IOUtils.toString(serializerResult.getContent());
  String expected = "<?xml version='1.0' encoding='UTF-8'?>\n" +
      "<a:feed xmlns:a=\"http://www.w3.org/2005/Atom\"\n" +
      "  xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n" +
      "  m:context=\"$metadata#Collection($ref)\">\n" +
      "  <m:ref id=\"ESAllPrim(32767)\" />\n" +
      "  <m:ref id=\"ESAllPrim(-32768)\" />\n" +
      "  <m:ref id=\"ESAllPrim(0)\" />\n" +
      "</a:feed>";
  checkXMLEqual(expected, resultString);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:24,代码来源:ODataXmlSerializerTest.java


示例11: entityCollectionReferenceEmpty

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Test
public void entityCollectionReferenceEmpty() throws Exception {
  final EdmEntitySet edmEntitySet = entityContainer.getEntitySet("ESAllPrim");
  final EntityCollection entityCollection = new EntityCollection();

  ReferenceCollectionSerializerOptions options = ReferenceCollectionSerializerOptions.with()
      .contextURL(ContextURL.with().asCollection().suffix(Suffix.REFERENCE).build()).build();

  final SerializerResult serializerResult = serializer.referenceCollection(metadata,
      edmEntitySet,
      entityCollection, options);

  final String resultString = IOUtils.toString(serializerResult.getContent());

  String expected = "<?xml version='1.0' encoding='UTF-8'?>\n" +
      "<a:feed xmlns:a=\"http://www.w3.org/2005/Atom\"\n" +
      "  xmlns:m=\"http://docs.oasis-open.org/odata/ns/metadata\"\n" +
      "  m:context=\"$metadata#Collection($ref)\">\n" +
      "</a:feed>";
  checkXMLEqual(expected, resultString);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:22,代码来源:ODataXmlSerializerTest.java


示例12: createMediaEntity

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Override
public void createMediaEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo,
    ContentType requestFormat, ContentType responseFormat) throws ODataApplicationException, ODataLibraryException {
  
  final EdmEntitySet edmEntitySet = Util.getEdmEntitySet(uriInfo);
  final byte[] mediaContent = odata.createFixedFormatDeserializer().binary(request.getBody());
  
  final Entity entity = storage.createMediaEntity(edmEntitySet.getEntityType(), 
                                                  requestFormat.toContentTypeString(), 
                                                  mediaContent);
  
  final ContextURL contextUrl = ContextURL.with().entitySet(edmEntitySet).suffix(Suffix.ENTITY).build();
  final EntitySerializerOptions opts = EntitySerializerOptions.with().contextURL(contextUrl).build();
  final SerializerResult serializerResult = odata.createSerializer(responseFormat).entity(serviceMetadata,
      edmEntitySet.getEntityType(), entity, opts);
  
  final String location = request.getRawBaseUri() + '/'
      + odata.createUriHelper().buildCanonicalURL(edmEntitySet, entity);
  response.setContent(serializerResult.getContent());
  response.setStatusCode(HttpStatusCode.CREATED.getStatusCode());
  response.setHeader(HttpHeader.LOCATION, location);
  response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:24,代码来源:DemoEntityProcessor.java


示例13: createEntity

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Override
public void createEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestFormat,
		ContentType responseFormat) throws ODataApplicationException, ODataLibraryException {

	List<UriResource> resourcePaths = uriInfo.getUriResourceParts();
	UriResourceEntitySet uriResourceEntitySet = (UriResourceEntitySet) resourcePaths.get(resourcePaths.size() - 1);
	EdmEntitySet edmEntitySet = uriResourceEntitySet.getEntitySet();
	EdmEntityType entityType = edmEntitySet.getEntityType();	
	InputStream requestInputStream = request.getBody();
	ODataDeserializer deserializer = this.odata.createDeserializer(requestFormat);
	DeserializerResult result = deserializer.entity(requestInputStream, entityType);
	Entity requestEntity = result.getEntity();		  
	Entity createdEntity = createEntityData(edmEntitySet, requestEntity);		  
	ContextURL contextUrl = ContextURL.with().entitySet(edmEntitySet).build();		  
	EntitySerializerOptions options = EntitySerializerOptions.with().contextURL(contextUrl).build();
	ODataSerializer serializer = this.odata.createSerializer(responseFormat);
	SerializerResult serializedResponse = serializer.entity(serviceMetadata, entityType, createdEntity, options);
	response.setContent(serializedResponse.getContent());
	response.setStatusCode(HttpStatusCode.CREATED.getStatusCode());
	response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());

}
 
开发者ID:jbaliuka,项目名称:sql-analytic,代码行数:23,代码来源:SQLEntityProcessor.java


示例14: readEntity

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Override
public void readEntity(
    ODataRequest request,
    ODataResponse response,
    UriInfo uriInfo,
    ContentType responseFormat) throws ODataApplicationException, ODataLibraryException {

  // First path segment is Entity Set.
  List<UriResource> resourceParts = uriInfo.getUriResourceParts();
  UriResourceEntitySet uriResourceEntitySet = (UriResourceEntitySet) resourceParts.get(0);
  EdmEntitySet entitySet = uriResourceEntitySet.getEntitySet();
  List<UriParameter> keyPredicates = uriResourceEntitySet.getKeyPredicates();

  // Retrieve entity from backend.
  Entity entity = entityRepository.read(entitySet, keyPredicates);

  // Serialize to response format.
  ContextURL contextUrl = ContextURL.with()
      .entitySet(entitySet)
      .suffix(ContextURL.Suffix.ENTITY)
      .build();
  EntitySerializerOptions options = EntitySerializerOptions.with()
      .contextURL(contextUrl)
      .build();
  ODataSerializer serializer = odata.createSerializer(responseFormat);
  SerializerResult serializerResult = serializer.entity(
      serviceMetadata, entitySet.getEntityType(), entity, options);

  // Set response attributes.
  response.setContent(serializerResult.getContent());
  response.setStatusCode(HttpStatusCode.OK.getStatusCode());
  response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
}
 
开发者ID:pukkaone,项目名称:odata-spring-boot-starter,代码行数:34,代码来源:ElasticsearchEntityProcessor.java


示例15: readEntityCollection

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Override
public void readEntityCollection(
    ODataRequest request,
    ODataResponse response,
    UriInfo uriInfo,
    ContentType responseFormat) throws ODataApplicationException, ODataLibraryException {

  // First path segment is Entity Set.
  List<UriResource> resourcePaths = uriInfo.getUriResourceParts();
  UriResourceEntitySet uriResourceEntitySet = (UriResourceEntitySet) resourcePaths.get(0);
  EdmEntitySet entitySet = uriResourceEntitySet.getEntitySet();

  // Retrieve entities from backend.
  EntityCollection entityCollection = entityRepository.list(entitySet, uriInfo);

  // Serialize to response format.
  ContextURL contextUrl = ContextURL.with()
      .entitySet(entitySet)
      .build();
  EntityCollectionSerializerOptions options = EntityCollectionSerializerOptions.with()
      .id(request.getRawBaseUri() + "/" + entitySet.getName())
      .contextURL(contextUrl)
      .build();
  ODataSerializer serializer = odata.createSerializer(responseFormat);
  SerializerResult serializerResult = serializer.entityCollection(
      serviceMetadata, entitySet.getEntityType(), entityCollection, options);

  // Set response attributes.
  response.setContent(serializerResult.getContent());
  response.setStatusCode(HttpStatusCode.OK.getStatusCode());
  response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
}
 
开发者ID:pukkaone,项目名称:odata-spring-boot-starter,代码行数:33,代码来源:ElasticsearchEntityCollectionProcessor.java


示例16: writeProperty

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
private void writeProperty(ODataRequest request, ODataResponse response, ContentType responseFormat,
		EdmEntitySet edmEntitySet, String edmPropertyName, EdmPrimitiveType edmPropertyType, Property property)
		throws SerializerException, ODataApplicationException {
	Object value = property.getValue();
	if (value != null) {

		// 3.1. configure the serializer
		ODataSerializer serializer = odata.createSerializer(responseFormat);
		ContextURL contextUrl = null;
		try {
			//Need absolute URI for PowewrQuery and Linqpad (and probably other MS based OData clients)
			contextUrl = ContextURL.with().entitySet(edmEntitySet).navOrPropertyPath(edmPropertyName)
					.serviceRoot(new URI(request.getRawBaseUri() + "/")).build();
		} catch (URISyntaxException e) {
			throw new ODataApplicationException("Inavlid RawBaseURI " + request.getRawBaseUri(),
					HttpStatusCode.BAD_REQUEST.getStatusCode(), Locale.ROOT);
		}

		PrimitiveSerializerOptions options = PrimitiveSerializerOptions.with().contextURL(contextUrl).build();
		// 3.2. serialize
		SerializerResult serializerResult = serializer.primitive(serviceMetadata, edmPropertyType, property,
				options);
		InputStream propertyStream = serializerResult.getContent();

		//4. configure the response object
		response.setContent(propertyStream);
		response.setStatusCode(HttpStatusCode.OK.getStatusCode());
		response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
	} else {
		// in case there's no value for the property, we can skip the serialization
		response.setStatusCode(HttpStatusCode.NO_CONTENT.getStatusCode());
	}
}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.odata2sparql.v4,代码行数:34,代码来源:SparqlPrimitiveValueProcessor.java


示例17: createEntity

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Override
public void createEntity(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType requestFormat,
		ContentType responseFormat) throws ODataApplicationException, ODataLibraryException {
	// 1. Retrieve the entity type from the URI
	EdmEntitySet edmEntitySet = Util.getEdmEntitySet(uriInfo);
	EdmEntityType edmEntityType = edmEntitySet.getEntityType();

	// 2. create the data in backend
	// 2.1. retrieve the payload from the POST request for the entity to create and deserialize it
	InputStream requestInputStream = request.getBody();
	ODataDeserializer deserializer = this.odata.createDeserializer(requestFormat);
	DeserializerResult result = deserializer.entity(requestInputStream, edmEntityType);
	Entity requestEntity = result.getEntity();
	// 2.2 do the creation in backend, which returns the newly created entity

	Entity createdEntity = null;
	try {
		createdEntity = SparqlBaseCommand.writeEntity(rdfEdmProvider, uriInfo, requestEntity);
		if (createdEntity == null)
			throw new OData2SparqlException("Entity not created");
	} catch (EdmException | OData2SparqlException e) {
		throw new ODataApplicationException(e.getMessage(), HttpStatusCode.NO_CONTENT.getStatusCode(),
				Locale.ENGLISH);
	}

	// 3. serialize the response (we have to return the created entity)
	ContextURL contextUrl = ContextURL.with().entitySet(edmEntitySet).build();
	// expand and select currently not supported
	EntitySerializerOptions options = EntitySerializerOptions.with().contextURL(contextUrl).build();

	ODataSerializer serializer = this.odata.createSerializer(responseFormat);
	SerializerResult serializedResponse = serializer.entity(serviceMetadata, edmEntityType, createdEntity, options);

	//4. configure the response object
	response.setContent(serializedResponse.getContent());
	response.setStatusCode(HttpStatusCode.CREATED.getStatusCode());
	response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.odata2sparql.v4,代码行数:39,代码来源:SparqlEntityProcessor.java


示例18: serialize

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Override
protected SerializerResult serialize(ODataSerializer serializer,
        InstanceData<EdmEntityType, AbstractEntityCollection> data,
        ElasticEdmEntitySet entitySet, UriInfo uriInfo) throws SerializerException {
    String id = request.getRawBaseUri() + "/" + entitySet.getEntityType();
    ExpandOption expand = uriInfo.getExpandOption();
    SelectOption select = uriInfo.getSelectOption();
    CountOption count = uriInfo.getCountOption();
    return serializer.entityCollection(serviceMetadata, data.getType(), data.getValue(),
            EntityCollectionSerializerOptions.with()
                    .contextURL(createContextUrl(entitySet, false, expand, select, null)).id(id)
                    .count(count).select(select).expand(expand).build());
}
 
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:14,代码来源:AbstractESCollectionProcessor.java


示例19: serialize

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
@Override
protected SerializerResult serialize(ODataSerializer serializer,
        InstanceData<EdmEntityType, Entity> data, ElasticEdmEntitySet entitySet,
        UriInfo uriInfo) throws SerializerException {
    ExpandOption expand = uriInfo.getExpandOption();
    SelectOption select = uriInfo.getSelectOption();
    return serializer.entity(serviceMetadata, data.getType(), data.getValue(),
            EntitySerializerOptions.with()
                    .contextURL(createContextUrl(entitySet, true, expand, select, null))
                    .select(select).expand(expand).build());
}
 
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:12,代码来源:EntityProcessorImpl.java


示例20: serializeReferenceCollection

import org.apache.olingo.server.api.serializer.SerializerResult; //导入依赖的package包/类
private SerializerResult serializeReferenceCollection(final EntityCollection entityCollection,
    final EdmEntitySet edmEntitySet, final ContentType requestedFormat, final CountOption countOption)
    throws ODataLibraryException {

  return odata.createSerializer(requestedFormat)
      .referenceCollection(serviceMetadata, edmEntitySet, entityCollection,
          ReferenceCollectionSerializerOptions.with()
              .contextURL(ContextURL.with().asCollection().suffix(Suffix.REFERENCE).build())
              .count(countOption).build());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:11,代码来源:TechnicalEntityProcessor.java



注:本文中的org.apache.olingo.server.api.serializer.SerializerResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DeviceNotSupportedCause类代码示例发布时间:2022-05-22
下一篇:
Java RequestOptions类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap