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:52 UTC
[44/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/ODataGeospatialValue.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataGeospatialValue.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataGeospatialValue.java
deleted file mode 100644
index 53fc589..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataGeospatialValue.java
+++ /dev/null
@@ -1,488 +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;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.metadata.edm.EdmSimpleType;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Geospatial;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.GeospatialCollection;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.LineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiLineString;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPoint;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.MultiPolygon;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Point;
-import com.msopentech.odatajclient.engine.metadata.edm.geospatial.Polygon;
-import com.msopentech.odatajclient.engine.utils.ODataConstants;
-import com.msopentech.odatajclient.engine.utils.XMLUtils;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class ODataGeospatialValue extends ODataPrimitiveValue {
-
- private static final long serialVersionUID = -3984105137562291082L;
-
- /**
- * Geospatial value builder.
- */
- public static class Builder extends AbstractBuilder {
-
- private final ODataGeospatialValue ogv;
-
- /**
- * Constructor.
- */
- public Builder(final ODataClient client) {
- super(client);
- this.ogv = new ODataGeospatialValue(client);
- }
-
- /**
- * Sets the given value provided as a DOM tree.
- *
- * @param tree value.
- * @return the current builder.
- */
- public Builder setTree(final Element tree) {
- this.ogv.tree = tree;
- return this;
- }
-
- /**
- * Sets the actual object value.
- *
- * @param value value.
- * @return the current builder.
- */
- public <T extends Geospatial> Builder setValue(final T value) {
- this.ogv.value = value;
- return this;
- }
-
- /**
- * Sets actual value type.
- *
- * @param type type.
- * @return the current builder.
- */
- public Builder setType(final EdmSimpleType type) {
- isSupported(type);
-
- if (!type.isGeospatial()) {
- throw new IllegalArgumentException(
- "Use " + ODataPrimitiveValue.class.getSimpleName() + " for non-geospatial types");
- }
-
- if (type == EdmSimpleType.Geography || type == EdmSimpleType.Geometry) {
- throw new IllegalArgumentException(
- type + "is not an instantiable type. "
- + "An entity can declare a property to be of type Geometry. "
- + "An instance of an entity MUST NOT have a value of type Geometry. "
- + "Each value MUST be of some subtype.");
- }
- this.ogv.type = type;
- return this;
- }
-
- /**
- * Builds the geospatial value.
- *
- * @return <tt>ODataGeospatialValue</tt> object.
- */
- public ODataGeospatialValue build() {
- if (this.ogv.tree == null && this.ogv.value == null) {
- throw new IllegalArgumentException("Must provide either tree or value");
- }
- if (this.ogv.tree != null && this.ogv.value != null) {
- throw new IllegalArgumentException("Cannot provide both tree and value");
- }
-
- if (this.ogv.type == null) {
- throw new IllegalArgumentException("Must provide geospatial type");
- }
-
- if (this.ogv.tree != null) {
- this.ogv.value = this.ogv.parseTree(this.ogv.tree, this.ogv.type);
- }
- if (this.ogv.value != null) {
- this.ogv.tree = this.ogv.parseGeospatial((Geospatial) this.ogv.value);
- }
-
- return this.ogv;
- }
- }
-
- /**
- * DOM tree.
- */
- private Element tree;
-
- /**
- * Protected constructor, need to use the builder to instantiate this class.
- *
- * @see Builder
- */
- protected ODataGeospatialValue(final ODataClient client) {
- super(client);
- }
-
- private Geospatial.Dimension getDimension() {
- Geospatial.Dimension dimension;
-
- switch (this.type) {
- case Geography:
- case GeographyCollection:
- case GeographyLineString:
- case GeographyMultiLineString:
- case GeographyPoint:
- case GeographyMultiPoint:
- case GeographyPolygon:
- case GeographyMultiPolygon:
- dimension = Geospatial.Dimension.GEOGRAPHY;
- break;
-
- default:
- dimension = Geospatial.Dimension.GEOMETRY;
- }
-
- return dimension;
- }
-
- private List<Point> parsePoints(final NodeList posList) {
- final List<Point> result = new ArrayList<Point>();
- for (int i = 0; i < posList.getLength(); i++) {
- final String[] pointInfo = posList.item(i).getTextContent().split(" ");
- final Point point = new Point(getDimension());
- point.setX(Double.valueOf(pointInfo[0]));
- point.setY(Double.valueOf(pointInfo[1]));
-
- result.add(point);
- }
- return result;
- }
-
- private LineString parseLineString(final Element element) {
- return new LineString(getDimension(),
- parsePoints(element.getElementsByTagName(ODataConstants.ELEM_POS)));
- }
-
- private Polygon parsePolygon(final Element element) {
- List<Point> extPoints = null;
- final Element exterior =
- (Element) element.getElementsByTagName(ODataConstants.ELEM_POLYGON_EXTERIOR).item(0);
- if (exterior != null) {
- extPoints = parsePoints(
- ((Element) exterior.getElementsByTagName(ODataConstants.ELEM_POLYGON_LINEARRING).item(0)).
- getElementsByTagName(ODataConstants.ELEM_POS));
- }
- List<Point> intPoints = null;
- final Element interior =
- (Element) element.getElementsByTagName(ODataConstants.ELEM_POLYGON_INTERIOR).item(0);
- if (interior != null) {
- intPoints = parsePoints(
- ((Element) interior.getElementsByTagName(ODataConstants.ELEM_POLYGON_LINEARRING).item(0)).
- getElementsByTagName(ODataConstants.ELEM_POS));
- }
-
- return new Polygon(getDimension(), intPoints, extPoints);
- }
-
- /**
- * Parses given tree as geospatial value.
- */
- private Geospatial parseTree(final Element tree, final EdmSimpleType type) {
- Geospatial value;
-
- switch (type) {
- case GeographyPoint:
- case GeometryPoint:
- value = parsePoints(tree.getElementsByTagName(ODataConstants.ELEM_POS)).get(0);
- break;
-
- case GeographyMultiPoint:
- case GeometryMultiPoint:
- final Element pMembs =
- (Element) tree.getElementsByTagName(ODataConstants.ELEM_POINTMEMBERS).item(0);
- final List<Point> points = pMembs == null
- ? Collections.<Point>emptyList()
- : parsePoints(pMembs.getElementsByTagName(ODataConstants.ELEM_POS));
- value = new MultiPoint(getDimension(), points);
- break;
-
- case GeographyLineString:
- case GeometryLineString:
- value = parseLineString(tree);
- break;
-
- case GeographyMultiLineString:
- case GeometryMultiLineString:
- final Element mlMembs =
- (Element) tree.getElementsByTagName(ODataConstants.ELEM_LINESTRINGMEMBERS).item(0);
- final List<LineString> lineStrings;
- if (mlMembs == null) {
- lineStrings = Collections.<LineString>emptyList();
- } else {
- lineStrings = new ArrayList<LineString>();
- final NodeList lineStringNodes = mlMembs.getElementsByTagName(ODataConstants.ELEM_LINESTRING);
- for (int i = 0; i < lineStringNodes.getLength(); i++) {
- lineStrings.add(parseLineString((Element) lineStringNodes.item(i)));
- }
- }
- value = new MultiLineString(getDimension(), lineStrings);
- break;
-
- case GeographyPolygon:
- case GeometryPolygon:
- value = parsePolygon(tree);
- break;
-
- case GeographyMultiPolygon:
- case GeometryMultiPolygon:
- final Element mpMembs =
- (Element) tree.getElementsByTagName(ODataConstants.ELEM_SURFACEMEMBERS).item(0);
- final List<Polygon> polygons;
- if (mpMembs == null) {
- polygons = Collections.<Polygon>emptyList();
- } else {
- polygons = new ArrayList<Polygon>();
- final NodeList polygonNodes = mpMembs.getElementsByTagName(ODataConstants.ELEM_POLYGON);
- for (int i = 0; i < polygonNodes.getLength(); i++) {
- polygons.add(parsePolygon((Element) polygonNodes.item(i)));
- }
- }
- value = new MultiPolygon(getDimension(), polygons);
- break;
-
- case GeographyCollection:
- case GeometryCollection:
- final Element cMembs =
- (Element) tree.getElementsByTagName(ODataConstants.ELEM_GEOMEMBERS).item(0);
- final List<Geospatial> geospatials;
- if (cMembs == null) {
- geospatials = Collections.<Geospatial>emptyList();
- } else {
- geospatials = new ArrayList<Geospatial>();
- for (Node geom : XMLUtils.getChildNodes(cMembs, Node.ELEMENT_NODE)) {
- geospatials.add(
- parseTree((Element) geom, XMLUtils.simpleTypeForNode(getDimension(), geom)));
- }
- }
- value = new GeospatialCollection(getDimension(), geospatials);
- break;
-
- default:
- value = null;
- }
-
- return value;
- }
-
- private void parsePoints(final Element parent, final Iterator<Point> itor, final boolean wrap) {
- while (itor.hasNext()) {
- final Point point = itor.next();
-
- final Element pos = parent.getOwnerDocument().
- createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_POS);
- pos.appendChild(parent.getOwnerDocument().createTextNode(
- Double.toString(point.getX()) + " " + point.getY()));
-
- final Element appendable;
- if (wrap) {
- final Element epoint = parent.getOwnerDocument().
- createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_POINT);
- parent.appendChild(epoint);
- appendable = epoint;
- } else {
- appendable = parent;
- }
- appendable.appendChild(pos);
- }
- }
-
- private void parseLineStrings(final Element parent, final Iterator<LineString> itor, final boolean wrap) {
- while (itor.hasNext()) {
- final LineString lineString = itor.next();
-
- final Element appendable;
- if (wrap) {
- final Element eLineString = parent.getOwnerDocument().
- createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_LINESTRING);
- parent.appendChild(eLineString);
- appendable = eLineString;
- } else {
- appendable = parent;
- }
- parsePoints(appendable, lineString.iterator(), false);
- }
- }
-
- private void parsePolygons(final Element parent, final Iterator<Polygon> itor, final boolean wrap) {
- while (itor.hasNext()) {
- final Polygon polygon = itor.next();
-
- final Element appendable;
- if (wrap) {
- final Element ePolygon = parent.getOwnerDocument().createElementNS(
- ODataConstants.NS_GML, ODataConstants.ELEM_POLYGON);
- parent.appendChild(ePolygon);
- appendable = ePolygon;
- } else {
- appendable = parent;
- }
-
- if (!polygon.getExterior().isEmpty()) {
- final Element exterior = parent.getOwnerDocument().createElementNS(
- ODataConstants.NS_GML, ODataConstants.ELEM_POLYGON_EXTERIOR);
- appendable.appendChild(exterior);
- final Element linearRing = parent.getOwnerDocument().createElementNS(
- ODataConstants.NS_GML, ODataConstants.ELEM_POLYGON_LINEARRING);
- exterior.appendChild(linearRing);
-
- parsePoints(linearRing, polygon.getExterior().iterator(), false);
- }
- if (!polygon.getInterior().isEmpty()) {
- final Element interior = parent.getOwnerDocument().createElementNS(
- ODataConstants.NS_GML, ODataConstants.ELEM_POLYGON_INTERIOR);
- appendable.appendChild(interior);
- final Element linearRing = parent.getOwnerDocument().createElementNS(
- ODataConstants.NS_GML, ODataConstants.ELEM_POLYGON_LINEARRING);
- interior.appendChild(linearRing);
-
- parsePoints(linearRing, polygon.getInterior().iterator(), false);
- }
- }
- }
-
- private Element parseGeospatial(final Geospatial value) {
- final DocumentBuilder builder;
- try {
- builder = XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder();
- } catch (ParserConfigurationException e) {
- throw new IllegalStateException("Failure initializing Geospatial DOM tree", e);
- }
- final Document doc = builder.newDocument();
-
- final Element tree;
-
- switch (value.getEdmSimpleType()) {
- case GeographyPoint:
- case GeometryPoint:
- tree = doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_POINT);
-
- parsePoints(tree, Collections.singleton((Point) value).iterator(), false);
- break;
-
- case GeometryMultiPoint:
- case GeographyMultiPoint:
- tree = doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_MULTIPOINT);
-
- final Element pMembs = doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_POINTMEMBERS);
- tree.appendChild(pMembs);
-
- parsePoints(pMembs, ((MultiPoint) value).iterator(), true);
- break;
-
- case GeometryLineString:
- case GeographyLineString:
- tree = doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_LINESTRING);
-
- parseLineStrings(tree, Collections.singleton((LineString) value).iterator(), false);
- break;
-
- case GeometryMultiLineString:
- case GeographyMultiLineString:
- tree = doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_MULTILINESTRING);
-
- final Element mlMembs =
- doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_LINESTRINGMEMBERS);
- tree.appendChild(mlMembs);
-
- parseLineStrings(mlMembs, ((MultiLineString) value).iterator(), true);
- break;
-
- case GeographyPolygon:
- case GeometryPolygon:
- tree = doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_POLYGON);
- parsePolygons(tree, Collections.singleton(((Polygon) value)).iterator(), false);
- break;
-
- case GeographyMultiPolygon:
- case GeometryMultiPolygon:
- tree = doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_MULTIPOLYGON);
-
- final Element mpMembs =
- doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_SURFACEMEMBERS);
- tree.appendChild(mpMembs);
-
- parsePolygons(mpMembs, ((MultiPolygon) value).iterator(), true);
- break;
-
- case GeographyCollection:
- case GeometryCollection:
- tree = doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_GEOCOLLECTION);
-
- final Element gMembs =
- doc.createElementNS(ODataConstants.NS_GML, ODataConstants.ELEM_GEOMEMBERS);
- tree.appendChild(gMembs);
-
- final Iterator<Geospatial> itor = ((GeospatialCollection) value).iterator();
- while (itor.hasNext()) {
- final Geospatial geospatial = itor.next();
- gMembs.appendChild(doc.importNode(parseGeospatial(geospatial), true));
- }
- break;
-
- default:
- tree = null;
- }
-
- return tree;
- }
-
- public Element toTree() {
- return this.tree;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final ODataGeospatialValue other = (ODataGeospatialValue) obj;
- return this.tree.isEqualNode(other.tree);
- }
-
- @Override
- public String toString() {
- final StringWriter writer = new StringWriter();
- client.getSerializer().dom(this.tree, writer);
- return writer.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInlineEntity.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInlineEntity.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInlineEntity.java
deleted file mode 100644
index a4f724f..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInlineEntity.java
+++ /dev/null
@@ -1,72 +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;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import java.net.URI;
-
-/**
- * OData in-line entity.
- */
-public class ODataInlineEntity extends ODataLink {
-
- private static final long serialVersionUID = -4763341581843700743L;
-
- private final ODataEntity entity;
-
- /**
- * Constructor.
- *
- * @param uri edit link.
- * @param type type.
- * @param title title.
- * @param entity entity.
- */
- ODataInlineEntity(final ODataClient client,
- final URI uri, final ODataLinkType type, final String title, final ODataEntity entity) {
-
- super(client, uri, type, title);
- this.entity = entity;
- }
-
- /**
- * Constructor.
- *
- * @param baseURI base URI.
- * @param href href.
- * @param type type.
- * @param title title.
- * @param entity entity.
- */
- ODataInlineEntity(final ODataClient client, final URI baseURI, final String href, final ODataLinkType type,
- final String title, final ODataEntity entity) {
-
- super(client, baseURI, href, type, title);
- this.entity = entity;
- }
-
- /**
- * Gets wrapped entity.
- *
- * @return wrapped entity.
- */
- public ODataEntity getEntity() {
- return entity;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInlineEntitySet.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInlineEntitySet.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInlineEntitySet.java
deleted file mode 100644
index cd0cffa..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInlineEntitySet.java
+++ /dev/null
@@ -1,74 +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;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import java.net.URI;
-
-/**
- * OData in-line entity set.
- */
-public class ODataInlineEntitySet extends ODataLink {
-
- private static final long serialVersionUID = -77628001615355449L;
-
- private ODataEntitySet entitySet;
-
- /**
- * Constructor.
- *
- * @param client OData client.
- * @param uri edit link.
- * @param type type.
- * @param title title.
- * @param entitySet entity set.
- */
- ODataInlineEntitySet(final ODataClient client, final URI uri, final ODataLinkType type, final String title,
- final ODataEntitySet entitySet) {
-
- super(client, uri, type, title);
- this.entitySet = entitySet;
- }
-
- /**
- * Constructor.
- *
- * @param client OData client.
- * @param baseURI base URI.
- * @param href href.
- * @param type type.
- * @param title title.
- * @param entitySet entity set.
- */
- ODataInlineEntitySet(final ODataClient client, final URI baseURI, final String href, final ODataLinkType type,
- final String title, final ODataEntitySet entitySet) {
-
- super(client, baseURI, href, type, title);
- this.entitySet = entitySet;
- }
-
- /**
- * Gets wrapped entity set.
- *
- * @return wrapped entity set.
- */
- public ODataEntitySet getEntitySet() {
- return entitySet;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInvokeResult.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInvokeResult.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInvokeResult.java
deleted file mode 100644
index bb8cb7d..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataInvokeResult.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;
-
-/**
- * Marker interface for any OData domain object that can be returned by an operation invocation.
- *
- * @see ODataEntitySet
- * @see ODataEntity
- * @see ODataProperty
- * @see ODataNoContent
- */
-public interface ODataInvokeResult {
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataItem.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataItem.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataItem.java
deleted file mode 100644
index 4260077..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataItem.java
+++ /dev/null
@@ -1,111 +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;
-
-import java.io.Serializable;
-import java.net.URI;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Abstract representation of OData entities and links.
- */
-public abstract class ODataItem implements Serializable {
-
- private static final long serialVersionUID = -2600707722689304686L;
-
- /**
- * Logger.
- */
- protected static final Logger LOG = LoggerFactory.getLogger(ODataItem.class);
-
- /**
- * OData item self link.
- */
- protected URI link;
-
- /**
- * OData entity name/type.
- */
- private final String name;
-
- /**
- * Constructor.
- *
- * @param name OData entity name.
- */
- public ODataItem(final String name) {
- this.name = name;
- }
-
- /**
- * Returns self link.
- *
- * @return entity edit link.
- */
- public URI getLink() {
- return link;
- }
-
- /**
- * Sets self link.
- *
- * @param link link.
- */
- public void setLink(final URI link) {
- this.link = link;
- }
-
- /**
- * Returns OData entity name.
- *
- * @return entity name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public boolean equals(final Object obj) {
- return EqualsBuilder.reflectionEquals(this, obj);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public String toString() {
- return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLink.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLink.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLink.java
deleted file mode 100644
index 81e9e18..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLink.java
+++ /dev/null
@@ -1,109 +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;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.utils.ODataVersion;
-import com.msopentech.odatajclient.engine.utils.URIUtils;
-import java.net.URI;
-
-/**
- * OData link.
- */
-public class ODataLink extends ODataItem {
-
- private static final long serialVersionUID = 7274966414277952124L;
-
- protected final ODataClient client;
-
- /**
- * Link type.
- */
- protected final ODataLinkType type;
-
- /**
- * Link rel.
- */
- protected final String rel;
-
- /**
- * Constructor.
- *
- * @param client OData client.
- * @param uri URI.
- * @param type type.
- * @param title title.
- */
- ODataLink(final ODataClient client, final URI uri, final ODataLinkType type, final String title) {
- super(title);
- this.client = client;
- this.link = uri;
-
- this.type = type;
-
- switch (this.type) {
- case ASSOCIATION:
- this.rel = client.getWorkingVersion().getNamespaceMap().get(ODataVersion.ASSOCIATION_LINK_REL) + title;
- break;
-
- case ENTITY_NAVIGATION:
- case ENTITY_SET_NAVIGATION:
- this.rel = client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NAVIGATION_LINK_REL) + title;
- break;
-
- case MEDIA_EDIT:
- default:
- this.rel = client.getWorkingVersion().getNamespaceMap().get(ODataVersion.MEDIA_EDIT_LINK_REL) + title;
- break;
- }
- }
-
- /**
- * Constructor.
- *
- * @param client OData client.
- * @param baseURI base URI.
- * @param href href.
- * @param type type.
- * @param title title.
- */
- ODataLink(
- final ODataClient client, final URI baseURI, final String href, final ODataLinkType type, final String title) {
-
- this(client, URIUtils.getURI(baseURI, href), type, title);
- }
-
- /**
- * Gets link type.
- *
- * @return link type;
- */
- public ODataLinkType getType() {
- return type;
- }
-
- /**
- * Gets link rel.
- *
- * @return link rel
- */
- public String getRel() {
- return rel;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLinkCollection.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLinkCollection.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLinkCollection.java
deleted file mode 100644
index 025d447..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLinkCollection.java
+++ /dev/null
@@ -1,100 +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;
-
-import java.net.URI;
-import java.util.List;
-
-/**
- * Link collection wrapper.
- */
-public class ODataLinkCollection {
-
- /**
- * Link to the next page.
- */
- private URI next;
-
- /**
- * Contained links.
- */
- private List<URI> links;
-
- /**
- * Constructor.
- */
- public ODataLinkCollection() {
- }
-
- /**
- * Adds link to the collection.
- *
- * @param link link to be added.
- * @return 'TRUE' in case of success; 'FALSE' otherwise.
- */
- public boolean addLink(final URI link) {
- return links.add(link);
- }
-
- /**
- * Removes a link.
- *
- * @param link link to be removed.
- * @return 'TRUE' in case of success; 'FALSE' otherwise.
- */
- public boolean removeLink(final URI link) {
- return links.remove(link);
- }
-
- /**
- * Set links.
- *
- * @param links links.
- */
- public void setLinks(final List<URI> links) {
- this.links = links;
- }
-
- /**
- * Gets contained links.
- *
- * @return list of links.
- */
- public List<URI> getLinks() {
- return links;
- }
-
- /**
- * Constructor.
- *
- * @param next next page link.
- */
- public ODataLinkCollection(final URI next) {
- this.next = next;
- }
-
- /**
- * Gets next page link.
- *
- * @return next page link; null value if single page or last page reached.
- */
- 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/ODataLinkType.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLinkType.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLinkType.java
deleted file mode 100644
index 3b8ba50..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataLinkType.java
+++ /dev/null
@@ -1,98 +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;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.format.ODataPubFormat;
-import com.msopentech.odatajclient.engine.utils.ODataVersion;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.entity.ContentType;
-
-/**
- * OData link types.
- */
-public enum ODataLinkType {
-
- /**
- * Entity navigation link.
- */
- ENTITY_NAVIGATION(ODataPubFormat.ATOM + ";type=entry"),
- /**
- * Entity set navigation link.
- */
- ENTITY_SET_NAVIGATION(ODataPubFormat.ATOM + ";type=feed"),
- /**
- * Association link.
- */
- ASSOCIATION(ContentType.APPLICATION_XML.getMimeType()),
- /**
- * Media-edit link.
- */
- MEDIA_EDIT("*/*");
-
- private String type;
-
- private ODataLinkType(final String type) {
- this.type = type;
- }
-
- private ODataLinkType setType(final String type) {
- this.type = type;
- return this;
- }
-
- /**
- * Gets
- * <code>ODataLinkType</code> instance from the given rel and type.
- *
- * @param client OData client.
- * @param rel rel.
- * @param type type.
- * @return <code>ODataLinkType</code> object.
- */
- public static ODataLinkType fromString(final ODataClient client, final String rel, final String type) {
- if (StringUtils.isNotBlank(rel)
- && rel.startsWith(client.getWorkingVersion().getNamespaceMap().get(ODataVersion.MEDIA_EDIT_LINK_REL))) {
-
- return MEDIA_EDIT.setType(StringUtils.isBlank(type) ? "*/*" : type);
- }
-
- if (ODataLinkType.ENTITY_NAVIGATION.type.equals(type)) {
- return ENTITY_NAVIGATION;
- }
-
- if (ODataLinkType.ENTITY_SET_NAVIGATION.type.equals(type)) {
- return ENTITY_SET_NAVIGATION;
- }
-
- if (ODataLinkType.ASSOCIATION.type.equals(type)) {
- return ASSOCIATION;
- }
-
- throw new IllegalArgumentException("Invalid link type: " + type);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public String toString() {
- return type;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataNoContent.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataNoContent.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataNoContent.java
deleted file mode 100644
index 09401e8..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataNoContent.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;
-
-import java.io.Serializable;
-
-/**
- * Marker class for invoke with no return type.
- */
-public class ODataNoContent implements Serializable, ODataInvokeResult {
-
- private static final long serialVersionUID = 2780193571934253136L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataObjectFactory.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataObjectFactory.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataObjectFactory.java
deleted file mode 100644
index a61b8b4..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataObjectFactory.java
+++ /dev/null
@@ -1,210 +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;
-
-import java.io.Serializable;
-import java.net.URI;
-
-/**
- * Entry point for generating OData domain objects.
- *
- * @see ODataEntitySet
- * @see ODataEntity
- * @see ODataProperty
- * @see ODataLink
- */
-public interface ODataObjectFactory extends Serializable {
-
- /**
- * Instantiates a new entity set.
- *
- * @return entity set.
- */
- ODataEntitySet newEntitySet();
-
- /**
- * Instantiates a new entity set.
- *
- * @param next next link.
- * @return entity set.
- */
- ODataEntitySet newEntitySet(URI next);
-
- /**
- * Instantiates a new entity.
- *
- * @param name OData entity name.
- * @return entity.
- */
- ODataEntity newEntity(String name);
-
- /**
- * Instantiates a new entity.
- *
- * @param name OData entity name.
- * @param link self link.
- * @return entity.
- */
- ODataEntity newEntity(String name, URI link);
-
- /**
- * Instantiates a new in-line entity set.
- *
- * @param name name.
- * @param link edit link.
- * @param entitySet entity set.
- * @return in-line entity set.
- */
- ODataInlineEntitySet newInlineEntitySet(String name, URI link, ODataEntitySet entitySet);
-
- /**
- * Instantiates a new in-line entity set.
- *
- * @param name name.
- * @param baseURI base URI.
- * @param href href.
- * @param entitySet entity set.
- * @return in-line entity set.
- */
- ODataInlineEntitySet newInlineEntitySet(String name, URI baseURI, String href, ODataEntitySet entitySet);
-
- /**
- * Instantiates a new in-line entity.
- *
- * @param name name.
- * @param link edit link.
- * @param entity entity.
- * @return in-line entity.
- */
- ODataInlineEntity newInlineEntity(String name, URI link, ODataEntity entity);
-
- /**
- * Instantiates a new in-line entity.
- *
- * @param name name.
- * @param baseURI base URI.
- * @param href href.
- * @param entity entity.
- * @return in-line entity.
- */
- ODataInlineEntity newInlineEntity(String name, URI baseURI, String href, ODataEntity entity);
-
- /**
- * Instantiates a new entity navigation link.
- *
- * @param name name.
- * @param link link.
- * @return entity navigation link.
- */
- ODataLink newEntityNavigationLink(String name, URI link);
-
- /**
- * Instantiates a new entity navigation link.
- *
- * @param name name.
- * @param baseURI base URI.
- * @param href href.
- * @return entity navigation link.
- */
- ODataLink newEntityNavigationLink(String name, URI baseURI, String href);
-
- /**
- * Instantiates a new entity set navigation link.
- *
- * @param name name.
- * @param link link.
- * @return entity set navigation link.
- */
- ODataLink newFeedNavigationLink(String name, URI link);
-
- /**
- * Instantiates a new entity set navigation link.
- *
- * @param name name.
- * @param baseURI base URI.
- * @param href href.
- * @return entity set navigation link.
- */
- ODataLink newFeedNavigationLink(String name, URI baseURI, String href);
-
- /**
- * Instantiates a new association link.
- *
- * @param name name.
- * @param link link.
- * @return association link.
- */
- ODataLink newAssociationLink(String name, URI link);
-
- /**
- * Instantiates a new association link.
- *
- * @param name name.
- * @param baseURI base URI.
- * @param href href.
- * @return association link.
- */
- ODataLink newAssociationLink(String name, URI baseURI, String href);
-
- /**
- * Instantiates a new media-edit link.
- *
- * @param name name.
- * @param link link.
- * @return media-edit link.
- */
- ODataLink newMediaEditLink(String name, URI link);
-
- /**
- * Instantiates a new media-edit link.
- *
- * @param name name.
- * @param baseURI base URI.
- * @param href href.
- * @return media-edit link.
- */
- ODataLink newMediaEditLink(String name, URI baseURI, String href);
-
- /**
- * Instantiates a new primitive property.
- *
- * @param name name.
- * @param value value.
- * @return primitive property.
- */
- ODataProperty newPrimitiveProperty(String name, ODataPrimitiveValue value);
-
- /**
- * Instantiates a new complex property.
- *
- * @param name name.
- * @param value value.
- * @return complex property.
- */
- ODataProperty newComplexProperty(String name, ODataComplexValue value);
-
- /**
- * Instantiates a new collection property.
- *
- * @param name name.
- * @param value value.
- * @return collection property.
- */
- ODataProperty newCollectionProperty(String name, ODataCollectionValue value);
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataObjectWrapper.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataObjectWrapper.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataObjectWrapper.java
deleted file mode 100644
index d4c00d7..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataObjectWrapper.java
+++ /dev/null
@@ -1,141 +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;
-
-import com.msopentech.odatajclient.engine.metadata.AbstractEdmMetadata;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import org.apache.commons.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ODataObjectWrapper {
-
- /**
- * Logger.
- */
- protected static final Logger LOG = LoggerFactory.getLogger(ODataObjectWrapper.class);
-
- private final ODataReader reader;
-
- private final byte[] obj;
-
- private final String format;
-
- /**
- * Constructor.
- *
- * @param is source input stream.
- * @param format source format (<tt>ODataPubFormat</tt>, <tt>ODataFormat</tt>, <tt>ODataValueFormat</tt>,
- * <tt>ODataServiceDocumentFormat</tt>).
- */
- public ODataObjectWrapper(final ODataReader reader, final InputStream is, final String format) {
- this.reader = reader;
- try {
- this.obj = IOUtils.toByteArray(is);
- this.format = format;
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- /**
- * Parses stream as <tt>ODataEntitySetIterator</tt>.
- *
- * I
- *
- * @return <tt>ODataEntitySetIterator</tt> if success; null otherwise.
- */
- public ODataEntitySetIterator getODataEntitySetIterator() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataEntitySetIterator.class);
- }
-
- /**
- * Parses stream as <tt>ODataEntitySet</tt>.
- *
- * @return <tt>ODataEntitySet</tt> if success; null otherwise.
- */
- public ODataEntitySet getODataEntitySet() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataEntitySet.class);
- }
-
- /**
- * Parses stream as <tt>ODataEntity</tt>.
- *
- * @return <tt>ODataEntity</tt> if success; null otherwise.
- */
- public ODataEntity getODataEntity() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataEntity.class);
- }
-
- /**
- * Parses stream as <tt>ODataProperty</tt>.
- *
- * @return <tt>ODataProperty</tt> if success; null otherwise.
- */
- public ODataProperty getODataProperty() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataProperty.class);
- }
-
- /**
- * Parses stream as <tt>ODataLinkCollection</tt>.
- *
- * @return <tt>ODataLinkCollection</tt> if success; null otherwise.
- */
- public ODataLinkCollection getODataLinkCollection() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataLinkCollection.class);
- }
-
- /**
- * Parses stream as <tt>ODataValue</tt>.
- *
- * @return <tt>ODataValue</tt> if success; null otherwise.
- */
- public ODataValue getODataValue() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataValue.class);
- }
-
- /**
- * Parses stream as <tt>EdmMetadata</tt>.
- *
- * @return <tt>EdmMetadata</tt> if success; null otherwise.
- */
- public AbstractEdmMetadata getEdmMetadata() {
- return reader.read(new ByteArrayInputStream(obj), null, AbstractEdmMetadata.class);
- }
-
- /**
- * Parses stream as <tt>ODataServiceDocument</tt>.
- *
- * @return <tt>ODataServiceDocument</tt> if success; null otherwise.
- */
- public ODataServiceDocument getODataServiceDocument() {
- return reader.read(new ByteArrayInputStream(obj), format, ODataServiceDocument.class);
- }
-
- /**
- * Parses stream as <tt>ODataError</tt>.
- *
- * @return <tt>ODataError</tt> if success; null otherwise.
- */
- public ODataError getODataError() {
- return reader.read(new ByteArrayInputStream(obj), null, ODataError.class);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataOperation.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataOperation.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataOperation.java
deleted file mode 100644
index 3e97d1e..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataOperation.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;
-
-import java.io.Serializable;
-import java.net.URI;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-
-/**
- * Representation of an OData operation (legacy, action or function).
- */
-public class ODataOperation implements Serializable {
-
- private static final long serialVersionUID = -5784652334334645128L;
-
- private String metadataAnchor;
-
- private String title;
-
- private URI target;
-
- /**
- * Gets metadata anchor.
- *
- * @return metadata anchor.
- */
- public String getMetadataAnchor() {
- return metadataAnchor;
- }
-
- /**
- * Sets metadata anchor.
- *
- * @param metadataAnchor metadata anchor.
- */
- public void setMetadataAnchor(final String metadataAnchor) {
- this.metadataAnchor = metadataAnchor;
- }
-
- /**
- * Gets title.
- *
- * @return title.
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * Sets title.
- *
- * @param title title.
- */
- public void setTitle(final String title) {
- this.title = title;
- }
-
- /**
- * Gets target.
- *
- * @return target.
- */
- public URI getTarget() {
- return target;
- }
-
- /**
- * Sets target.
- *
- * @param target target.
- */
- public void setTarget(final URI target) {
- this.target = target;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public boolean equals(final Object obj) {
- return EqualsBuilder.reflectionEquals(this, obj);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public String toString() {
- return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataPrimitiveValue.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataPrimitiveValue.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataPrimitiveValue.java
deleted file mode 100644
index ff6ed5e..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataPrimitiveValue.java
+++ /dev/null
@@ -1,373 +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;
-
-import com.msopentech.odatajclient.engine.client.ODataClient;
-import com.msopentech.odatajclient.engine.metadata.edm.EdmSimpleType;
-import java.math.BigDecimal;
-import java.net.URI;
-import java.sql.Timestamp;
-import java.text.DecimalFormat;
-import java.util.Date;
-import java.util.UUID;
-import javax.xml.datatype.Duration;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * OData primitive property value.
- */
-public class ODataPrimitiveValue extends ODataValue {
-
- private static final long serialVersionUID = 2841837627899878223L;
-
- protected abstract static class AbstractBuilder {
-
- private final ODataClient client;
-
- /**
- * Constructor.
- */
- public AbstractBuilder(final ODataClient client) {
- this.client = client;
- }
-
- public AbstractBuilder isSupported(final EdmSimpleType type) {
- if (type != null && !ArrayUtils.contains(type.getSupportedVersions(), client.getWorkingVersion())) {
- throw new IllegalArgumentException(String.format(
- "Type %s not supported by the current OData working version", type.toString()));
- }
-
- return this;
- }
- }
-
- /**
- * Primitive value builder.
- */
- public static class Builder extends AbstractBuilder {
-
- private final ODataPrimitiveValue opv;
-
- /**
- * Constructor.
- */
- public Builder(final ODataClient client) {
- super(client);
- this.opv = new ODataPrimitiveValue(client);
- }
-
- /**
- * Sets the given value provided as a text.
- *
- * @param text value.
- * @return the current builder.
- */
- public Builder setText(final String text) {
- this.opv.text = text;
- return this;
- }
-
- /**
- * Sets the actual object value.
- *
- * @param value value.
- * @return the current builder.
- */
- public Builder setValue(final Object value) {
- this.opv.value = value;
- return this;
- }
-
- /**
- * Sets actual value type.
- *
- * @param type type.
- * @return the current builder.
- */
- public Builder setType(final EdmSimpleType type) {
- isSupported(type);
-
- if (type == EdmSimpleType.Stream) {
- throw new IllegalArgumentException(String.format(
- "Cannot build a primitive value for %s", EdmSimpleType.Stream.toString()));
- }
-
- this.opv.type = type;
- return this;
- }
-
- /**
- * Builds the primitive value.
- *
- * @return <code>ODataPrimitiveValue</code> object.
- */
- public ODataPrimitiveValue build() {
- if (this.opv.text == null && this.opv.value == null) {
- throw new IllegalArgumentException("Must provide either text or value");
- }
- if (this.opv.text != null && this.opv.value != null) {
- throw new IllegalArgumentException("Cannot provide both text and value");
- }
-
- if (this.opv.type == null) {
- this.opv.type = EdmSimpleType.String;
- }
-
- if (this.opv.type.isGeospatial()) {
- throw new IllegalArgumentException(
- "Use " + ODataGeospatialValue.class.getSimpleName() + " for geospatial types");
- }
-
- if (this.opv.value instanceof Timestamp) {
- this.opv.value = ODataTimestamp.getInstance(this.opv.type, (Timestamp) this.opv.value);
- } else if (this.opv.value instanceof Date) {
- this.opv.value = ODataTimestamp.getInstance(this.opv.type,
- new Timestamp(((Date) this.opv.value).getTime()));
- }
- if (this.opv.value instanceof Duration) {
- this.opv.value = new ODataDuration((Duration) this.opv.value);
- }
-
- if (this.opv.value != null && !this.opv.type.javaType().isAssignableFrom(this.opv.value.getClass())) {
- throw new IllegalArgumentException("Provided value is not compatible with " + this.opv.type.toString());
- }
-
- if (this.opv.text != null) {
- this.opv.parseText();
- }
- if (this.opv.value != null) {
- this.opv.formatValue();
- }
-
- return this.opv;
- }
- }
-
- protected ODataClient client;
-
- /**
- * Text value.
- */
- private String text;
-
- /**
- * Actual value.
- */
- protected Object value;
-
- /**
- * Value type.
- */
- protected EdmSimpleType type;
-
- /**
- * Protected constructor, need to use the builder to instantiate this class.
- *
- * @see Builder
- */
- protected ODataPrimitiveValue(final ODataClient client) {
- super();
- this.client = client;
- }
-
- /**
- * Parses given text as object value.
- */
- private void parseText() {
- switch (this.type) {
- case Null:
- this.value = null;
- break;
-
- case Binary:
- this.value = Base64.decodeBase64(this.toString());
- break;
-
- case SByte:
- this.value = Byte.parseByte(this.toString());
- break;
-
- case Boolean:
- this.value = Boolean.parseBoolean(this.toString());
- break;
-
- case Date:
- case DateTime:
- case DateTimeOffset:
- this.value = ODataTimestamp.parse(this.type, this.toString());
- break;
-
- case Time:
- case TimeOfDay:
- this.value = new ODataDuration(this.toString());
- break;
-
- case Decimal:
- this.value = new BigDecimal(this.toString());
- break;
-
- case Single:
- this.value = Float.parseFloat(this.toString());
- break;
-
- case Double:
- this.value = Double.parseDouble(this.toString());
- break;
-
- case Guid:
- this.value = UUID.fromString(this.toString());
- break;
-
- case Int16:
- this.value = Short.parseShort(this.toString());
- break;
-
- case Byte:
- case Int32:
- this.value = Integer.parseInt(this.toString());
- break;
-
- case Int64:
- this.value = Long.parseLong(this.toString());
- break;
-
- case Stream:
- this.value = URI.create(this.toString());
- break;
-
- case String:
- this.value = this.toString();
- break;
-
- default:
- }
- }
-
- /**
- * Format given value as text.
- */
- private void formatValue() {
- switch (this.type) {
- case Null:
- this.text = StringUtils.EMPTY;
- break;
-
- case Binary:
- this.text = Base64.encodeBase64String(this.<byte[]>toCastValue());
- break;
-
- case SByte:
- this.text = this.<Byte>toCastValue().toString();
- break;
-
- case Boolean:
- this.text = this.<Boolean>toCastValue().toString();
- break;
-
- case Date:
- case DateTime:
- case DateTimeOffset:
- this.text = this.<ODataTimestamp>toCastValue().toString();
- break;
-
- case Time:
- case TimeOfDay:
- this.text = this.<ODataDuration>toCastValue().toString();
- break;
-
- case Decimal:
- this.text = new DecimalFormat(this.type.pattern()).format(this.<BigDecimal>toCastValue());
- break;
-
- case Single:
- this.text = new DecimalFormat(this.type.pattern()).format(this.<Float>toCastValue());
- break;
-
- case Double:
- this.text = new DecimalFormat(this.type.pattern()).format(this.<Double>toCastValue());
- break;
-
- case Guid:
- this.text = this.<UUID>toCastValue().toString();
- break;
-
- case Int16:
- this.text = this.<Short>toCastValue().toString();
- break;
-
- case Byte:
- case Int32:
- this.text = this.<Integer>toCastValue().toString();
- break;
-
- case Int64:
- this.text = this.<Long>toCastValue().toString();
- break;
-
- case Stream:
- this.text = this.<URI>toCastValue().toASCIIString();
- break;
-
- case String:
- this.text = this.<String>toCastValue();
- break;
-
- default:
- }
- }
-
- /**
- * Gets type name.
- *
- * @return type name.
- */
- public String getTypeName() {
- return type.toString();
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public String toString() {
- return this.text;
- }
-
- /**
- * Gets actual primitive value.
- *
- * @return
- */
- public Object toValue() {
- return this.value;
- }
-
- /**
- * Casts primitive value.
- *
- * @param <T> cast.
- * @return casted value.
- */
- @SuppressWarnings("unchecked")
- public <T> T toCastValue() {
- return (T) type.javaType().cast(toValue());
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataProperty.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataProperty.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataProperty.java
deleted file mode 100644
index abb0776..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataProperty.java
+++ /dev/null
@@ -1,192 +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;
-
-import java.io.Serializable;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-
-/**
- * OData entity property.
- */
-public class ODataProperty implements Serializable, ODataInvokeResult {
-
- /**
- * Property type.
- */
- public enum PropertyType {
-
- /**
- * Primitive.
- */
- PRIMITIVE,
- /**
- * Collection
- */
- COLLECTION,
- /**
- * Complex.
- */
- COMPLEX,
- /**
- * Empty type (possibly, no type information could be retrieved).
- */
- EMPTY
-
- }
-
- private static final long serialVersionUID = 926939448778950450L;
-
- /**
- * Property name.
- */
- private final String name;
-
- /**
- * Property value.
- */
- private ODataValue value;
-
- /**
- * Constructor.
- *
- * @param name property name.
- * @param value property value.
- */
- ODataProperty(final String name, final ODataValue value) {
- this.name = name;
- this.value = value;
- }
-
- /**
- * Returns property name.
- *
- * @return property name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Returns property value.
- *
- * @return property value.
- */
- public ODataValue getValue() {
- return value;
- }
-
- /**
- * Updates property value.
- *
- * @param value property value that replaces current.
- */
- public void setValue(final ODataValue value) {
- this.value = value;
- }
-
- /**
- * Checks if has null value.
- *
- * @return 'TRUE' if has null value; 'FALSE' otherwise.
- */
- public boolean hasNullValue() {
- return this.value == null;
- }
-
- /**
- * Checks if has primitive value.
- *
- * @return 'TRUE' if has primitive value; 'FALSE' otherwise.
- */
- public boolean hasPrimitiveValue() {
- return !hasNullValue() && this.value.isPrimitive();
- }
-
- /**
- * Gets primitive value.
- *
- * @return primitive value if exists; null otherwise.
- */
- public ODataPrimitiveValue getPrimitiveValue() {
- return hasPrimitiveValue() ? this.value.asPrimitive() : null;
- }
-
- /**
- * Checks if has complex value.
- *
- * @return 'TRUE' if has complex value; 'FALSE' otherwise.
- */
- public boolean hasComplexValue() {
- return !hasNullValue() && this.value.isComplex();
- }
-
- /**
- * Gets complex value.
- *
- * @return complex value if exists; null otherwise.
- */
- public ODataComplexValue getComplexValue() {
- return hasComplexValue() ? this.value.asComplex() : null;
- }
-
- /**
- * Checks if has collection value.
- *
- * @return 'TRUE' if has collection value; 'FALSE' otherwise.
- */
- public boolean hasCollectionValue() {
- return !hasNullValue() && this.value.isCollection();
- }
-
- /**
- * Gets collection value.
- *
- * @return collection value if exists; null otherwise.
- */
- public ODataCollectionValue getCollectionValue() {
- return hasCollectionValue() ? this.value.asCollection() : null;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public boolean equals(final Object obj) {
- return EqualsBuilder.reflectionEquals(this, obj);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public String toString() {
- return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataReader.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataReader.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataReader.java
deleted file mode 100644
index 7666858..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataReader.java
+++ /dev/null
@@ -1,108 +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;
-
-import com.msopentech.odatajclient.engine.metadata.AbstractEdmMetadata;
-import com.msopentech.odatajclient.engine.format.ODataPubFormat;
-import com.msopentech.odatajclient.engine.format.ODataFormat;
-import java.io.InputStream;
-import java.io.Serializable;
-
-/**
- * OData reader.
- * <br/>
- * Use this class to de-serialize an OData response body.
- * <br/>
- * This class provides method helpers to de-serialize an entire feed, a set of entities and a single entity as well.
- */
-public interface ODataReader extends Serializable {
-
- /**
- * Parses a stream into metadata representation.
- *
- * @param input stream to de-serialize.
- * @return metadata representation.
- */
- AbstractEdmMetadata<?, ?, ?, ?, ?, ?, ?> readMetadata(InputStream input);
-
- /**
- * Parses an OData service document.
- *
- * @param input stream to de-serialize.
- * @param format de-serialize as XML or JSON
- * @return List of URIs.
- */
- ODataServiceDocument readServiceDocument(InputStream input, ODataFormat format);
-
- /**
- * De-Serializes a stream into an OData entity set.
- *
- * @param input stream to de-serialize.
- * @param format de-serialize as AtomFeed or JSONFeed
- * @return de-serialized entity set.
- */
- ODataEntitySet readEntitySet(InputStream input, ODataPubFormat format);
-
- /**
- * Parses a stream taking care to de-serializes the first OData entity found.
- *
- * @param input stream to de-serialize.
- * @param format de-serialize as AtomEntry or JSONEntry
- * @return entity de-serialized.
- */
- ODataEntity readEntity(InputStream input, ODataPubFormat format);
-
- /**
- * Parses a stream taking care to de-serialize the first OData entity property found.
- *
- * @param input stream to de-serialize.
- * @param format de-serialize as XML or JSON
- * @return OData entity property de-serialized.
- */
- ODataProperty readProperty(InputStream input, ODataFormat format);
-
- /**
- * Parses a $links request response.
- *
- * @param input stream to de-serialize.
- * @param format de-serialize as XML or JSON
- * @return List of URIs.
- */
- ODataLinkCollection readLinks(InputStream input, ODataFormat format);
-
- /**
- * Parses a stream into an OData error.
- *
- * @param inputStream stream to de-serialize.
- * @param isXML 'TRUE' if the error is in XML format.
- * @return OData error.
- */
- ODataError readError(InputStream inputStream, boolean isXML);
-
- /**
- * Parses a stream into the object type specified by the given reference.
- *
- * @param <T> expected object type.
- * @param src input stream.
- * @param format format
- * @param reference reference.
- * @return read object.
- */
- <T> T read(InputStream src, String format, Class<T> reference);
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataSerializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataSerializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataSerializer.java
deleted file mode 100644
index 6aa7e31..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataSerializer.java
+++ /dev/null
@@ -1,120 +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;
-
-import com.msopentech.odatajclient.engine.format.ODataFormat;
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.io.Writer;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Utility class for serialization.
- */
-public interface ODataSerializer extends Serializable {
-
- /**
- * Writes <tt>FeedResource</tt> object onto the given stream.
- *
- * @param <T> feed resource type.
- * @param obj object to be streamed.
- * @param out output stream.
- */
- <T extends Feed> void feed(T obj, OutputStream out);
-
- /**
- * Writes <tt>FeedResource</tt> object by the given writer.
- *
- * @param <T> feed resource type.
- * @param obj object to be streamed.
- * @param writer writer.
- */
- <T extends Feed> void feed(T obj, Writer writer);
-
- /**
- * Writes <tt>EntryResource</tt> object onto the given stream.
- *
- * @param <T> entry resource type.
- * @param obj object to be streamed.
- * @param out output stream.
- */
- <T extends Entry> void entry(T obj, OutputStream out);
-
- /**
- * Writes <tt>EntryResource</tt> object by the given writer.
- *
- * @param <T> entry resource type.
- * @param obj object to be streamed.
- * @param writer writer.
- */
- <T extends Entry> void entry(T obj, Writer writer);
-
- /**
- * Writes entry content onto the given stream.
- *
- * @param element element to be streamed.
- * @param format streaming format.
- * @param out output stream.
- */
- void property(Element element, ODataFormat format, OutputStream out);
-
- /**
- * Writes entry content by the given writer.
- *
- * @param element element to be streamed.
- * @param format streaming format.
- * @param writer writer.
- */
- void property(Element element, ODataFormat format, Writer writer);
-
- /**
- * Writes OData link onto the given stream.
- *
- * @param link OData link to be streamed.
- * @param format streaming format.
- * @param out output stream.
- */
- void link(ODataLink link, ODataFormat format, OutputStream out);
-
- /**
- * Writes OData link by the given writer.
- *
- * @param link OData link to be streamed.
- * @param format streaming format.
- * @param writer writer.
- */
- void link(ODataLink link, ODataFormat format, Writer writer);
-
- /**
- * Writes DOM object onto the given stream.
- *
- * @param content DOM to be streamed.
- * @param out output stream.
- */
- void dom(Node content, OutputStream out);
-
- /**
- * Writes DOM object by the given writer.
- *
- * @param content DOM to be streamed.
- * @param writer writer.
- */
- void dom(Node content, Writer writer);
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/19f3792f/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataServiceDocument.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataServiceDocument.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataServiceDocument.java
deleted file mode 100644
index 2e64e03..0000000
--- a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/data/ODataServiceDocument.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;
-
-import java.net.URI;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ODataServiceDocument {
-
- private URI metadataContext;
-
- private String metadataETag;
-
- private final Map<String, URI> entitySets = new HashMap<String, URI>();
-
- private final Map<String, URI> functionImports = new HashMap<String, URI>();
-
- private final Map<String, URI> singletons = new HashMap<String, URI>();
-
- private final Map<String, URI> relatedServiceDocuments = new HashMap<String, URI>();
-
- public URI getMetadataContext() {
- return metadataContext;
- }
-
- public void setMetadataContext(final URI metadataContext) {
- this.metadataContext = metadataContext;
- }
-
- public String getMetadataETag() {
- return metadataETag;
- }
-
- public void setMetadataETag(final String metadataETag) {
- this.metadataETag = metadataETag;
- }
-
- public Map<String, URI> getEntitySets() {
- return entitySets;
- }
-
- /**
- * Gets entity set titles.
- *
- * @return entity set titles.
- */
- public Collection<String> getEntitySetTitles() {
- return entitySets.keySet();
- }
-
- /**
- * Gets entity set URIs.
- *
- * @return entity set URIs.
- */
- public Collection<URI> getEntitySetURIs() {
- return entitySets.values();
- }
-
- /**
- * Gets URI about the given entity set.
- *
- * @param title title.
- * @return URI.
- */
- public URI getEntitySetURI(final String title) {
- return entitySets.get(title);
- }
-
- public Map<String, URI> getFunctionImports() {
- return functionImports;
- }
-
- /**
- * Gets function import titles.
- *
- * @return function import titles.
- */
- public Collection<String> getFunctionImportTitles() {
- return functionImports.keySet();
- }
-
- /**
- * Gets function import URIs.
- *
- * @return function import URIs.
- */
- public Collection<URI> getFunctionImportURIs() {
- return functionImports.values();
- }
-
- /**
- * Gets URI of the given function import.
- *
- * @param title title.
- * @return URI.
- */
- public URI getFunctionImportURI(final String title) {
- return functionImports.get(title);
- }
-
- public Map<String, URI> getSingletons() {
- return singletons;
- }
-
- /**
- * Gets singleton titles.
- *
- * @return singleton titles.
- */
- public Collection<String> getSingletonTitles() {
- return singletons.keySet();
- }
-
- /**
- * Gets singleton URIs.
- *
- * @return singleton URIs.
- */
- public Collection<URI> getSingletonURIs() {
- return singletons.values();
- }
-
- /**
- * Gets URI of the given singleton.
- *
- * @param title title.
- * @return URI.
- */
- public URI getSingletonURI(final String title) {
- return singletons.get(title);
- }
-
- public Map<String, URI> getRelatedServiceDocuments() {
- return relatedServiceDocuments;
- }
-
- /**
- * Gets related service documents titles.
- *
- * @return related service documents titles.
- */
- public Collection<String> getRelatedServiceDocumentsTitles() {
- return relatedServiceDocuments.keySet();
- }
-
- /**
- * Gets related service documents URIs.
- *
- * @return related service documents URIs.
- */
- public Collection<URI> getRelatedServiceDocumentsURIs() {
- return relatedServiceDocuments.values();
- }
-
- /**
- * Gets URI of the given related service documents.
- *
- * @param title title.
- * @return URI.
- */
- public URI getRelatedServiceDocumentURI(final String title) {
- return relatedServiceDocuments.get(title);
- }
-}