@Test public void validationOfDoublePropertyDifferentNamespace() throws Exception { String room = "<?xml version='1.0' encoding='UTF-8'?>" + "<entry xmlns=\"http: " xmlns:m=\"http: " xmlns:d=\"http: " xml:base=\"http: " m:etag=\"W/&quot;1&quot;\">" + "" + " <id>http: " <title type=\"text\">Room 1</title>" + " <updated>2013-01-11T13:50:50.541+01:00</updated>" + " <content type=\"application/xml\">" + " <m:properties>" + " <d:Id>1</d:Id>" + " <d:Seats>11</d:Seats>" + " <o:Name xmlns:o=\"http: " <d:Name>Room 42</d:Name>" + " <d:Version>4711</d:Version>" + " </m:properties>" + " </content>" + "</entry>"; EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms"); InputStream reqContent = createContentAsStream(room); XmlEntityConsumer xec = new XmlEntityConsumer(); ODataEntry result = xec.readEntry(entitySet, reqContent, EntityProviderReadProperties.init().mergeSemantic(false).build()); assertNotNull(result); }
public ODataEntry readEntry(final EdmEntitySet entitySet, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(content); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryConsumer().readEntry(reader, eia, properties, false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } } } } }
XmlEntityConsumer { public ODataEntry readEntry(final EdmEntitySet entitySet, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(content); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryConsumer().readEntry(reader, eia, properties, false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } } } } } }
XmlEntityConsumer { public ODataEntry readEntry(final EdmEntitySet entitySet, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(content); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryConsumer().readEntry(reader, eia, properties, false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } } } } } XmlEntityConsumer(); }
XmlEntityConsumer { public ODataEntry readEntry(final EdmEntitySet entitySet, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(content); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryConsumer().readEntry(reader, eia, properties, false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } } } } } XmlEntityConsumer(); ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final InputStream content,
      final EntityProviderReadProperties properties); ODataEntry readEntry(final EdmEntitySet entitySet, final InputStream content,
      final EntityProviderReadProperties properties); Map<String, Object> readProperty(final EdmProperty edmProperty, final InputStream content,
      final EntityProviderReadProperties properties); Map<String, Object> readProperty(final EntityPropertyInfo propertyInfo, final InputStream content,
      final EntityProviderReadProperties readProperties); Object readPropertyValue(final EdmProperty edmProperty, final InputStream content); Object readPropertyValue(final EdmProperty edmProperty, final InputStream content, final Class<?> typeMapping); Object readCollection(final EntityPropertyInfo info, InputStream content,
      final EntityProviderReadProperties properties); String readLink(final EdmEntitySet entitySet, final Object content); List<String> readLinks(final EdmEntitySet entitySet, final Object content); }
XmlEntityConsumer { public ODataEntry readEntry(final EdmEntitySet entitySet, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { XMLStreamReader reader = null; EntityProviderException cachedException = null; try { reader = XmlHelper.createStreamReader(content); EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet); return new XmlEntryConsumer().readEntry(reader, eia, properties, false); } catch (EntityProviderException e) { cachedException = e; throw cachedException; } finally { if (reader != null) { try { reader.close(); } catch (XMLStreamException e) { if (cachedException != null) { throw cachedException; } else { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } } } } } XmlEntityConsumer(); ODataDeltaFeed readFeed(final EdmEntitySet entitySet, final InputStream content,
      final EntityProviderReadProperties properties); ODataEntry readEntry(final EdmEntitySet entitySet, final InputStream content,
      final EntityProviderReadProperties properties); Map<String, Object> readProperty(final EdmProperty edmProperty, final InputStream content,
      final EntityProviderReadProperties properties); Map<String, Object> readProperty(final EntityPropertyInfo propertyInfo, final InputStream content,
      final EntityProviderReadProperties readProperties); Object readPropertyValue(final EdmProperty edmProperty, final InputStream content); Object readPropertyValue(final EdmProperty edmProperty, final InputStream content, final Class<?> typeMapping); Object readCollection(final EntityPropertyInfo info, InputStream content,
      final EntityProviderReadProperties properties); String readLink(final EdmEntitySet entitySet, final Object content); List<String> readLinks(final EdmEntitySet entitySet, final Object content);  }