Examples of OnReadInlineContent


Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

        EdmNavigationProperty navigationProperty =
            (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);
        EdmEntitySet inlineEntitySet = eia.getEntitySet().getRelatedEntitySet(navigationProperty);
        EntityInfoAggregator inlineEia = EntityInfoAggregator.create(inlineEntitySet);
        EntityProviderReadProperties inlineReadProperties;
        OnReadInlineContent callback = readProperties.getCallback();
        try {
          if (callback == null) {
            inlineReadProperties =
                EntityProviderReadProperties.init()
                    .mergeSemantic(readProperties.getMergeSemantic())
                    .isValidatingFacets(readProperties.isValidatingFacets())
                    .build();

          } else {
            inlineReadProperties = callback.receiveReadProperties(readProperties, navigationProperty);
          }

          if (navigationProperty.getMultiplicity() == EdmMultiplicity.MANY) {
            JsonFeedConsumer inlineConsumer = new JsonFeedConsumer(reader, inlineEia, inlineReadProperties);
            ODataFeed feed = inlineConsumer.readStartedInlineFeed(name);
            updateExpandSelectTree(navigationPropertyName, feed);
            if (callback == null) {
              properties.put(navigationPropertyName, feed);
              resultEntry.setContainsInlineEntry(true);
            } else {
              ReadFeedResult result = new ReadFeedResult(inlineReadProperties, navigationProperty, feed);
              callback.handleReadFeed(result);
            }
          } else {
            JsonEntryConsumer inlineConsumer = new JsonEntryConsumer(reader, inlineEia, inlineReadProperties);
            ODataEntry entry = inlineConsumer.readInlineEntry(name);
            updateExpandSelectTree(navigationPropertyName, entry);
            if (callback == null) {
              properties.put(navigationPropertyName, entry);
              resultEntry.setContainsInlineEntry(true);
            } else {
              ReadEntryResult result = new ReadEntryResult(inlineReadProperties, navigationProperty, entry);
              callback.handleReadEntry(result);
            }
          }

        } catch (ODataApplicationException e) {
          throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
              .getSimpleName()), e);
        }
      }
      reader.endObject();
    } else if (peek == JsonToken.NULL) {
      reader.nextNull();
    } else {
      final EdmNavigationProperty navigationProperty =
          (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);
      final EdmEntitySet inlineEntitySet = eia.getEntitySet().getRelatedEntitySet(navigationProperty);
      final EntityInfoAggregator inlineInfo = EntityInfoAggregator.create(inlineEntitySet);
      OnReadInlineContent callback = readProperties.getCallback();
      EntityProviderReadProperties inlineReadProperties;
      if (callback == null) {
        inlineReadProperties =
            EntityProviderReadProperties.init()
                .mergeSemantic(readProperties.getMergeSemantic())
                .isValidatingFacets(readProperties.isValidatingFacets())
                .build();
      } else {
        try {
          inlineReadProperties = callback.receiveReadProperties(readProperties, navigationProperty);
        } catch (final ODataApplicationException e) {
          throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
              .getSimpleName()), e);
        }
      }
      ODataFeed feed = new JsonFeedConsumer(reader, inlineInfo, inlineReadProperties).readInlineFeedStandalone();
      updateExpandSelectTree(navigationPropertyName, feed);
      if (callback == null) {
        properties.put(navigationPropertyName, feed);
        resultEntry.setContainsInlineEntry(true);
      } else {
        ReadFeedResult result = new ReadFeedResult(inlineReadProperties, navigationProperty, feed);
        try {
          callback.handleReadFeed(result);
        } catch (final ODataApplicationException e) {
          throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
              .getSimpleName()), e);
        }
      }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

  private void updateReadProperties(final EntityProviderReadProperties readProperties,
      final String navigationPropertyName,
      final EdmNavigationProperty navigationProperty, final boolean isFeed, final List<ODataEntry> inlineEntries)
      throws EntityProviderException {
    Object entry = extractODataEntity(isFeed, inlineEntries);
    OnReadInlineContent callback = readProperties.getCallback();
    if (callback == null) {
      readEntryResult.setContainsInlineEntry(true);
      properties.put(navigationPropertyName, entry);
    } else {
      doCallback(readProperties, navigationProperty, callback, isFeed, entry);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

   * @return
   * @throws EntityProviderException
   */
  private EntityProviderReadProperties createInlineProperties(final EntityProviderReadProperties readProperties,
      final EdmNavigationProperty navigationProperty) throws EntityProviderException {
    final OnReadInlineContent callback = readProperties.getCallback();

    EntityProviderReadProperties currentReadProperties = EntityProviderReadProperties.initFrom(readProperties).build();
    if (callback == null) {
      return currentReadProperties;
    } else {
      try {
        return callback.receiveReadProperties(currentReadProperties, navigationProperty);
      } catch (ODataApplicationException e) {
        throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
            .getSimpleName()), e);
      }
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

  private void updateReadProperties(final EntityProviderReadProperties readProperties,
      final String navigationPropertyName,
      final EdmNavigationProperty navigationProperty, final boolean isFeed, final List<ODataEntry> inlineEntries)
      throws EntityProviderException {
    Object entry = extractODataEntity(isFeed, inlineEntries);
    OnReadInlineContent callback = readProperties.getCallback();
    if (callback == null) {
      readEntryResult.setContainsInlineEntry(true);
      properties.put(navigationPropertyName, entry);
    } else {
      doCallback(readProperties, navigationProperty, callback, isFeed, entry);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

   * @return
   * @throws EntityProviderException
   */
  private EntityProviderReadProperties createInlineProperties(final EntityProviderReadProperties readProperties,
      final EdmNavigationProperty navigationProperty) throws EntityProviderException {
    final OnReadInlineContent callback = readProperties.getCallback();

    EntityProviderReadProperties currentReadProperties = EntityProviderReadProperties.initFrom(readProperties).build();
    if (callback == null) {
      return currentReadProperties;
    } else {
      try {
        return callback.receiveReadProperties(currentReadProperties, navigationProperty);
      } catch (ODataApplicationException e) {
        throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
            .getSimpleName()), e);
      }
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

        EdmNavigationProperty navigationProperty =
            (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);
        EdmEntitySet inlineEntitySet = eia.getEntitySet().getRelatedEntitySet(navigationProperty);
        EntityInfoAggregator inlineEia = EntityInfoAggregator.create(inlineEntitySet);
        EntityProviderReadProperties inlineReadProperties;
        OnReadInlineContent callback = readProperties.getCallback();
        try {
          if (callback == null) {
            inlineReadProperties =
                EntityProviderReadProperties.init().mergeSemantic(readProperties.getMergeSemantic()).build();

          } else {
            inlineReadProperties = callback.receiveReadProperties(readProperties, navigationProperty);
          }

          if (navigationProperty.getMultiplicity() == EdmMultiplicity.MANY) {
            JsonFeedConsumer inlineConsumer = new JsonFeedConsumer(reader, inlineEia, inlineReadProperties);
            ODataFeed feed = inlineConsumer.readStartedInlineFeed(name);
            updateExpandSelectTree(navigationPropertyName, feed);
            if (callback == null) {
              properties.put(navigationPropertyName, feed);
              resultEntry.setContainsInlineEntry(true);
            } else {
              ReadFeedResult result = new ReadFeedResult(inlineReadProperties, navigationProperty, feed);
              callback.handleReadFeed(result);
            }
          } else {
            JsonEntryConsumer inlineConsumer = new JsonEntryConsumer(reader, inlineEia, inlineReadProperties);
            ODataEntry entry = inlineConsumer.readInlineEntry(name);
            updateExpandSelectTree(navigationPropertyName, entry);
            if (callback == null) {
              properties.put(navigationPropertyName, entry);
              resultEntry.setContainsInlineEntry(true);
            } else {
              ReadEntryResult result = new ReadEntryResult(inlineReadProperties, navigationProperty, entry);
              callback.handleReadEntry(result);
            }
          }

        } catch (ODataApplicationException e) {
          throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
              .getSimpleName()), e);
        }
      }
      reader.endObject();
    } else {
      final EdmNavigationProperty navigationProperty =
          (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);
      final EdmEntitySet inlineEntitySet = eia.getEntitySet().getRelatedEntitySet(navigationProperty);
      final EntityInfoAggregator inlineInfo = EntityInfoAggregator.create(inlineEntitySet);
      OnReadInlineContent callback = readProperties.getCallback();
      EntityProviderReadProperties inlineReadProperties;
      if (callback == null) {
        inlineReadProperties =
            EntityProviderReadProperties.init().mergeSemantic(readProperties.getMergeSemantic()).build();
      } else {
        try {
          inlineReadProperties = callback.receiveReadProperties(readProperties, navigationProperty);
        } catch (final ODataApplicationException e) {
          throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
              .getSimpleName()), e);
        }
      }
      ODataFeed feed = new JsonFeedConsumer(reader, inlineInfo, inlineReadProperties).readInlineFeedStandalone();
      updateExpandSelectTree(navigationPropertyName, feed);
      if (callback == null) {
        properties.put(navigationPropertyName, feed);
        resultEntry.setContainsInlineEntry(true);
      } else {
        ReadFeedResult result = new ReadFeedResult(inlineReadProperties, navigationProperty, feed);
        try {
          callback.handleReadFeed(result);
        } catch (final ODataApplicationException e) {
          throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
              .getSimpleName()), e);
        }
      }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

  private void updateReadProperties(final EntityProviderReadProperties readProperties,
      final String navigationPropertyName,
      final EdmNavigationProperty navigationProperty, final boolean isFeed, final List<ODataEntry> inlineEntries)
      throws EntityProviderException {
    Object entry = extractODataEntity(isFeed, inlineEntries);
    OnReadInlineContent callback = readProperties.getCallback();
    if (callback == null) {
      readEntryResult.setContainsInlineEntry(true);
      properties.put(navigationPropertyName, entry);
    } else {
      doCallback(readProperties, navigationProperty, callback, isFeed, entry);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

   * @return
   * @throws EntityProviderException
   */
  private EntityProviderReadProperties createInlineProperties(final EntityProviderReadProperties readProperties,
      final EdmNavigationProperty navigationProperty) throws EntityProviderException {
    final OnReadInlineContent callback = readProperties.getCallback();

    EntityProviderReadProperties currentReadProperties = EntityProviderReadProperties.initFrom(readProperties).build();
    if (callback == null) {
      return currentReadProperties;
    } else {
      try {
        return callback.receiveReadProperties(currentReadProperties, navigationProperty);
      } catch (ODataApplicationException e) {
        throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
            .getSimpleName()), e);
      }
    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

  private void updateReadProperties(final EntityProviderReadProperties readProperties,
      final String navigationPropertyName,
      final EdmNavigationProperty navigationProperty, final boolean isFeed, final List<ODataEntry> inlineEntries)
      throws EntityProviderException {
    Object entry = extractODataEntity(isFeed, inlineEntries);
    OnReadInlineContent callback = readProperties.getCallback();
    if (callback == null) {
      readEntryResult.setContainsInlineEntry(true);
      properties.put(navigationPropertyName, entry);
    } else {
      doCallback(readProperties, navigationProperty, callback, isFeed, entry);
View Full Code Here

Examples of org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent

   * @return
   * @throws EntityProviderException
   */
  private EntityProviderReadProperties createInlineProperties(final EntityProviderReadProperties readProperties,
      final EdmNavigationProperty navigationProperty) throws EntityProviderException {
    final OnReadInlineContent callback = readProperties.getCallback();

    EntityProviderReadProperties currentReadProperties = EntityProviderReadProperties.initFrom(readProperties).build();
    if (callback == null) {
      return currentReadProperties;
    } else {
      try {
        return callback.receiveReadProperties(currentReadProperties, navigationProperty);
      } catch (ODataApplicationException e) {
        throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
            .getSimpleName()), e);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.