You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/03/10 10:02:49 UTC
[33/51] [abbrv] [partial] [OLINGO-192] rename java packages
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterArgFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterArgFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterArgFactoryImpl.java
new file mode 100644
index 0000000..b21f307
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterArgFactoryImpl.java
@@ -0,0 +1,107 @@
+/*
+ * 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 org.apache.olingo.client.core.uri.filter;
+
+import org.apache.olingo.client.api.uri.filter.FilterArg;
+import org.apache.olingo.client.api.uri.filter.URIFilter;
+import org.apache.olingo.client.api.uri.filter.V4FilterArgFactory;
+
+public class V4FilterArgFactoryImpl extends AbstractFilterArgFactory implements V4FilterArgFactory {
+
+ @Override
+ public FilterArg contains(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("contains", first, second);
+ }
+
+ @Override
+ public FilterArg fractionalseconds(final FilterArg param) {
+ return new FilterFunction("fractionalseconds", param);
+ }
+
+ @Override
+ public FilterArg date(final FilterArg param) {
+ return new FilterFunction("date", param);
+ }
+
+ @Override
+ public FilterArg time(final FilterArg param) {
+ return new FilterFunction("time", param);
+ }
+
+ @Override
+ public FilterArg totaloffsetminutes(final FilterArg param) {
+ return new FilterFunction("totaloffsetminutes", param);
+ }
+
+ @Override
+ public FilterArg now() {
+ return new FilterFunction("now");
+ }
+
+ @Override
+ public FilterArg mindatetime() {
+ return new FilterFunction("mindatetime");
+ }
+
+ @Override
+ public FilterArg maxdatetime() {
+ return new FilterFunction("maxdatetime");
+ }
+
+ @Override
+ public FilterArg totalseconds(final FilterArg param) {
+ return new FilterFunction("totalseconds", param);
+ }
+
+ @Override
+ public FilterArg cast(final FilterArg type) {
+ return new FilterFunction("cast", type);
+ }
+
+ @Override
+ public FilterArg cast(final FilterArg expression, final FilterArg type) {
+ return new FilterFunction("cast", expression, type);
+ }
+
+ @Override
+ public FilterArg geoDistance(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("geo.distance", first, second);
+ }
+
+ @Override
+ public FilterArg geoIntersects(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("geo.intersects", first, second);
+ }
+
+ @Override
+ public FilterArg geoLength(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("geo.length", first, second);
+ }
+
+ @Override
+ public FilterArg any(final FilterArg collection, final URIFilter expression) {
+ return new FilterLambda(collection, "any", expression);
+ }
+
+ @Override
+ public FilterArg all(final FilterArg collection, final URIFilter expression) {
+ return new FilterLambda(collection, "all", expression);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterFactoryImpl.java
new file mode 100644
index 0000000..342938d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterFactoryImpl.java
@@ -0,0 +1,46 @@
+/*
+ * 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 org.apache.olingo.client.core.uri.filter;
+
+import org.apache.olingo.client.api.uri.filter.FilterArg;
+import org.apache.olingo.client.api.uri.filter.URIFilter;
+import org.apache.olingo.client.api.uri.filter.V4FilterArgFactory;
+import org.apache.olingo.client.api.uri.filter.V4FilterFactory;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+
+public class V4FilterFactoryImpl extends AbstractFilterFactory implements V4FilterFactory {
+
+ private static final long serialVersionUID = -5358934829490623191L;
+
+ @Override
+ public V4FilterArgFactory getArgFactory() {
+ return new V4FilterArgFactoryImpl();
+ }
+
+ @Override
+ public URIFilter has(final String key, final EdmEnumType enumType, final String memberName) {
+ return has(getArgFactory().property(key), enumType, memberName);
+ }
+
+ @Override
+ public URIFilter has(final FilterArg left, final EdmEnumType enumType, final String memberName) {
+ return new HasFilter(left, new FilterProperty(enumType.toUriLiteral(memberName)));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/AbstractDOMParser.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/AbstractDOMParser.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/AbstractDOMParser.java
new file mode 100644
index 0000000..70bbbd6
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/AbstractDOMParser.java
@@ -0,0 +1,46 @@
+/*
+ * 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 org.apache.olingo.client.core.xml;
+
+import java.io.InputStream;
+import java.io.Writer;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * DOM Parser.
+ */
+public abstract class AbstractDOMParser {
+
+ /**
+ * Parses the given input into a DOM tree.
+ *
+ * @param input stream to be parsed and de-serialized.
+ * @return DOM tree
+ */
+ public abstract Element deserialize(InputStream input);
+
+ /**
+ * Writes DOM object by the given writer.
+ *
+ * @param content DOM to be streamed.
+ * @param writer writer.
+ */
+ public abstract void serialize(Node content, Writer writer);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/AndroidDOMParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/AndroidDOMParserImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/AndroidDOMParserImpl.java
new file mode 100644
index 0000000..3cbf5e1
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/AndroidDOMParserImpl.java
@@ -0,0 +1,53 @@
+/*
+ * 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 org.apache.olingo.client.core.xml;
+
+import org.apache.olingo.client.api.utils.XMLUtils;
+
+import java.io.InputStream;
+import java.io.Writer;
+
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class AndroidDOMParserImpl extends AbstractDOMParser {
+
+ @Override
+ public Element deserialize(final InputStream input) {
+ try {
+ return XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder().parse(input).getDocumentElement();
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Could not parse DOM", e);
+ }
+ }
+
+ @Override
+ public void serialize(final Node content, final Writer writer) {
+ try {
+ TransformerFactory.newInstance().newTransformer().
+ transform(new DOMSource(content), new StreamResult(writer));
+ } catch (Exception e) {
+ throw new IllegalArgumentException("While serializing DOM element", e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/DefaultDOMParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/DefaultDOMParserImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/DefaultDOMParserImpl.java
new file mode 100644
index 0000000..9f60834
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/DefaultDOMParserImpl.java
@@ -0,0 +1,78 @@
+/*
+ * 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 org.apache.olingo.client.core.xml;
+
+import java.io.InputStream;
+import java.io.Writer;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.bootstrap.DOMImplementationRegistry;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSOutput;
+import org.w3c.dom.ls.LSParser;
+import org.w3c.dom.ls.LSSerializer;
+
+public class DefaultDOMParserImpl extends AbstractDOMParser {
+
+ private static final Object MONITOR = new Object();
+
+ private static DOMImplementationLS DOM_IMPL;
+
+ private void lazyInit() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
+ synchronized (MONITOR) {
+ if (DOM_IMPL == null) {
+ final DOMImplementationRegistry reg = DOMImplementationRegistry.newInstance();
+ DOM_IMPL = (DOMImplementationLS) reg.getDOMImplementation("LS");
+ }
+ }
+ }
+
+ @Override
+ public Element deserialize(final InputStream input) {
+ try {
+ lazyInit();
+
+ final LSParser parser = DOM_IMPL.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
+
+ final LSInput lsinput = DOM_IMPL.createLSInput();
+ lsinput.setByteStream(input);
+
+ return parser.parse(lsinput).getDocumentElement();
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Could not parse DOM", e);
+ }
+ }
+
+ @Override
+ public void serialize(final Node content, final Writer writer) {
+ try {
+ lazyInit();
+
+ final LSSerializer serializer = DOM_IMPL.createLSSerializer();
+
+ final LSOutput lso = DOM_IMPL.createLSOutput();
+ lso.setCharacterStream(writer);
+
+ serializer.write(content, lso);
+ } catch (Exception e) {
+ throw new IllegalArgumentException("While serializing DOM element", e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/XMLParser.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/XMLParser.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/XMLParser.java
new file mode 100644
index 0000000..5c85438
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/xml/XMLParser.java
@@ -0,0 +1,37 @@
+/*
+ * 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 org.apache.olingo.client.core.xml;
+
+import java.util.Iterator;
+import java.util.ServiceLoader;
+
+public final class XMLParser {
+
+ public static final AbstractDOMParser PARSER;
+
+ static {
+ final Iterator<AbstractDOMParser> itor
+ = ServiceLoader.load(AbstractDOMParser.class, Thread.currentThread().getContextClassLoader()).iterator();
+ PARSER = itor.hasNext() ? itor.next() : new DefaultDOMParserImpl();
+ }
+
+ private XMLParser() {
+ // Empty private constructor for static utility classes
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/AbstractConfiguration.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/AbstractConfiguration.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/AbstractConfiguration.java
deleted file mode 100644
index 787107b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/AbstractConfiguration.java
+++ /dev/null
@@ -1,197 +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 org.apache.olingo.odata4.client.core;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import org.apache.olingo.odata4.client.api.Configuration;
-import org.apache.olingo.odata4.client.api.http.HttpClientFactory;
-import org.apache.olingo.odata4.client.api.http.HttpUriRequestFactory;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.apache.olingo.odata4.client.api.format.ODataMediaFormat;
-import org.apache.olingo.odata4.client.api.format.ODataPubFormat;
-import org.apache.olingo.odata4.client.api.format.ODataValueFormat;
-import org.apache.olingo.odata4.client.core.http.DefaultHttpClientFactory;
-import org.apache.olingo.odata4.client.core.http.DefaultHttpUriRequestFactory;
-
-public abstract class AbstractConfiguration implements Configuration {
-
- private static final String DEFAULT_PUB_FORMAT = "pubFormat";
-
- private static final String DEFAULT_VALUE_FORMAT = "valueFormat";
-
- private static final String DEFAULT_MEDIA_FORMAT = "valueFormat";
-
- private static final String HTTP_CLIENT_FACTORY = "httpClientFactory";
-
- private static final String HTTP_URI_REQUEST_FACTORY = "httpUriRequestFactory";
-
- private static final String USE_XHTTP_METHOD = "useHTTPMethod";
-
- private static final String GZIP_COMPRESSION = "gzipCompression";
-
- private static final String CHUNKING = "chunking";
-
- private final Map<String, Object> CONF = new HashMap<String, Object>();
-
- private transient ExecutorService executor = Executors.newFixedThreadPool(10);
-
- /**
- * Gets given configuration property.
- *
- * @param key key value of the property to be retrieved.
- * @param defaultValue default value to be used in case of the given key doesn't exist.
- * @return property value if exists; default value if does not exist.
- */
- protected Object getProperty(final String key, final Object defaultValue) {
- return CONF.containsKey(key) ? CONF.get(key) : defaultValue;
- }
-
- /**
- * Sets new configuration property.
- *
- * @param key configuration property key.
- * @param value configuration property value.
- * @return given value.
- */
- protected Object setProperty(final String key, final Object value) {
- return CONF.put(key, value);
- }
-
- @Override
- public ODataPubFormat getDefaultPubFormat() {
- return ODataPubFormat.valueOf(
- getProperty(DEFAULT_PUB_FORMAT, ODataPubFormat.JSON_FULL_METADATA.name()).toString());
- }
-
- @Override
- public void setDefaultPubFormat(final ODataPubFormat format) {
- setProperty(DEFAULT_PUB_FORMAT, format.name());
- }
-
- @Override
- public ODataFormat getDefaultFormat() {
- ODataFormat format;
-
- switch (getDefaultPubFormat()) {
- case ATOM:
- format = ODataFormat.XML;
- break;
-
- case JSON_FULL_METADATA:
- format = ODataFormat.JSON_FULL_METADATA;
- break;
-
- case JSON_NO_METADATA:
- format = ODataFormat.JSON_NO_METADATA;
- break;
-
- case JSON:
- default:
- format = ODataFormat.JSON;
- }
-
- return format;
- }
-
- @Override
- public ODataValueFormat getDefaultValueFormat() {
- return ODataValueFormat.valueOf(
- getProperty(DEFAULT_VALUE_FORMAT, ODataValueFormat.TEXT.name()).toString());
- }
-
- @Override
- public void setDefaultValueFormat(final ODataValueFormat format) {
- setProperty(DEFAULT_VALUE_FORMAT, format.name());
- }
-
- @Override
- public ODataMediaFormat getDefaultMediaFormat() {
- return ODataMediaFormat.valueOf(
- getProperty(DEFAULT_VALUE_FORMAT, ODataMediaFormat.APPLICATION_OCTET_STREAM.name()).toString());
- }
-
- @Override
- public void setDefaultMediaFormat(final ODataMediaFormat format) {
- setProperty(DEFAULT_MEDIA_FORMAT, format.name());
- }
-
- @Override
- public HttpClientFactory getHttpClientFactory() {
- return (HttpClientFactory) getProperty(HTTP_CLIENT_FACTORY, new DefaultHttpClientFactory());
- }
-
- @Override
- public void setHttpClientFactory(final HttpClientFactory factory) {
- setProperty(HTTP_CLIENT_FACTORY, factory);
- }
-
- @Override
- public HttpUriRequestFactory getHttpUriRequestFactory() {
- return (HttpUriRequestFactory) getProperty(HTTP_URI_REQUEST_FACTORY, new DefaultHttpUriRequestFactory());
- }
-
- @Override
- public void setHttpUriRequestFactory(final HttpUriRequestFactory factory) {
- setProperty(HTTP_URI_REQUEST_FACTORY, factory);
- }
-
- @Override
- public boolean isUseXHTTPMethod() {
- return (Boolean) getProperty(USE_XHTTP_METHOD, false);
- }
-
- @Override
- public void setUseXHTTPMethod(final boolean value) {
- setProperty(USE_XHTTP_METHOD, value);
- }
-
- @Override
- public boolean isGzipCompression() {
- return (Boolean) getProperty(GZIP_COMPRESSION, false);
- }
-
- @Override
- public void setGzipCompression(final boolean value) {
- setProperty(GZIP_COMPRESSION, value);
- }
-
- @Override
- public boolean isUseChuncked() {
- return (Boolean) getProperty(CHUNKING, true);
- }
-
- @Override
- public void setUseChuncked(final boolean value) {
- setProperty(CHUNKING, value);
- }
-
- @Override
- public ExecutorService getExecutor() {
- return executor;
- }
-
- @Override
- public void setExecutor(final ExecutorService executorService) {
- executor = executorService;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/AbstractODataClient.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/AbstractODataClient.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/AbstractODataClient.java
deleted file mode 100644
index 47adcaa..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/AbstractODataClient.java
+++ /dev/null
@@ -1,37 +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 org.apache.olingo.odata4.client.core;
-
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.domain.ODataGeospatialValue;
-import org.apache.olingo.odata4.client.api.domain.ODataPrimitiveValue;
-
-abstract class AbstractODataClient implements ODataClient {
-
- private static final long serialVersionUID = 7269096702397630265L;
-
- public ODataPrimitiveValue.Builder getPrimitiveValueBuilder() {
- return new ODataPrimitiveValue.Builder(this);
- }
-
- public ODataGeospatialValue.Builder getGeospatialValueBuilder() {
- return new ODataGeospatialValue.Builder(this);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataClientFactory.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataClientFactory.java
deleted file mode 100644
index 4842220..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataClientFactory.java
+++ /dev/null
@@ -1,37 +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 org.apache.olingo.odata4.client.core;
-
-import org.apache.olingo.odata4.client.api.ODataV3Client;
-import org.apache.olingo.odata4.client.api.ODataV4Client;
-
-public final class ODataClientFactory {
-
- public static ODataV3Client getV3() {
- return new ODataV3ClientImpl();
- }
-
- public static ODataV4Client getV4() {
- return new ODataV4ClientImpl();
- }
-
- private ODataClientFactory() {
- // empty constructory for static utility class
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataV3ClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataV3ClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataV3ClientImpl.java
deleted file mode 100644
index 8c61eb9..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataV3ClientImpl.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 org.apache.olingo.odata4.client.core;
-
-import org.apache.olingo.odata4.client.api.ODataV3Client;
-import org.apache.olingo.odata4.client.api.V3Configuration;
-import org.apache.olingo.odata4.client.api.op.ODataBinder;
-import org.apache.olingo.odata4.client.api.op.ODataReader;
-import org.apache.olingo.odata4.client.api.op.ODataSerializer;
-import org.apache.olingo.odata4.client.api.op.ODataV3Deserializer;
-import org.apache.olingo.odata4.client.api.uri.V3URIBuilder;
-import org.apache.olingo.odata4.client.api.uri.filter.V3FilterFactory;
-import org.apache.olingo.odata4.client.core.op.impl.ODataV3BinderImpl;
-import org.apache.olingo.odata4.client.core.op.impl.ODataV3DeserializerImpl;
-import org.apache.olingo.odata4.client.core.op.impl.ODataV3ReaderImpl;
-import org.apache.olingo.odata4.client.core.op.impl.ODataV3SerializerImpl;
-import org.apache.olingo.odata4.client.core.uri.V3URIBuilderImpl;
-import org.apache.olingo.odata4.client.core.uri.filter.V3FilterFactoryImpl;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public class ODataV3ClientImpl extends AbstractODataClient implements ODataV3Client {
-
- private static final long serialVersionUID = -1655712193243609209L;
-
- private final V3Configuration configuration = new V3ConfigurationImpl();
-
- private final V3FilterFactory filterFactory = new V3FilterFactoryImpl();
-
- private final ODataV3Deserializer deserializer = new ODataV3DeserializerImpl(this);
-
- private final ODataSerializer serializer = new ODataV3SerializerImpl(this);
-
- private final ODataReader reader = new ODataV3ReaderImpl(this);
-
-// private final ODataWriterImpl writer = new ODataWriterImpl(this);
- private final ODataBinder binder = new ODataV3BinderImpl(this);
-
-// private final ODataObjectFactory objectFactory = new ODataObjectFactoryImpl(this);
-//
-// private final V3RetrieveRequestFactory retrieveReqFact = new V3RetrieveRequestFactory(this);
-//
-// private final V3CUDRequestFactory cudReqFact = new V3CUDRequestFactory(this);
-//
-// private final V3StreamedRequestFactory streamedReqFact = new V3StreamedRequestFactory(this);
-//
-// private final V3InvokeRequestFactory invokeReqFact = new V3InvokeRequestFactory(this);
-//
-// private final V3BatchRequestFactory batchReqFact = new V3BatchRequestFactory(this);
- @Override
- public ODataServiceVersion getServiceVersion() {
- return ODataServiceVersion.V30;
- }
-
-// @Override
-// public ODataHeaders getVersionHeaders() {
-// final ODataHeaders odataHeaders = new ODataHeaders();
-// odataHeaders.setHeader(ODataHeaders.HeaderName.minDataServiceVersion, ODataVersion.V3.toString());
-// odataHeaders.setHeader(ODataHeaders.HeaderName.maxDataServiceVersion, ODataVersion.V3.toString());
-// odataHeaders.setHeader(ODataHeaders.HeaderName.dataServiceVersion, ODataVersion.V3.toString());
-// return odataHeaders;
-// }
- @Override
- public V3Configuration getConfiguration() {
- return configuration;
- }
-
- @Override
- public V3URIBuilder getURIBuilder(final String serviceRoot) {
- return new V3URIBuilderImpl(configuration, serviceRoot);
- }
-
- @Override
- public V3FilterFactory getFilterFactory() {
- return filterFactory;
- }
-
- @Override
- public ODataV3Deserializer getDeserializer() {
- return deserializer;
- }
-
- @Override
- public ODataSerializer getSerializer() {
- return serializer;
- }
-
- @Override
- public ODataReader getReader() {
- return reader;
- }
-
-// @Override
-// public ODataWriterImpl getWriter() {
-// return writer;
-// }
- @Override
- public ODataBinder getBinder() {
- return binder;
- }
-
-// @Override
-// public ODataObjectFactoryImpl getObjectFactory() {
-// return objectFactory;
-// }
-//
-// @Override
-// public V3RetrieveRequestFactory getRetrieveRequestFactory() {
-// return retrieveReqFact;
-// }
-//
-// @Override
-// public V3CUDRequestFactory getCUDRequestFactory() {
-// return cudReqFact;
-// }
-//
-// @Override
-// public V3StreamedRequestFactory getStreamedRequestFactory() {
-// return streamedReqFact;
-// }
-//
-// @Override
-// public V3InvokeRequestFactory getInvokeRequestFactory() {
-// return invokeReqFact;
-// }
-//
-// @Override
-// public V3BatchRequestFactory getBatchRequestFactory() {
-// return batchReqFact;
-// }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataV4ClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataV4ClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataV4ClientImpl.java
deleted file mode 100644
index 6d1c034..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/ODataV4ClientImpl.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 org.apache.olingo.odata4.client.core;
-
-import org.apache.olingo.odata4.client.api.ODataV4Client;
-import org.apache.olingo.odata4.client.api.V4Configuration;
-import org.apache.olingo.odata4.client.api.op.ODataBinder;
-import org.apache.olingo.odata4.client.api.op.ODataReader;
-import org.apache.olingo.odata4.client.api.op.ODataSerializer;
-import org.apache.olingo.odata4.client.api.op.ODataV4Deserializer;
-import org.apache.olingo.odata4.client.api.uri.V4URIBuilder;
-import org.apache.olingo.odata4.client.api.uri.filter.V4FilterFactory;
-import org.apache.olingo.odata4.client.core.op.impl.ODataV4BinderImpl;
-import org.apache.olingo.odata4.client.core.op.impl.ODataV4DeserializerImpl;
-import org.apache.olingo.odata4.client.core.op.impl.ODataV4ReaderImpl;
-import org.apache.olingo.odata4.client.core.op.impl.ODataV4SerializerImpl;
-import org.apache.olingo.odata4.client.core.uri.V4URIBuilderImpl;
-import org.apache.olingo.odata4.client.core.uri.filter.V4FilterFactoryImpl;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public class ODataV4ClientImpl extends AbstractODataClient implements ODataV4Client {
-
- private static final long serialVersionUID = -6653176125573631964L;
-
- private final V4Configuration configuration = new V4ConfigurationImpl();
-
- private final V4FilterFactory filterFactory = new V4FilterFactoryImpl();
-
- private final ODataV4Deserializer deserializer = new ODataV4DeserializerImpl(this);
-
- private final ODataSerializer serializer = new ODataV4SerializerImpl(this);
-
- private final ODataReader reader = new ODataV4ReaderImpl(this);
-
-// private final ODataWriter writer = new ODataWriterImpl(this);
- private final ODataBinder binder = new ODataV4BinderImpl(this);
-
-// private final ODataObjectFactory objectFactory = new ODataObjectFactoryImpl(this);
-//
-// private final V4RetrieveRequestFactory retrieveReqFact = new V4RetrieveRequestFactory(this);
-//
-// private final V4CUDRequestFactory cudReqFact = new V4CUDRequestFactory(this);
-//
-// private final V4StreamedRequestFactory streamedReqFact = new V4StreamedRequestFactory(this);
-//
-// private final V4InvokeRequestFactory invokeReqFact = new V4InvokeRequestFactory(this);
-//
-// private final V4BatchRequestFactory batchReqFact = new V4BatchRequestFactory(this);
- @Override
- public ODataServiceVersion getServiceVersion() {
- return ODataServiceVersion.V40;
- }
-//
-// @Override
-// public ODataHeaders getVersionHeaders() {
-// final ODataHeaders odataHeaders = new ODataHeaders();
-// odataHeaders.setHeader(ODataHeaders.HeaderName.maxDataServiceVersion, ODataVersion.V4.toString());
-// odataHeaders.setHeader(ODataHeaders.HeaderName.dataServiceVersion, ODataVersion.V4.toString());
-// return odataHeaders;
-// }
-
- @Override
- public V4Configuration getConfiguration() {
- return configuration;
- }
-
- @Override
- public V4URIBuilder getURIBuilder(final String serviceRoot) {
- return new V4URIBuilderImpl(serviceRoot);
- }
-
- @Override
- public V4FilterFactory getFilterFactory() {
- return filterFactory;
- }
-
- @Override
- public ODataV4Deserializer getDeserializer() {
- return deserializer;
- }
-
- @Override
- public ODataSerializer getSerializer() {
- return serializer;
- }
-
- @Override
- public ODataReader getReader() {
- return reader;
- }
-
-// @Override
-// public ODataWriterImpl getWriter() {
-// return writer;
-// }
- @Override
- public ODataBinder getBinder() {
- return binder;
- }
-
-// @Override
-// public ODataObjectFactoryImpl getObjectFactory() {
-// return objectFactory;
-// }
-//
-// @Override
-// public V4RetrieveRequestFactory getRetrieveRequestFactory() {
-// return retrieveReqFact;
-// }
-//
-// @Override
-// public V4CUDRequestFactory getCUDRequestFactory() {
-// return cudReqFact;
-// }
-//
-// @Override
-// public V4StreamedRequestFactory getStreamedRequestFactory() {
-// return streamedReqFact;
-// }
-//
-// @Override
-// public V4InvokeRequestFactory getInvokeRequestFactory() {
-// return invokeReqFact;
-// }
-//
-// @Override
-// public V4BatchRequestFactory getBatchRequestFactory() {
-// return batchReqFact;
-// }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/V3ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/V3ConfigurationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/V3ConfigurationImpl.java
deleted file mode 100644
index e84fdd1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/V3ConfigurationImpl.java
+++ /dev/null
@@ -1,57 +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 org.apache.olingo.odata4.client.core;
-
-import org.apache.olingo.odata4.client.api.V3Configuration;
-
-public class V3ConfigurationImpl extends AbstractConfiguration implements V3Configuration {
-
- private static final long serialVersionUID = -8719958537946884777L;
-
- private static final String KEY_AS_SEGMENT = "keyAsSegment";
-
- protected V3ConfigurationImpl() {
- super();
- }
-
- /**
- * Checks whether URIs contain entity key between parentheses (standard) or instead as additional segment. Example:
- * http://services.odata.org/V4/OData/OData.svc/Products(0) or http://services.odata.org/V4/OData/OData.svc/Products/0
- *
- * @return whether URIs shall be built with entity key between parentheses (standard) or instead as additional
- * segment.
- */
- @Override
- public boolean isKeyAsSegment() {
- return (Boolean) getProperty(KEY_AS_SEGMENT, false);
- }
-
- /**
- * Sets whether URIs shall be built with entity key between parentheses (standard) or instead as additional segment.
- * Example: http://services.odata.org/V4/OData/OData.svc/Products(0) or
- * http://services.odata.org/V4/OData/OData.svc/Products/0
- *
- * @param value 'TRUE' to use this feature.
- */
- @Override
- public void setKeyAsSegment(final boolean value) {
- setProperty(KEY_AS_SEGMENT, value);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/V4ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/V4ConfigurationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/V4ConfigurationImpl.java
deleted file mode 100644
index f5f870c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/V4ConfigurationImpl.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 org.apache.olingo.odata4.client.core;
-
-import org.apache.olingo.odata4.client.api.V4Configuration;
-
-public class V4ConfigurationImpl extends AbstractConfiguration implements V4Configuration {
-
- private static final long serialVersionUID = -1134213707190176857L;
-
- protected V4ConfigurationImpl() {
- super();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/AbstractServiceDocument.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/AbstractServiceDocument.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/AbstractServiceDocument.java
deleted file mode 100644
index c841b40..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/AbstractServiceDocument.java
+++ /dev/null
@@ -1,145 +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 org.apache.olingo.odata4.client.core.data;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-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.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.api.data.ServiceDocumentItem;
-
-public abstract class AbstractServiceDocument implements ServiceDocument {
-
- private String title;
-
- private final List<ServiceDocumentItem> entitySets = new ArrayList<ServiceDocumentItem>();
-
- @Override
- public String getMetadataContext() {
- return null;
- }
-
- @Override
- public String getMetadataETag() {
- return null;
- }
-
- @Override
- public String getTitle() {
- return title;
- }
-
- public void setTitle(final String title) {
- this.title = title;
- }
-
- protected ServiceDocumentItem getByName(final List<ServiceDocumentItem> elements, final String name) {
- ServiceDocumentItem result = null;
- for (ServiceDocumentItem element : elements) {
- if (name.equals(element.getName())) {
- result = element;
- }
- }
- return result;
- }
-
- protected ServiceDocumentItem getByTitle(final List<ServiceDocumentItem> elements, final String title) {
- ServiceDocumentItem result = null;
- for (ServiceDocumentItem element : elements) {
- if (title.equals(element.getTitle())) {
- result = element;
- }
- }
- return result;
- }
-
- @Override
- public List<ServiceDocumentItem> getEntitySets() {
- return entitySets;
- }
-
- @Override
- public ServiceDocumentItem getEntitySetByName(final String name) {
- return getByName(getEntitySets(), name);
- }
-
- @Override
- public ServiceDocumentItem getEntitySetByTitle(final String title) {
- return getByTitle(getEntitySets(), title);
- }
-
- @Override
- public List<ServiceDocumentItem> getFunctionImports() {
- return Collections.<ServiceDocumentItem>emptyList();
- }
-
- @Override
- public ServiceDocumentItem getFunctionImportByName(final String name) {
- return getByName(getFunctionImports(), name);
- }
-
- @Override
- public ServiceDocumentItem getFunctionImportByTitle(final String title) {
- return getByTitle(getFunctionImports(), title);
- }
-
- @Override
- public List<ServiceDocumentItem> getSingletons() {
- return Collections.<ServiceDocumentItem>emptyList();
- }
-
- @Override
- public ServiceDocumentItem getSingletonByName(final String name) {
- return getByName(getSingletons(), name);
- }
-
- @Override
- public ServiceDocumentItem getSingletonByTitle(final String title) {
- return getByTitle(getSingletons(), title);
- }
-
- @Override
- public List<ServiceDocumentItem> getRelatedServiceDocuments() {
- return Collections.<ServiceDocumentItem>emptyList();
- }
-
- @Override
- public ServiceDocumentItem getRelatedServiceDocumentByTitle(final String title) {
- return getByTitle(getRelatedServiceDocuments(), title);
- }
-
- @Override
- public boolean equals(final Object obj) {
- return EqualsBuilder.reflectionEquals(this, obj);
- }
-
- @Override
- public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
- }
-
- @Override
- public String toString() {
- return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/JSONServiceDocumentDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/JSONServiceDocumentDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/JSONServiceDocumentDeserializer.java
deleted file mode 100644
index 33b4bdf..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/JSONServiceDocumentDeserializer.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 org.apache.olingo.odata4.client.core.data;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import java.io.IOException;
-import java.util.Iterator;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.odata4.client.api.ODataConstants;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public class JSONServiceDocumentDeserializer extends ODataJacksonDeserializer<AbstractServiceDocument> {
-
- @Override
- protected AbstractServiceDocument doDeserialize(final JsonParser parser, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final ObjectNode tree = (ObjectNode) parser.getCodec().readTree(parser);
-
- final AbstractServiceDocument serviceDocument = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.data.v3.JSONServiceDocumentImpl()
- : new org.apache.olingo.odata4.client.core.data.v4.JSONServiceDocumentImpl();
-
- if (tree.hasNonNull(ODataConstants.JSON_METADATA)
- && serviceDocument instanceof org.apache.olingo.odata4.client.core.data.v3.JSONServiceDocumentImpl) {
-
- ((org.apache.olingo.odata4.client.core.data.v3.JSONServiceDocumentImpl) serviceDocument).
- setMetadata(tree.get(ODataConstants.JSON_METADATA).textValue());
- }
- if (tree.hasNonNull(ODataConstants.JSON_CONTEXT)
- && serviceDocument instanceof org.apache.olingo.odata4.client.core.data.v4.JSONServiceDocumentImpl) {
-
- ((org.apache.olingo.odata4.client.core.data.v4.JSONServiceDocumentImpl) serviceDocument).
- setMetadataContext(tree.get(ODataConstants.JSON_CONTEXT).textValue());
- }
-
- for (final Iterator<JsonNode> itor = tree.get(ODataConstants.JSON_VALUE).elements(); itor.hasNext();) {
- final JsonNode node = itor.next();
-
- final ServiceDocumentItemImpl item = new ServiceDocumentItemImpl();
- item.setName(node.get("name").asText());
- if (node.has("title")) {
- item.setTitle(node.get("title").asText());
- }
- item.setHref(node.get("url").asText());
-
- final String kind = node.has("kind") ? node.get("kind").asText() : null;
- if (StringUtils.isBlank(kind) || "EntitySet".equals(kind)) {
- serviceDocument.getEntitySets().add(item);
- } else if ("Singleton".equals(kind)) {
- serviceDocument.getSingletons().add(item);
- } else if ("FunctionImport".equals(kind)) {
- serviceDocument.getFunctionImports().add(item);
- } else if ("ServiceDocument".equals(kind)) {
- serviceDocument.getRelatedServiceDocuments().add(item);
- }
- }
-
- return serviceDocument;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ODataJacksonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ODataJacksonDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ODataJacksonDeserializer.java
deleted file mode 100644
index c5864f2..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/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 org.apache.olingo.odata4.client.core.data;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.api.ODataClient;
-
-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/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ODataJacksonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ODataJacksonSerializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ODataJacksonSerializer.java
deleted file mode 100644
index 4e44277..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/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 org.apache.olingo.odata4.client.core.data;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.api.ODataClient;
-
-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/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ServiceDocumentItemImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ServiceDocumentItemImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ServiceDocumentItemImpl.java
deleted file mode 100644
index 3d4610a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/ServiceDocumentItemImpl.java
+++ /dev/null
@@ -1,78 +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 org.apache.olingo.odata4.client.core.data;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-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.apache.olingo.odata4.client.api.data.ServiceDocumentItem;
-
-public class ServiceDocumentItemImpl implements ServiceDocumentItem {
-
- private String name;
-
- private String title;
-
- @JsonProperty("url")
- private String href;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getTitle() {
- return title;
- }
-
- public void setTitle(final String title) {
- this.title = title;
- }
-
- @Override
- public String getHref() {
- return href;
- }
-
- public void setHref(final String href) {
- this.href = href;
- }
-
- @Override
- public boolean equals(final Object obj) {
- return EqualsBuilder.reflectionEquals(this, obj);
- }
-
- @Override
- public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this);
- }
-
- @Override
- public String toString() {
- return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/XMLServiceDocumentDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/XMLServiceDocumentDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/XMLServiceDocumentDeserializer.java
deleted file mode 100644
index 749a420..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/XMLServiceDocumentDeserializer.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 org.apache.olingo.odata4.client.core.data;
-
-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 java.io.IOException;
-import java.net.URI;
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-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 ServiceDocumentItemImpl deserializeElement(final JsonParser jp, final String elementName)
- throws IOException {
-
- final ServiceDocumentItemImpl element = new ServiceDocumentItemImpl();
- 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 = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.data.v3.XMLServiceDocumentImpl()
- : new org.apache.olingo.odata4.client.core.data.v4.XMLServiceDocumentImpl();
-
- 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 org.apache.olingo.odata4.client.core.data.v3.XMLServiceDocumentImpl) {
- ((org.apache.olingo.odata4.client.core.data.v3.XMLServiceDocumentImpl) sdoc).
- setBaseURI(URI.create(jp.nextTextValue()));
- } else {
- ((org.apache.olingo.odata4.client.core.data.v4.XMLServiceDocumentImpl) sdoc).
- setBaseURI(URI.create(jp.nextTextValue()));
- }
- } else if ("context".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.data.v4.XMLServiceDocumentImpl) sdoc).
- setMetadataContext(jp.nextTextValue());
- } else if ("metadata-etag".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.data.v4.XMLServiceDocumentImpl) 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/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v3/JSONServiceDocumentImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v3/JSONServiceDocumentImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v3/JSONServiceDocumentImpl.java
deleted file mode 100644
index 28db339..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v3/JSONServiceDocumentImpl.java
+++ /dev/null
@@ -1,65 +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 org.apache.olingo.odata4.client.core.data.v3;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.net.URI;
-import org.apache.olingo.odata4.client.api.uri.SegmentType;
-import org.apache.olingo.odata4.client.core.data.AbstractServiceDocument;
-import org.apache.olingo.odata4.client.core.data.JSONServiceDocumentDeserializer;
-
-/**
- * Service document, represented via JSON.
- */
-@JsonDeserialize(using = JSONServiceDocumentDeserializer.class)
-public class JSONServiceDocumentImpl extends AbstractServiceDocument {
-
- private static final long serialVersionUID = 4195734928526398830L;
-
- private String metadata;
-
- @Override
- public URI getBaseURI() {
- URI baseURI = null;
- if (metadata != null) {
- final String metadataURI = getMetadata();
- baseURI = URI.create(metadataURI.substring(0, metadataURI.indexOf(SegmentType.METADATA.getValue())));
- }
-
- return baseURI;
- }
-
- /**
- * Gets the metadata URI.
- *
- * @return the metadata URI
- */
- public String getMetadata() {
- return metadata;
- }
-
- /**
- * Sets the metadata URI.
- *
- * @param metadata metadata URI.
- */
- public void setMetadata(final String metadata) {
- this.metadata = metadata;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v3/XMLServiceDocumentImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v3/XMLServiceDocumentImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v3/XMLServiceDocumentImpl.java
deleted file mode 100644
index caed09c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v3/XMLServiceDocumentImpl.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 org.apache.olingo.odata4.client.core.data.v3;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.net.URI;
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.core.data.AbstractServiceDocument;
-import org.apache.olingo.odata4.client.core.data.XMLServiceDocumentDeserializer;
-
-@JsonDeserialize(using = XMLServiceDocumentDeserializer.class)
-public class XMLServiceDocumentImpl extends AbstractServiceDocument implements ServiceDocument {
-
- private URI baseURI;
-
- @Override
- public URI getBaseURI() {
- return this.baseURI;
- }
-
- /**
- * Sets base URI.
- *
- * @param baseURI base URI.
- */
- public void setBaseURI(final URI baseURI) {
- this.baseURI = baseURI;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/AbstractServiceDocument.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/AbstractServiceDocument.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/AbstractServiceDocument.java
deleted file mode 100644
index 152c058..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/AbstractServiceDocument.java
+++ /dev/null
@@ -1,88 +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 org.apache.olingo.odata4.client.core.data.v4;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.data.ServiceDocumentItem;
-
-public abstract class AbstractServiceDocument
- extends org.apache.olingo.odata4.client.core.data.AbstractServiceDocument {
-
- private URI baseURI;
-
- private String metadataContext;
-
- private String metadataETag;
-
- private List<ServiceDocumentItem> functionImports = new ArrayList<ServiceDocumentItem>();
-
- private List<ServiceDocumentItem> singletons = new ArrayList<ServiceDocumentItem>();
-
- private List<ServiceDocumentItem> relatedServiceDocuments = new ArrayList<ServiceDocumentItem>();
-
- @Override
- public URI getBaseURI() {
- return this.baseURI;
- }
-
- /**
- * Sets base URI.
- *
- * @param baseURI base URI.
- */
- public void setBaseURI(final URI baseURI) {
- this.baseURI = baseURI;
- }
-
- @Override
- public String getMetadataContext() {
- return metadataContext;
- }
-
- public void setMetadataContext(final String metadataContext) {
- this.metadataContext = metadataContext;
- }
-
- @Override
- public String getMetadataETag() {
- return metadataETag;
- }
-
- public void setMetadataETag(final String metadataETag) {
- this.metadataETag = metadataETag;
- }
-
- @Override
- public List<ServiceDocumentItem> getFunctionImports() {
- return functionImports;
- }
-
- @Override
- public List<ServiceDocumentItem> getSingletons() {
- return singletons;
- }
-
- @Override
- public List<ServiceDocumentItem> getRelatedServiceDocuments() {
- return relatedServiceDocuments;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/JSONServiceDocumentImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/JSONServiceDocumentImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/JSONServiceDocumentImpl.java
deleted file mode 100644
index 82dfb9c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/JSONServiceDocumentImpl.java
+++ /dev/null
@@ -1,41 +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 org.apache.olingo.odata4.client.core.data.v4;
-
-import org.apache.olingo.odata4.client.core.data.JSONServiceDocumentDeserializer;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.net.URI;
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.api.uri.SegmentType;
-
-@JsonDeserialize(using = JSONServiceDocumentDeserializer.class)
-public class JSONServiceDocumentImpl extends AbstractServiceDocument implements ServiceDocument {
-
- @Override
- public URI getBaseURI() {
- URI baseURI = null;
- if (getMetadataContext() != null) {
- final String metadataURI = getMetadataContext();
- baseURI = URI.create(metadataURI.substring(0, metadataURI.indexOf(SegmentType.METADATA.getValue())));
- }
-
- return baseURI;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/XMLServiceDocumentImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/XMLServiceDocumentImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/XMLServiceDocumentImpl.java
deleted file mode 100644
index 7142df2..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/data/v4/XMLServiceDocumentImpl.java
+++ /dev/null
@@ -1,28 +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 org.apache.olingo.odata4.client.core.data.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.core.data.XMLServiceDocumentDeserializer;
-
-@JsonDeserialize(using = XMLServiceDocumentDeserializer.class)
-public class XMLServiceDocumentImpl extends AbstractServiceDocument implements ServiceDocument {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/AnnotationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/AnnotationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/AnnotationPropertyImpl.java
deleted file mode 100644
index 1afc996..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/AnnotationPropertyImpl.java
+++ /dev/null
@@ -1,53 +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 org.apache.olingo.odata4.client.core.deserializer;
-
-import org.apache.olingo.odata4.client.api.deserializer.AnnotationProperty;
-
-public class AnnotationPropertyImpl implements AnnotationProperty {
-
- private final String name;
-
- private final String value;
-
- public AnnotationPropertyImpl(final String name, final String value) {
- this.name = name;
- this.value = value;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getValue() {
- return value;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "AnnotationPropertyImpl [name=" + name + ", value=" + value + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/ComplexValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/ComplexValueImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/ComplexValueImpl.java
deleted file mode 100644
index 3312591..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/ComplexValueImpl.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 org.apache.olingo.odata4.client.core.deserializer;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.apache.olingo.odata4.client.api.deserializer.AnnotationProperty;
-import org.apache.olingo.odata4.client.api.deserializer.ComplexValue;
-import org.apache.olingo.odata4.client.api.deserializer.NavigationProperty;
-import org.apache.olingo.odata4.client.api.deserializer.StructuralProperty;
-import org.apache.olingo.odata4.client.api.deserializer.Value;
-
-public class ComplexValueImpl extends PropertyCollection implements ComplexValue {
-
- public ComplexValueImpl() {
- }
-
- public ComplexValueImpl(final Map<String, AnnotationProperty> annotationProperties,
- final Map<String, NavigationProperty> navigationProperties,
- final Map<String, StructuralProperty> structuralProperties) {
-
- super(annotationProperties, navigationProperties, structuralProperties);
- }
-
- @Override
- public Value getValue(final String name) {
- final StructuralProperty property = structuralProperties.get(name);
- if (property == null) {
- return null;
- }
- return property.getValue();
- }
-
- @Override
- public Map<String, AnnotationProperty> getAnnotationProperties() {
- return Collections.unmodifiableMap(annotationProperties);
- }
-
- @Override
- public Map<String, NavigationProperty> getNavigationProperties() {
- return Collections.unmodifiableMap(navigationProperties);
- }
-
- @Override
- public boolean isComplex() {
- return true;
- }
-
- @Override
- public Map<String, StructuralProperty> getContent() {
- return Collections.unmodifiableMap(structuralProperties);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <T> T getContentAs(final T type) {
- return (T) getContent();
- }
-
- @Override
- public String toString() {
- return "ComplexValueImpl [annotations=" + annotationProperties + ", navigationProperties=" + navigationProperties
- + ", properties=" + structuralProperties + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntityImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntityImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntityImpl.java
deleted file mode 100644
index abd5d4b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntityImpl.java
+++ /dev/null
@@ -1,126 +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 org.apache.olingo.odata4.client.core.deserializer;
-
-import java.util.Map;
-
-import org.apache.olingo.odata4.client.api.deserializer.AnnotationProperty;
-import org.apache.olingo.odata4.client.api.deserializer.Entity;
-import org.apache.olingo.odata4.client.api.deserializer.NavigationProperty;
-import org.apache.olingo.odata4.client.api.deserializer.Property;
-import org.apache.olingo.odata4.client.api.deserializer.StructuralProperty;
-
-public class EntityImpl extends PropertyCollection implements Entity {
-
- public EntityImpl() {
- }
-
- public EntityImpl(final Map<String, AnnotationProperty> annotationProperties,
- final Map<String, NavigationProperty> navigationProperties,
- final Map<String, StructuralProperty> structuralProperties) {
-
- super(annotationProperties, navigationProperties, structuralProperties);
- }
-
- @Override
- public String getODataMetaDataEtag() {
- return getAnnotationValue("odata.metadataEtag");
- }
-
- @Override
- public String getODataType() {
- return getAnnotationValue("odata.type");
- }
-
- @Override
- public Long getODataCount() {
- return Long.valueOf(getAnnotationValue("odata.count"));
- }
-
- @Override
- public String getODataNextLink() {
- return getAnnotationValue("odata.nextLink");
- }
-
- @Override
- public String getODataDeltaLink() {
- return getAnnotationValue("odata.deltaLink");
- }
-
- @Override
- public String getODataReadLink() {
- return getAnnotationValue("odata.readLink");
- }
-
- @Override
- public String getODataContext() {
- return getAnnotationValue("odata.context");
- }
-
- @Override
- public String getODataId() {
- return getAnnotationValue("odata.id");
- }
-
- @Override
- public String getODataETag() {
- return getAnnotationValue("odata.etag");
- }
-
- @Override
- public String getODataEditLink() {
- return getAnnotationValue("odata.editLink");
- }
-
- @Override
- public Object getPropertyContent(final String name) {
- final StructuralProperty property = structuralProperties.get(name);
- if (property != null) {
- return property.getValue().getContent();
- }
- return null;
- }
-
- @Override
- public Property getProperty(final String name) {
- Property property = structuralProperties.get(name);
- if (property == null) {
- property = annotationProperties.get(name);
- }
- if (property == null) {
- property = navigationProperties.get(name);
- }
- return property;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <T extends Property> T getProperty(final String name, final Class<T> clazz) {
- final Property property = getProperty(name);
- return (T) property;
- }
-
- private String getAnnotationValue(final String key) {
- final AnnotationProperty property = annotationProperties.get(key);
- if (property == null) {
- return null;
- }
- return property.getValue();
- }
-}