You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/05/22 13:43:49 UTC
[41/51] [abbrv] [partial] Removing /ODataJClient: merge complete
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/JSONPropertySerializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/JSONPropertySerializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/JSONPropertySerializer.java
deleted file mode 100644
index ea8b61f..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/JSONPropertySerializer.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl;
-
-import com.msopentech.odatajclient.engine.data.impl.JSONDOMTreeUtils;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonLocation;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.msopentech.odatajclient.engine.data.impl.v3.JSONProperty;
-import com.msopentech.odatajclient.engine.metadata.edm.EdmSimpleType;
-import com.msopentech.odatajclient.engine.utils.ODataConstants;
-import com.msopentech.odatajclient.engine.utils.XMLUtils;
-import java.io.IOException;
-import javax.xml.parsers.DocumentBuilder;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Writes out JSON string from <tt>JSONProperty</tt>.
- *
- * @see JSONProperty
- */
-public class JSONPropertySerializer extends ODataJacksonSerializer<JSONProperty> {
-
- @Override
- public void doSerialize(final JSONProperty property, final JsonGenerator jgen, final SerializerProvider provider)
- throws IOException, JsonProcessingException {
-
- jgen.writeStartObject();
-
- if (property.getMetadata() != null) {
- jgen.writeStringField(ODataConstants.JSON_METADATA, property.getMetadata().toASCIIString());
- }
-
- final Element content = property.getContent();
- if (XMLUtils.hasOnlyTextChildNodes(content)) {
- jgen.writeStringField(ODataConstants.JSON_VALUE, content.getTextContent());
- } else {
- try {
- final DocumentBuilder builder = XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder();
- final Document document = builder.newDocument();
- final Element wrapper = document.createElement(ODataConstants.ELEM_PROPERTY);
-
- if (XMLUtils.hasElementsChildNode(content)) {
- wrapper.appendChild(document.renameNode(
- document.importNode(content, true), null, ODataConstants.JSON_VALUE));
-
- JSONDOMTreeUtils.writeSubtree(client, jgen, wrapper);
- } else if (EdmSimpleType.isGeospatial(content.getAttribute(ODataConstants.ATTR_M_TYPE))) {
- wrapper.appendChild(document.renameNode(
- document.importNode(content, true), null, ODataConstants.JSON_VALUE));
-
- JSONDOMTreeUtils.writeSubtree(client, jgen, wrapper, true);
- } else {
- JSONDOMTreeUtils.writeSubtree(client, jgen, content);
- }
- } catch (Exception e) {
- throw new JsonParseException("Cannot serialize property", JsonLocation.NA, e);
- }
- }
-
- jgen.writeEndObject();
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/ODataJacksonDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/ODataJacksonDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/ODataJacksonDeserializer.java
deleted file mode 100644
index 9e5a98d..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/ODataJacksonDeserializer.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import java.io.IOException;
-
-abstract class ODataJacksonDeserializer<T> extends JsonDeserializer<T> {
-
- protected ODataClient client;
-
- protected abstract T doDeserialize(JsonParser jp, DeserializationContext ctxt)
- throws IOException, JsonProcessingException;
-
- @Override
- public T deserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- client = (ODataClient) ctxt.findInjectableValue(ODataClient.class.getName(), null, null);
- return doDeserialize(jp, ctxt);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/ODataJacksonSerializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/ODataJacksonSerializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/ODataJacksonSerializer.java
deleted file mode 100644
index 71881de..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/ODataJacksonSerializer.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import java.io.IOException;
-
-abstract class ODataJacksonSerializer<T> extends JsonSerializer<T> {
-
- protected ODataClient client;
-
- protected abstract void doSerialize(T value, JsonGenerator jgen, SerializerProvider provider)
- throws IOException, JsonProcessingException;
-
- @Override
- public void serialize(final T value, final JsonGenerator jgen, final SerializerProvider provider)
- throws IOException, JsonProcessingException {
-
- client = (ODataClient) provider.getAttribute(ODataClient.class);
- doSerialize(value, jgen, provider);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/XMLServiceDocumentDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/XMLServiceDocumentDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/XMLServiceDocumentDeserializer.java
deleted file mode 100644
index 7d64db2..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/XMLServiceDocumentDeserializer.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser;
-import com.msopentech.odatajclient.engine.data.ServiceDocument;
-import com.msopentech.odatajclient.engine.data.ServiceDocumentElement;
-import com.msopentech.odatajclient.engine.utils.ODataVersion;
-import java.io.IOException;
-import java.net.URI;
-
-public class XMLServiceDocumentDeserializer extends ODataJacksonDeserializer<ServiceDocument> {
-
- private String getTitle(final JsonParser jp) throws IOException {
- String title = jp.nextTextValue();
- if (title == null) {
- jp.nextToken();
- jp.nextToken();
- jp.nextToken();
- title = jp.nextTextValue();
- }
- return title;
- }
-
- private ServiceDocumentElement deserializeElement(final JsonParser jp, final String elementName)
- throws IOException {
-
- final ServiceDocumentElement element = new ServiceDocumentElement();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT
- || !elementName.equals(((FromXmlParser) jp).getStaxReader().getLocalName()); jp.nextToken()) {
-
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("href".equals(jp.getCurrentName())) {
- element.setHref(jp.nextTextValue());
- } else if ("name".equals(jp.getCurrentName())) {
- element.setName(jp.nextTextValue());
- } else if ("title".equals(jp.getCurrentName())) {
- element.setTitle(getTitle(jp));
- }
- }
- }
-
- return element;
- }
-
- @Override
- protected ServiceDocument doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractServiceDocument sdoc = ODataVersion.V3 == client.getWorkingVersion()
- ? new com.msopentech.odatajclient.engine.data.impl.v3.XMLServiceDocument()
- : new com.msopentech.odatajclient.engine.data.impl.v4.XMLServiceDocument();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT
- || !"service".equals(((FromXmlParser) jp).getStaxReader().getLocalName()); jp.nextToken()) {
-
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("base".equals(jp.getCurrentName())) {
- if (sdoc instanceof com.msopentech.odatajclient.engine.data.impl.v3.XMLServiceDocument) {
- ((com.msopentech.odatajclient.engine.data.impl.v3.XMLServiceDocument) sdoc).
- setBaseURI(URI.create(jp.nextTextValue()));
- } else {
- ((com.msopentech.odatajclient.engine.data.impl.v4.XMLServiceDocument) sdoc).
- setBaseURI(URI.create(jp.nextTextValue()));
- }
- } else if ("context".equals(jp.getCurrentName())) {
- ((com.msopentech.odatajclient.engine.data.impl.v4.XMLServiceDocument) sdoc).
- setMetadataContext(jp.nextTextValue());
- } else if ("metadata-etag".equals(jp.getCurrentName())) {
- ((com.msopentech.odatajclient.engine.data.impl.v4.XMLServiceDocument) sdoc).
- setMetadataETag(jp.nextTextValue());
- } else if ("workspace".equals(jp.getCurrentName())) {
- jp.nextToken();
- jp.nextToken();
- if ("title".equals(jp.getCurrentName())) {
- sdoc.setTitle(getTitle(jp));
- }
- } else if ("collection".equals(jp.getCurrentName())) {
- jp.nextToken();
- sdoc.getEntitySets().add(deserializeElement(jp, "collection"));
- } else if ("function-import".equals(jp.getCurrentName())) {
- jp.nextToken();
- sdoc.getFunctionImports().add(deserializeElement(jp, "function-import"));
- } else if ("singleton".equals(jp.getCurrentName())) {
- jp.nextToken();
- sdoc.getSingletons().add(deserializeElement(jp, "singleton"));
- } else if ("service-document".equals(jp.getCurrentName())) {
- jp.nextToken();
- sdoc.getRelatedServiceDocuments().add(deserializeElement(jp, "service-document"));
- }
- }
- }
-
- return sdoc;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomDeserializer.java
deleted file mode 100644
index 2861634..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomDeserializer.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.data.ODataOperation;
-import com.msopentech.odatajclient.engine.utils.ODataConstants;
-import com.msopentech.odatajclient.engine.utils.ODataVersion;
-import com.msopentech.odatajclient.engine.utils.XMLUtils;
-import java.net.URI;
-import java.util.List;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class AtomDeserializer {
-
- private static final Logger LOG = LoggerFactory.getLogger(AtomDeserializer.class);
-
- private static final ISO8601DateFormat ISO_DATEFORMAT = new ISO8601DateFormat();
-
- private final ODataClient client;
-
- public AtomDeserializer(final ODataClient client) {
- this.client = client;
- }
-
- private void common(final Element input, final AtomObject object) {
- if (StringUtils.isNotBlank(input.getAttribute(ODataConstants.ATTR_XMLBASE))) {
- object.setBaseURI(input.getAttribute(ODataConstants.ATTR_XMLBASE));
- }
-
- final List<Element> ids = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_ID);
- if (!ids.isEmpty()) {
- object.setId(ids.get(0).getTextContent());
- }
-
- final List<Element> titles = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_TITLE);
- if (!titles.isEmpty()) {
- object.setTitle(titles.get(0).getTextContent());
- }
-
- final List<Element> summaries = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_SUMMARY);
- if (!summaries.isEmpty()) {
- object.setSummary(summaries.get(0).getTextContent());
- }
-
- final List<Element> updateds = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_UPDATED);
- if (!updateds.isEmpty()) {
- try {
- object.setUpdated(ISO_DATEFORMAT.parse(updateds.get(0).getTextContent()));
- } catch (Exception e) {
- LOG.error("Could not parse date {}", updateds.get(0).getTextContent(), e);
- }
- }
- }
-
- public AtomEntry entry(final Element input) {
- if (!ODataConstants.ATOM_ELEM_ENTRY.equals(input.getNodeName())) {
- return null;
- }
-
- final AtomEntry entry = new AtomEntry();
-
- common(input, entry);
-
- final String etag = input.getAttribute(ODataConstants.ATOM_ATTR_ETAG);
- if (StringUtils.isNotBlank(etag)) {
- entry.setETag(etag);
- }
-
- final List<Element> categories = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_CATEGORY);
- if (!categories.isEmpty()) {
- entry.setType(categories.get(0).getAttribute(ODataConstants.ATOM_ATTR_TERM));
- }
-
- final List<Element> links = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_LINK);
- for (Element linkElem : links) {
- final AtomLink link = new AtomLink();
- link.setRel(linkElem.getAttribute(ODataConstants.ATTR_REL));
- link.setTitle(linkElem.getAttribute(ODataConstants.ATTR_TITLE));
- link.setHref(linkElem.getAttribute(ODataConstants.ATTR_HREF));
-
- if (ODataConstants.SELF_LINK_REL.equals(link.getRel())) {
- entry.setSelfLink(link);
- } else if (ODataConstants.EDIT_LINK_REL.equals(link.getRel())) {
- entry.setEditLink(link);
- } else if (link.getRel().startsWith(
- client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NAVIGATION_LINK_REL))) {
-
- link.setType(linkElem.getAttribute(ODataConstants.ATTR_TYPE));
- entry.addNavigationLink(link);
-
- final List<Element> inlines = XMLUtils.getChildElements(linkElem, ODataConstants.ATOM_ELEM_INLINE);
- if (!inlines.isEmpty()) {
- final List<Element> entries =
- XMLUtils.getChildElements(inlines.get(0), ODataConstants.ATOM_ELEM_ENTRY);
- if (!entries.isEmpty()) {
- link.setInlineEntry(entry(entries.get(0)));
- }
-
- final List<Element> feeds =
- XMLUtils.getChildElements(inlines.get(0), ODataConstants.ATOM_ELEM_FEED);
- if (!feeds.isEmpty()) {
- link.setInlineFeed(feed(feeds.get(0)));
- }
- }
- } else if (link.getRel().startsWith(
- client.getWorkingVersion().getNamespaceMap().get(ODataVersion.ASSOCIATION_LINK_REL))) {
-
- entry.addAssociationLink(link);
- } else if (link.getRel().startsWith(
- client.getWorkingVersion().getNamespaceMap().get(ODataVersion.MEDIA_EDIT_LINK_REL))) {
-
- entry.addMediaEditLink(link);
- }
- }
-
- final List<Element> authors = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_AUTHOR);
- if (!authors.isEmpty()) {
- final AtomEntry.Author author = new AtomEntry.Author();
- for (Node child : XMLUtils.getChildNodes(input, Node.ELEMENT_NODE)) {
- if (ODataConstants.ATOM_ELEM_AUTHOR_NAME.equals(XMLUtils.getSimpleName(child))) {
- author.setName(child.getTextContent());
- } else if (ODataConstants.ATOM_ELEM_AUTHOR_URI.equals(XMLUtils.getSimpleName(child))) {
- author.setUri(child.getTextContent());
- } else if (ODataConstants.ATOM_ELEM_AUTHOR_EMAIL.equals(XMLUtils.getSimpleName(child))) {
- author.setEmail(child.getTextContent());
- }
- }
- if (!author.isEmpty()) {
- entry.setAuthor(author);
- }
- }
-
- final List<Element> actions = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_ACTION);
- for (Element action : actions) {
- final ODataOperation operation = new ODataOperation();
- operation.setMetadataAnchor(action.getAttribute(ODataConstants.ATTR_METADATA));
- operation.setTitle(action.getAttribute(ODataConstants.ATTR_TITLE));
- operation.setTarget(URI.create(action.getAttribute(ODataConstants.ATTR_TARGET)));
-
- entry.addOperation(operation);
- }
-
- final List<Element> contents = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_CONTENT);
- if (!contents.isEmpty()) {
- final Element content = contents.get(0);
-
- List<Element> props = XMLUtils.getChildElements(content, ODataConstants.ELEM_PROPERTIES);
- if (props.isEmpty()) {
- entry.setMediaContentSource(content.getAttribute(ODataConstants.ATOM_ATTR_SRC));
- entry.setMediaContentType(content.getAttribute(ODataConstants.ATTR_TYPE));
-
- props = XMLUtils.getChildElements(input, ODataConstants.ELEM_PROPERTIES);
- if (!props.isEmpty()) {
- entry.setMediaEntryProperties(props.get(0));
- }
- } else {
- entry.setContent(props.get(0));
- }
- }
-
- return entry;
- }
-
- public AtomFeed feed(final Element input) {
- if (!ODataConstants.ATOM_ELEM_FEED.equals(input.getNodeName())) {
- return null;
- }
-
- final AtomFeed feed = new AtomFeed();
-
- common(input, feed);
-
- final List<Element> entries = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_ENTRY);
- for (Element entry : entries) {
- feed.addEntry(entry(entry));
- }
-
- final List<Element> links = XMLUtils.getChildElements(input, ODataConstants.ATOM_ELEM_LINK);
- for (Element link : links) {
- if (ODataConstants.NEXT_LINK_REL.equals(link.getAttribute(ODataConstants.ATTR_REL))) {
- feed.setNext(URI.create(link.getAttribute(ODataConstants.ATTR_HREF)));
- }
- }
-
- final List<Element> counts = XMLUtils.getChildElements(input, ODataConstants.ATOM_ATTR_COUNT);
- if (!counts.isEmpty()) {
- try {
- feed.setCount(Integer.parseInt(counts.get(0).getTextContent()));
- } catch (Exception e) {
- LOG.error("Could not parse $inlinecount {}", counts.get(0).getTextContent(), e);
- }
- }
-
- return feed;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomEntry.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomEntry.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomEntry.java
deleted file mode 100644
index c158676..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomEntry.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.data.impl.AbstractEntry;
-import java.net.URI;
-import java.util.Date;
-import org.apache.commons.lang3.StringUtils;
-
-public class AtomEntry extends AbstractEntry<AtomLink> implements AtomObject {
-
- private static final long serialVersionUID = 6973729343868293279L;
-
- public static class Author {
-
- private String name;
-
- private String uri;
-
- private String email;
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public String getUri() {
- return uri;
- }
-
- public void setUri(final String uri) {
- this.uri = uri;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(final String email) {
- this.email = email;
- }
-
- public boolean isEmpty() {
- return StringUtils.isBlank(name) && StringUtils.isBlank(uri) && StringUtils.isBlank(email);
- }
- }
-
- private URI baseURI;
-
- private String title;
-
- private String summary;
-
- private Date updated;
-
- private Author author;
-
- @Override
- public void setBaseURI(final String baseURI) {
- this.baseURI = URI.create(baseURI);
- }
-
- @Override
- public URI getBaseURI() {
- return baseURI;
- }
-
- @Override
- public String getTitle() {
- return title;
- }
-
- @Override
- public void setTitle(final String title) {
- this.title = title;
- }
-
- @Override
- public String getSummary() {
- return summary;
- }
-
- @Override
- public void setSummary(final String summary) {
- this.summary = summary;
- }
-
- @Override
- public Date getUpdated() {
- return new Date(updated.getTime());
- }
-
- @Override
- public void setUpdated(final Date updated) {
- this.updated = new Date(updated.getTime());
- }
-
- public Author getAuthor() {
- return author;
- }
-
- public void setAuthor(final Author author) {
- this.author = author;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomFeed.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomFeed.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomFeed.java
deleted file mode 100644
index 3355deb..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomFeed.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.data.impl.AbstractPayloadObject;
-import com.msopentech.odatajclient.engine.data.Entry;
-import com.msopentech.odatajclient.engine.data.Feed;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * List of entries, represented via Atom.
- *
- * @see AtomEntry
- */
-public class AtomFeed extends AbstractPayloadObject implements AtomObject, Feed {
-
- private static final long serialVersionUID = 5466590540021319153L;
-
- private URI baseURI;
-
- private String id;
-
- private String title;
-
- private String summary;
-
- private Date updated;
-
- private Integer count;
-
- private final List<AtomEntry> entries;
-
- private URI next;
-
- /**
- * Constructor.
- */
- public AtomFeed() {
- super();
- entries = new ArrayList<AtomEntry>();
- }
-
- @Override
- public URI getBaseURI() {
- return baseURI;
- }
-
- @Override
- public void setBaseURI(final String baseURI) {
- this.baseURI = URI.create(baseURI);
- }
-
- @Override
- public String getId() {
- return id;
- }
-
- public void setId(final String id) {
- this.id = id;
- }
-
- @Override
- public String getTitle() {
- return title;
- }
-
- @Override
- public void setTitle(final String title) {
- this.title = title;
- }
-
- @Override
- public String getSummary() {
- return summary;
- }
-
- @Override
- public void setSummary(final String summary) {
- this.summary = summary;
- }
-
- @Override
- public Date getUpdated() {
- return new Date(updated.getTime());
- }
-
- @Override
- public void setUpdated(final Date updated) {
- this.updated = new Date(updated.getTime());
- }
-
- public void setCount(final Integer count) {
- this.count = count;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public Integer getCount() {
- return count;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public List<AtomEntry> getEntries() {
- return entries;
- }
-
- /**
- * Add entry.
- *
- * @param entry entry.
- * @return 'TRUE' in case of success; 'FALSE' otherwise.
- */
- public boolean addEntry(final AtomEntry entry) {
- return this.entries.add(entry);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- @SuppressWarnings("unchecked")
- public void setEntries(final List<Entry> entries) {
- this.entries.clear();
- for (Entry entry : entries) {
- this.entries.add((AtomEntry) entry);
- }
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public void setNext(final URI next) {
- this.next = next;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public URI getNext() {
- return next;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomLink.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomLink.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomLink.java
deleted file mode 100644
index c43e8c4..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomLink.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.data.impl.AbstractLink;
-
-/**
- * Link from an entry, represented via Atom.
- */
-public class AtomLink extends AbstractLink<AtomEntry, AtomFeed> {
-
- private static final long serialVersionUID = -8983864345121122593L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomObject.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomObject.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomObject.java
deleted file mode 100644
index 1db8775..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomObject.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import java.net.URI;
-import java.util.Date;
-
-/**
- * Common methods for <tt>AtomEntry</tt> and <tt>AtomFeed</tt>.
- *
- * @see AtomEntry
- * @see AtomFeed
- */
-public interface AtomObject {
-
- URI getBaseURI();
-
- void setBaseURI(String baseURI);
-
- String getId();
-
- void setId(String id);
-
- String getTitle();
-
- void setTitle(String title);
-
- String getSummary();
-
- void setSummary(String summary);
-
- Date getUpdated();
-
- void setUpdated(Date updated);
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomSerializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomSerializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomSerializer.java
deleted file mode 100644
index c46c83d..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/AtomSerializer.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.data.impl.AbstractPayloadObject;
-import com.msopentech.odatajclient.engine.utils.ODataConstants;
-import com.msopentech.odatajclient.engine.utils.ODataVersion;
-import com.msopentech.odatajclient.engine.utils.XMLUtils;
-import java.util.List;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.entity.ContentType;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AtomSerializer {
-
- private final ODataClient client;
-
- public AtomSerializer(final ODataClient client) {
- this.client = client;
- }
-
- public <T extends AbstractPayloadObject> Element serialize(final T obj) throws ParserConfigurationException {
- if (obj instanceof AtomEntry) {
- return entry((AtomEntry) obj);
- } else if (obj instanceof AtomFeed) {
- return feed((AtomFeed) obj);
- } else {
- throw new IllegalArgumentException("Unsupported Atom object for standalone serialization: " + obj);
- }
- }
-
- private void setLinks(final Element entry, final List<AtomLink> links) throws ParserConfigurationException {
- for (AtomLink link : links) {
- final Element linkElem = entry.getOwnerDocument().createElement(ODataConstants.ATOM_ELEM_LINK);
-
- linkElem.setAttribute(ODataConstants.ATTR_REL, link.getRel());
- linkElem.setAttribute(ODataConstants.ATTR_TITLE, link.getTitle());
- linkElem.setAttribute(ODataConstants.ATTR_HREF, link.getHref());
-
- if (StringUtils.isNotBlank(link.getType())) {
- linkElem.setAttribute(ODataConstants.ATTR_TYPE, link.getType());
- }
-
- if (link.getInlineEntry() != null || link.getInlineFeed() != null) {
- final Element inline = entry.getOwnerDocument().createElement(ODataConstants.ATOM_ELEM_INLINE);
- linkElem.appendChild(inline);
-
- if (link.getInlineEntry() != null) {
- inline.appendChild(entry.getOwnerDocument().importNode(
- entry((AtomEntry) link.getInlineEntry()), true));
- }
- if (link.getInlineFeed() != null) {
- inline.appendChild(entry.getOwnerDocument().importNode(
- feed((AtomFeed) link.getInlineFeed()), true));
- }
- }
-
- entry.appendChild(linkElem);
- }
- }
-
- private Element entry(final AtomEntry entry) throws ParserConfigurationException {
- final DocumentBuilder builder = XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder();
- final Document doc = builder.newDocument();
-
- final Element entryElem = doc.createElement(ODataConstants.ATOM_ELEM_ENTRY);
- entryElem.setAttribute(XMLConstants.XMLNS_ATTRIBUTE, ODataConstants.NS_ATOM);
- entryElem.setAttribute(ODataConstants.XMLNS_METADATA,
- client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_METADATA));
- entryElem.setAttribute(ODataConstants.XMLNS_DATASERVICES,
- client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_DATASERVICES));
- entryElem.setAttribute(ODataConstants.XMLNS_GML, ODataConstants.NS_GML);
- entryElem.setAttribute(ODataConstants.XMLNS_GEORSS, ODataConstants.NS_GEORSS);
- if (entry.getBaseURI() != null) {
- entryElem.setAttribute(ODataConstants.ATTR_XMLBASE, entry.getBaseURI().toASCIIString());
- }
- doc.appendChild(entryElem);
-
- final Element category = doc.createElement(ODataConstants.ATOM_ELEM_CATEGORY);
- category.setAttribute(ODataConstants.ATOM_ATTR_TERM, entry.getType());
- category.setAttribute(ODataConstants.ATOM_ATTR_SCHEME,
- client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_SCHEME));
- entryElem.appendChild(category);
-
- if (StringUtils.isNotBlank(entry.getTitle())) {
- final Element title = doc.createElement(ODataConstants.ATOM_ELEM_TITLE);
- title.appendChild(doc.createTextNode(entry.getTitle()));
- entryElem.appendChild(title);
- }
-
- if (StringUtils.isNotBlank(entry.getSummary())) {
- final Element summary = doc.createElement(ODataConstants.ATOM_ELEM_SUMMARY);
- summary.appendChild(doc.createTextNode(entry.getSummary()));
- entryElem.appendChild(summary);
- }
-
- setLinks(entryElem, entry.getAssociationLinks());
- setLinks(entryElem, entry.getNavigationLinks());
- setLinks(entryElem, entry.getMediaEditLinks());
-
- final Element content = doc.createElement(ODataConstants.ATOM_ELEM_CONTENT);
- if (entry.isMediaEntry()) {
- if (StringUtils.isNotBlank(entry.getMediaContentType())) {
- content.setAttribute(ODataConstants.ATTR_TYPE, entry.getMediaContentType());
- }
- if (StringUtils.isNotBlank(entry.getMediaContentSource())) {
- content.setAttribute(ODataConstants.ATOM_ATTR_SRC, entry.getMediaContentSource());
- }
- if (content.getAttributes().getLength() > 0) {
- entryElem.appendChild(content);
- }
-
- if (entry.getMediaEntryProperties() != null) {
- entryElem.appendChild(doc.importNode(entry.getMediaEntryProperties(), true));
- }
- } else {
- content.setAttribute(ODataConstants.ATTR_TYPE, ContentType.APPLICATION_XML.getMimeType());
- if (entry.getContent() != null) {
- content.appendChild(doc.importNode(entry.getContent(), true));
- }
- entryElem.appendChild(content);
- }
-
- return entryElem;
- }
-
- private Element feed(final AtomFeed feed) throws ParserConfigurationException {
- final DocumentBuilder builder = XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder();
- final Document doc = builder.newDocument();
-
- final Element feedElem = doc.createElement(ODataConstants.ATOM_ELEM_FEED);
- feedElem.setAttribute(XMLConstants.XMLNS_ATTRIBUTE, ODataConstants.NS_ATOM);
- feedElem.setAttribute(ODataConstants.XMLNS_METADATA,
- client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_METADATA));
- feedElem.setAttribute(ODataConstants.XMLNS_DATASERVICES,
- client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_DATASERVICES));
- feedElem.setAttribute(ODataConstants.XMLNS_GML, ODataConstants.NS_GML);
- feedElem.setAttribute(ODataConstants.XMLNS_GEORSS, ODataConstants.NS_GEORSS);
- if (feed.getBaseURI() != null) {
- feedElem.setAttribute(ODataConstants.ATTR_XMLBASE, feed.getBaseURI().toASCIIString());
- }
- doc.appendChild(feedElem);
-
- if (StringUtils.isNotBlank(feed.getTitle())) {
- final Element title = doc.createElement(ODataConstants.ATOM_ELEM_TITLE);
- title.appendChild(doc.createTextNode(feed.getTitle()));
- feedElem.appendChild(title);
- }
-
- if (StringUtils.isNotBlank(feed.getSummary())) {
- final Element summary = doc.createElement(ODataConstants.ATOM_ELEM_SUMMARY);
- summary.appendChild(doc.createTextNode(feed.getSummary()));
- feedElem.appendChild(summary);
- }
-
- for (AtomEntry entry : feed.getEntries()) {
- feedElem.appendChild(doc.importNode(entry(entry), true));
- }
-
- return feedElem;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONEntry.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONEntry.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONEntry.java
deleted file mode 100644
index 0b63ec7..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONEntry.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.data.impl.AbstractJSONEntry;
-
-/**
- * A single entry, represented via JSON.
- */
-public class JSONEntry extends AbstractJSONEntry {
-
- private static final long serialVersionUID = -5275365545400797758L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONFeed.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONFeed.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONFeed.java
deleted file mode 100644
index a10e706..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONFeed.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.msopentech.odatajclient.engine.data.impl.AbstractPayloadObject;
-import com.msopentech.odatajclient.engine.data.Entry;
-import com.msopentech.odatajclient.engine.data.Feed;
-import com.msopentech.odatajclient.engine.uri.SegmentType;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * List of entries, represented via JSON.
- *
- * @see JSONEntry
- */
-public class JSONFeed extends AbstractPayloadObject implements Feed {
-
- private static final long serialVersionUID = -3576372289800799417L;
-
- @JsonProperty(value = "odata.metadata", required = false)
- private URI metadata;
-
- @JsonProperty(value = "odata.count", required = false)
- private Integer count;
-
- @JsonProperty("value")
- private final List<JSONEntry> entries;
-
- @JsonProperty(value = "odata.nextLink", required = false)
- private String next;
-
- /**
- * Constructor.
- */
- public JSONFeed() {
- super();
- entries = new ArrayList<JSONEntry>();
- }
-
- @JsonIgnore
- @Override
- public URI getBaseURI() {
- URI baseURI = null;
- if (metadata != null) {
- final String metadataURI = getMetadata().toASCIIString();
- baseURI = URI.create(metadataURI.substring(0, metadataURI.indexOf(SegmentType.METADATA.getValue())));
- }
-
- return baseURI;
- }
-
- /**
- * Gets the metadata URI.
- */
- public URI getMetadata() {
- return metadata;
- }
-
- /**
- * Sets the metadata URI.
- *
- * @param metadata metadata URI.
- */
- public void setMetadata(final URI metadata) {
- this.metadata = metadata;
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public Integer getCount() {
- return count;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public List<JSONEntry> getEntries() {
- return entries;
- }
-
- /**
- * Add entry.
- *
- * @param entry entry.
- * @return 'TRUE' in case of success; 'FALSE' otherwise.
- */
- public boolean addEntry(final JSONEntry entry) {
- return this.entries.add(entry);
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public void setEntries(final List<Entry> entries) {
- this.entries.clear();
- for (Entry entry : entries) {
- if (entry instanceof JSONEntry) {
- this.entries.add((JSONEntry) entry);
- }
- }
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public void setNext(final URI next) {
- this.next = next.toASCIIString();
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public URI getNext() {
- return next == null ? null : URI.create(next);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONLink.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONLink.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONLink.java
deleted file mode 100644
index 3e102fa..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONLink.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.data.impl.AbstractLink;
-
-/**
- * Link from an entry, represented via JSON.
- */
-public class JSONLink extends AbstractLink<JSONEntry, JSONFeed> {
-
- private static final long serialVersionUID = 4662606817302869095L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONLinkCollection.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONLinkCollection.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONLinkCollection.java
deleted file mode 100644
index 1df7bea..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONLinkCollection.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.data.impl.AbstractPayloadObject;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.msopentech.odatajclient.engine.data.LinkCollection;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Link from an entry, represented via JSON.
- */
-public class JSONLinkCollection extends AbstractPayloadObject implements LinkCollection {
-
- private static final long serialVersionUID = -5006368367235783907L;
-
- /**
- * JSON link URL representation.
- */
- static class JSONLinkURL extends AbstractPayloadObject {
-
- private static final long serialVersionUID = 5365055617973271468L;
-
- private URI url;
-
- public URI getUrl() {
- return url;
- }
-
- public void setUrl(final URI url) {
- this.url = url;
- }
- }
-
- @JsonProperty(value = "odata.metadata", required = false)
- private URI metadata;
-
- @JsonProperty(required = false)
- private URI url;
-
- @JsonProperty(value = "value", required = false)
- private final List<JSONLinkURL> links = new ArrayList<JSONLinkURL>();
-
- @JsonProperty(value = "odata.nextLink", required = false)
- private String next;
-
- /**
- * Gets the metadata URI.
- */
- public URI getMetadata() {
- return metadata;
- }
-
- /**
- * Sets the metadata URI.
- *
- * @param metadata metadata URI.
- */
- public void setMetadata(final URI metadata) {
- this.metadata = metadata;
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public List<URI> getLinks() {
- final List<URI> result = new ArrayList<URI>();
-
- if (this.url == null) {
- for (JSONLinkURL link : links) {
- result.add(link.getUrl());
- }
- } else {
- result.add(this.url);
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public void setNext(final URI next) {
- this.next = next == null ? null : next.toASCIIString();
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public URI getNext() {
- return next == null ? null : URI.create(next);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONODataError.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONODataError.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONODataError.java
deleted file mode 100644
index d35b755..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONODataError.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.msopentech.odatajclient.engine.data.ODataError;
-import com.msopentech.odatajclient.engine.data.impl.AbstractPayloadObject;
-
-/**
- * This class represents an OData error returned as JSON.
- */
-public class JSONODataError extends AbstractPayloadObject implements ODataError {
-
- private static final long serialVersionUID = -3476499168507242932L;
-
- /**
- * Error message.
- */
- public static class Message extends AbstractPayloadObject {
-
- private static final long serialVersionUID = 2577818040815637859L;
-
- private String lang;
-
- private String value;
-
- /**
- * Gets language.
- *
- * @return language.
- */
- public String getLang() {
- return lang;
- }
-
- /**
- * Sets language.
- *
- * @param lang language.
- */
- public void setLang(final String lang) {
- this.lang = lang;
- }
-
- /**
- * Gets message.
- *
- * @return message.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets message.
- *
- * @param value message.
- */
- public void setValue(final String value) {
- this.value = value;
- }
- }
-
- /**
- * Inner error.
- */
- static class InnerError extends AbstractPayloadObject {
-
- private static final long serialVersionUID = -3920947476143537640L;
-
- private String message;
-
- private String type;
-
- private String stacktrace;
-
- private InnerError internalexception;
-
- /**
- * Gets inner message.
- *
- * @return message.
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Sets inner message.
- *
- * @param message message.
- */
- public void setMessage(final String message) {
- this.message = message;
- }
-
- /**
- * Gets type.
- *
- * @return type.
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets type.
- *
- * @param type type.
- */
- public void setType(final String type) {
- this.type = type;
- }
-
- /**
- * Gets stack-trace.
- *
- * @return stack-trace.
- */
- public String getStacktrace() {
- return stacktrace;
- }
-
- /**
- * Sets stack-trace.
- *
- * @param stacktrace stack-trace.
- */
- public void setStacktrace(final String stacktrace) {
- this.stacktrace = stacktrace;
- }
-
- public InnerError getInternalexception() {
- return internalexception;
- }
-
- public void setInternalexception(final InnerError internalexception) {
- this.internalexception = internalexception;
- }
- }
-
- private String code;
-
- @JsonProperty(value = "message")
- private Message message;
-
- @JsonProperty(value = "innererror", required = false)
- private InnerError innererror;
-
- /**
- * {@inheritDoc }
- */
- @Override
- public String getCode() {
- return code;
- }
-
- /**
- * Sets error code.
- *
- * @param code error code.
- */
- public void setCode(final String code) {
- this.code = code;
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public String getMessageLang() {
- return this.message == null ? null : this.message.getLang();
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public String getMessageValue() {
- return this.message == null ? null : this.message.getValue();
- }
-
- /**
- * Sets the value of the message property.
- *
- * @param value
- * allowed object is
- * {@link Error.Message }
- *
- */
- public void setMessage(final Message value) {
- this.message = value;
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public String getInnerErrorMessage() {
- return this.innererror == null ? null : this.innererror.getMessage();
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public String getInnerErrorType() {
- return this.innererror == null ? null : this.innererror.getType();
- }
-
- /**
- * {@inheritDoc }
- */
- @JsonIgnore
- @Override
- public String getInnerErrorStacktrace() {
- return this.innererror == null ? null : this.innererror.getStacktrace();
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONODataErrorBundle.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONODataErrorBundle.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONODataErrorBundle.java
deleted file mode 100644
index 90b49e7..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONODataErrorBundle.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.msopentech.odatajclient.engine.data.impl.AbstractPayloadObject;
-
-/**
- * This class represents a bundle for an OData error returned as JSON.
- */
-public class JSONODataErrorBundle extends AbstractPayloadObject {
-
- private static final long serialVersionUID = -4784910226259754450L;
-
- @JsonProperty("odata.error")
- private JSONODataError error;
-
- /**
- * Gets error.
- *
- * @return OData error object.
- */
- public JSONODataError getError() {
- return error;
- }
-
- /**
- * Sets error.
- *
- * @param error OData error object.
- */
- public void setError(final JSONODataError error) {
- this.error = error;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONProperty.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONProperty.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONProperty.java
deleted file mode 100644
index be4f651..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONProperty.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.data.impl.JSONPropertyDeserializer;
-import com.msopentech.odatajclient.engine.data.impl.JSONPropertySerializer;
-import com.msopentech.odatajclient.engine.data.impl.AbstractPayloadObject;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import java.net.URI;
-import org.w3c.dom.Element;
-
-/**
- * A single property (primitive, complex or collection) represented via JSON.
- */
-@JsonSerialize(using = JSONPropertySerializer.class)
-@JsonDeserialize(using = JSONPropertyDeserializer.class)
-public class JSONProperty extends AbstractPayloadObject {
-
- private static final long serialVersionUID = 553414431536637434L;
-
- private URI metadata;
-
- private Element content;
-
- /**
- * Gets metadata URI.
- *
- * @return metadata URI.
- */
- public URI getMetadata() {
- return metadata;
- }
-
- /**
- * Sets metadata URI.
- *
- * @param metadata metadata URI.
- */
- public void setMetadata(final URI metadata) {
- this.metadata = metadata;
- }
-
- /**
- * Gets content.
- *
- * @return content as DOM element.
- */
- public Element getContent() {
- return content;
- }
-
- /**
- * Sets content.
- *
- * @param content content as DOM element.
- */
- public void setContent(final Element content) {
- this.content = content;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONServiceDocument.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONServiceDocument.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONServiceDocument.java
deleted file mode 100644
index 3a6e6c2..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/JSONServiceDocument.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.msopentech.odatajclient.engine.data.impl.AbstractServiceDocument;
-import com.msopentech.odatajclient.engine.uri.SegmentType;
-import java.net.URI;
-
-/**
- * Service document, represented via JSON.
- */
-public class JSONServiceDocument extends AbstractServiceDocument {
-
- private static final long serialVersionUID = 4195734928526398830L;
-
- @JsonProperty(value = "odata.metadata", required = false)
- private URI metadata;
-
- @JsonIgnore
- @Override
- public URI getBaseURI() {
- URI baseURI = null;
- if (metadata != null) {
- final String metadataURI = getMetadata().toASCIIString();
- baseURI = URI.create(metadataURI.substring(0, metadataURI.indexOf(SegmentType.METADATA.getValue())));
- }
-
- return baseURI;
- }
-
- /**
- * Gets the metadata URI.
- */
- public URI getMetadata() {
- return metadata;
- }
-
- /**
- * Sets the metadata URI.
- *
- * @param metadata metadata URI.
- */
- public void setMetadata(final URI metadata) {
- this.metadata = metadata;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataBinderImpl.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataBinderImpl.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataBinderImpl.java
deleted file mode 100644
index 71dadb2..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataBinderImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.client.ODataV3Client;
-import com.msopentech.odatajclient.engine.data.impl.AbstractODataBinder;
-import com.msopentech.odatajclient.engine.metadata.EdmType;
-import com.msopentech.odatajclient.engine.metadata.EdmV3Type;
-
-public class ODataBinderImpl extends AbstractODataBinder {
-
- private static final long serialVersionUID = 8970843539708952308L;
-
- public ODataBinderImpl(final ODataV3Client client) {
- super(client);
- }
-
- @Override
- protected EdmType newEdmType(final String expression) {
- return new EdmV3Type(expression);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataDeserializerImpl.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataDeserializerImpl.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataDeserializerImpl.java
deleted file mode 100644
index fcd63f7..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataDeserializerImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.data.impl.AbstractODataDeserializer;
-import com.msopentech.odatajclient.engine.data.impl.AbstractServiceDocument;
-import com.msopentech.odatajclient.engine.format.ODataFormat;
-import com.msopentech.odatajclient.engine.metadata.edm.v3.Edmx;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class ODataDeserializerImpl extends AbstractODataDeserializer {
-
- private static final long serialVersionUID = -8221085862548914611L;
-
- public ODataDeserializerImpl(final ODataClient client) {
- super(client);
- }
-
- @Override
- public Edmx toMetadata(final InputStream input) {
- try {
- return getXmlMapper().readValue(input, Edmx.class);
- } catch (Exception e) {
- throw new IllegalArgumentException("Could not parse as Edmx document", e);
- }
- }
-
- @Override
- public AbstractServiceDocument toServiceDocument(final InputStream input, final ODataFormat format) {
- try {
- return format == ODataFormat.XML
- ? getXmlMapper().readValue(input, XMLServiceDocument.class)
- : getObjectMapper().readValue(input, JSONServiceDocument.class);
- } catch (IOException e) {
- throw new IllegalArgumentException("Could not parse Service Document", e);
- }
- }
-
- @Override
- protected JSONEntry toJSONEntry(final InputStream input) {
- try {
- return getObjectMapper().readValue(input, JSONEntry.class);
- } catch (IOException e) {
- throw new IllegalArgumentException("While deserializing JSON entry", e);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataObjectFactoryImpl.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataObjectFactoryImpl.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataObjectFactoryImpl.java
deleted file mode 100644
index 62b7c8f..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataObjectFactoryImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.data.AbstractODataObjectFactory;
-
-public class ODataObjectFactoryImpl extends AbstractODataObjectFactory {
-
- private static final long serialVersionUID = 7535188943833581980L;
-
- public ODataObjectFactoryImpl(final ODataClient client) {
- super(client);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataReaderImpl.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataReaderImpl.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataReaderImpl.java
deleted file mode 100644
index c31cbe5..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataReaderImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.client.ODataV3Client;
-import com.msopentech.odatajclient.engine.data.ODataServiceDocument;
-import com.msopentech.odatajclient.engine.data.impl.AbstractODataReader;
-import com.msopentech.odatajclient.engine.format.ODataFormat;
-import com.msopentech.odatajclient.engine.metadata.EdmV3Metadata;
-import java.io.InputStream;
-
-public class ODataReaderImpl extends AbstractODataReader {
-
- private static final long serialVersionUID = -2481293269536406956L;
-
- public ODataReaderImpl(final ODataV3Client client) {
- super(client);
- }
-
- @Override
- public EdmV3Metadata readMetadata(final InputStream input) {
- return new EdmV3Metadata(client, input);
- }
-
- @Override
- public ODataServiceDocument readServiceDocument(final InputStream input, final ODataFormat format) {
- return ((ODataV3Client) client).getBinder().getODataServiceDocument(
- ((ODataV3Client) client).getDeserializer().toServiceDocument(input, format));
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataSerializerImpl.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataSerializerImpl.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataSerializerImpl.java
deleted file mode 100644
index bdf9bd2..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataSerializerImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.data.impl.AbstractODataSerializer;
-
-public class ODataSerializerImpl extends AbstractODataSerializer {
-
- private static final long serialVersionUID = -8861908250297989806L;
-
- public ODataSerializerImpl(final ODataClient client) {
- super(client);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataWriterImpl.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataWriterImpl.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataWriterImpl.java
deleted file mode 100644
index b701ce8..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/impl/v3/ODataWriterImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package com.msopentech.odatajclient.engine.data.impl.v3;
-
-import com.msopentech.odatajclient.engine.client.ODataV3Client;
-import com.msopentech.odatajclient.engine.data.impl.AbstractODataWriter;
-
-public class ODataWriterImpl extends AbstractODataWriter {
-
- private static final long serialVersionUID = 8116587589700150049L;
-
- public ODataWriterImpl(final ODataV3Client client) {
- super(client);
- }
-}