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:17 UTC
[01/51] [abbrv] [partial] [OLINGO-192] rename java packages
Repository: incubator-olingo-odata4
Updated Branches:
refs/heads/master 7da681a65 -> 897db8ef1
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmEntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmEntityContainerImpl.java b/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmEntityContainerImpl.java
deleted file mode 100644
index 9bc32fc..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmEntityContainerImpl.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 org.apache.olingo.odata4.server.core.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.ODataException;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmSingleton;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmEntityContainer;
-import org.apache.olingo.odata4.server.api.edm.provider.ActionImport;
-import org.apache.olingo.odata4.server.api.edm.provider.EdmProvider;
-import org.apache.olingo.odata4.server.api.edm.provider.EntityContainerInfo;
-import org.apache.olingo.odata4.server.api.edm.provider.EntitySet;
-import org.apache.olingo.odata4.server.api.edm.provider.FunctionImport;
-import org.apache.olingo.odata4.server.api.edm.provider.Singleton;
-
-public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
-
- private final EdmProvider provider;
-
- public EdmEntityContainerImpl(final Edm edm, final EdmProvider provider,
- final EntityContainerInfo entityContainerInfo) {
-
- super(edm, entityContainerInfo.getContainerName());
- this.provider = provider;
- }
-
- @Override
- protected EdmSingleton createSingleton(final String singletonName) {
- EdmSingleton singleton = null;
-
- try {
- final Singleton providerSingleton = provider.getSingleton(entityContainerName, singletonName);
- if (providerSingleton != null) {
- singleton = new EdmSingletonImpl(edm, this, providerSingleton);
- }
- } catch (ODataException e) {
- throw new EdmException(e);
- }
-
- return singleton;
- }
-
- @Override
- protected EdmEntitySet createEntitySet(final String entitySetName) {
- EdmEntitySet entitySet = null;
-
- try {
- final EntitySet providerEntitySet = provider.getEntitySet(entityContainerName, entitySetName);
- if (providerEntitySet != null) {
- entitySet = new EdmEntitySetImpl(edm, this, providerEntitySet);
- }
- } catch (ODataException e) {
- throw new EdmException(e);
- }
-
- return entitySet;
- }
-
- @Override
- protected EdmActionImport createActionImport(final String actionImportName) {
- EdmActionImport actionImport = null;
-
- try {
- final ActionImport providerImport = provider.getActionImport(entityContainerName, actionImportName);
- if (providerImport != null) {
- actionImport = new EdmActionImportImpl(edm, this, actionImportName, providerImport);
- }
- } catch (ODataException e) {
- throw new EdmException(e);
- }
-
- return actionImport;
- }
-
- @Override
- protected EdmFunctionImport createFunctionImport(final String functionImportName) {
- EdmFunctionImport functionImport = null;
-
- try {
- final FunctionImport providerImport = provider.getFunctionImport(entityContainerName, functionImportName);
- if (providerImport != null) {
- functionImport = new EdmFunctionImportImpl(edm, this, functionImportName, providerImport);
- }
- } catch (ODataException e) {
- throw new EdmException(e);
- }
-
- return functionImport;
- }
-
-}
[25/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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/op/impl/ODataV4DeserializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4DeserializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4DeserializerImpl.java
deleted file mode 100644
index 4bd6ff2..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4DeserializerImpl.java
+++ /dev/null
@@ -1,70 +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.op.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.XMLMetadata;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.apache.olingo.odata4.client.api.op.ODataV4Deserializer;
-import org.apache.olingo.odata4.client.core.data.v4.JSONServiceDocumentImpl;
-import org.apache.olingo.odata4.client.core.data.v4.XMLServiceDocumentImpl;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractODataDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.EdmxImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.XMLMetadataImpl;
-
-public class ODataV4DeserializerImpl extends AbstractODataDeserializer implements ODataV4Deserializer {
-
- private static final long serialVersionUID = 8593081342440470415L;
-
- public ODataV4DeserializerImpl(final ODataClient client) {
- super(client);
- }
-
- @Override
- public XMLMetadata toMetadata(final InputStream input) {
- try {
- return new XMLMetadataImpl(getXmlMapper().readValue(input, EdmxImpl.class));
- } catch (Exception e) {
- throw new IllegalArgumentException("Could not parse as Edmx document", e);
- }
- }
-
- @Override
- public ServiceDocument toServiceDocument(final InputStream input, final ODataFormat format) {
- try {
- return format == ODataFormat.XML
- ? getXmlMapper().readValue(input, XMLServiceDocumentImpl.class)
- : getObjectMapper().readValue(input, JSONServiceDocumentImpl.class);
- } catch (IOException e) {
- throw new IllegalArgumentException("Could not parse Service Document", e);
- }
- }
-
-// @Override
-// protected JSONEntry toJSONEntry(final InputStream input) {
-// try {
-// return getObjectMapper().readValue(input, JSONEntry.class);
-// } catch (IOException e) {
-// throw new IllegalArgumentException("While deserializing JSON entry", e);
-// }
-// }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4ReaderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4ReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4ReaderImpl.java
deleted file mode 100644
index 5aa76a7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4ReaderImpl.java
+++ /dev/null
@@ -1,47 +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.op.impl;
-
-import java.io.InputStream;
-import org.apache.olingo.odata4.client.api.domain.ODataServiceDocument;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.apache.olingo.odata4.client.core.ODataV4ClientImpl;
-import org.apache.olingo.odata4.client.core.edm.EdmClientImpl;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractODataReader;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-
-public class ODataV4ReaderImpl extends AbstractODataReader {
-
- private static final long serialVersionUID = -2481293269536406956L;
-
- public ODataV4ReaderImpl(final ODataV4ClientImpl client) {
- super(client);
- }
-
- @Override
- public Edm readMetadata(final InputStream input) {
- return new EdmClientImpl(client.getDeserializer().toMetadata(input));
- }
-
- @Override
- public ODataServiceDocument readServiceDocument(final InputStream input, final ODataFormat format) {
- return ((ODataV4ClientImpl) client).getBinder().getODataServiceDocument(
- ((ODataV4ClientImpl) client).getDeserializer().toServiceDocument(input, format));
- }
-}
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/op/impl/ODataV4SerializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4SerializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4SerializerImpl.java
deleted file mode 100644
index 774da59..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4SerializerImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.op.impl;
-
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractODataSerializer;
-
-public class ODataV4SerializerImpl extends AbstractODataSerializer {
-
- private static final long serialVersionUID = 7587265188399685309L;
-
- public ODataV4SerializerImpl(final ODataClient client) {
- super(client);
- }
-
-}
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/op/impl/SchemaDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/SchemaDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/SchemaDeserializer.java
deleted file mode 100644
index c17c4cd..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/SchemaDeserializer.java
+++ /dev/null
@@ -1,147 +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.op.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractSchema;
-import org.apache.olingo.odata4.client.core.edm.xml.v3.AssociationImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v3.UsingImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v3.ValueTermImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.ActionImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.FunctionImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.TypeDefinitionImpl;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-@SuppressWarnings("rawtypes")
-public class SchemaDeserializer extends AbstractEdmDeserializer<AbstractSchema> {
-
- @Override
- protected AbstractSchema doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractSchema schema = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Namespace".equals(jp.getCurrentName())) {
- schema.setNamespace(jp.nextTextValue());
- } else if ("Alias".equals(jp.getCurrentName())) {
- schema.setAlias(jp.nextTextValue());
- } else if ("Using".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) schema).
- getUsings().add(jp.readValueAs( UsingImpl.class));
- } else if ("Association".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) schema).
- getAssociations().add(jp.readValueAs( AssociationImpl.class));
- } else if ("ComplexType".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (schema instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) schema).
- getComplexTypes().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.ComplexTypeImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl) schema).
- getComplexTypes().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.ComplexTypeImpl.class));
- }
- } else if ("EntityType".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (schema instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) schema).
- getEntityTypes().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.EntityTypeImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl) schema).
- getEntityTypes().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.EntityTypeImpl.class));
- }
- } else if ("EnumType".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (schema instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) schema).
- getEnumTypes().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.EnumTypeImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl) schema).
- getEnumTypes().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.EnumTypeImpl.class));
- }
- } else if ("ValueTerm".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) schema).
- getValueTerms().add(jp.readValueAs( ValueTermImpl.class));
- } else if ("EntityContainer".equals(jp.getCurrentName())) {
- jp.nextToken();
-
- if (schema instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) schema).
- getEntityContainers().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.EntityContainerImpl.class));
- } else {
- org.apache.olingo.odata4.client.core.edm.xml.v4.EntityContainerImpl entityContainer
- = jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.EntityContainerImpl.class);
- entityContainer.setDefaultEntityContainer(true);
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl) schema).
- setEntityContainer(entityContainer);
- }
- } else if ("Annotations".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (schema instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl) schema).getAnnotationsList().
- add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.AnnotationsImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotationsList().
- add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationsImpl.class));
- }
- } else if ("Action".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl) schema).getActions().
- add(jp.readValueAs( ActionImpl.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotations().
- add(jp.readValueAs( AnnotationImpl.class));
- } else if ("Function".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl) schema).getFunctions().
- add(jp.readValueAs( FunctionImpl.class));
- } else if ("TypeDefinition".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl) schema).
- getTypeDefinitions().add(jp.readValueAs( TypeDefinitionImpl.class));
- }
- }
- }
-
- return schema;
- }
-}
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/uri/AbstractURIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/AbstractURIBuilder.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/AbstractURIBuilder.java
deleted file mode 100644
index a92ee5c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/AbstractURIBuilder.java
+++ /dev/null
@@ -1,273 +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.uri;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.odata4.client.api.uri.QueryOption;
-import org.apache.olingo.odata4.client.api.uri.SegmentType;
-import org.apache.olingo.odata4.client.api.uri.URIBuilder;
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractURIBuilder<UB extends URIBuilder<?>> implements URIBuilder<UB> {
-
- private static final long serialVersionUID = -3267515371720408124L;
-
- /**
- * Logger.
- */
- protected static final Logger LOG = LoggerFactory.getLogger(URIBuilder.class);
-
- protected static class Segment {
-
- private final SegmentType type;
-
- private final String value;
-
- public Segment(final SegmentType type, final String value) {
- this.type = type;
- this.value = value;
- }
-
- public SegmentType getType() {
- return type;
- }
-
- public String getValue() {
- return value;
- }
-
- }
-
- protected final List<Segment> segments = new ArrayList<Segment>();
-
- /**
- * Insertion-order map of query options.
- */
- protected final Map<String, String> queryOptions = new LinkedHashMap<String, String>();
-
- /**
- * Constructor.
- *
- * @param serviceRoot absolute URL (schema, host and port included) representing the location of the root of the data
- * service.
- */
- protected AbstractURIBuilder(final String serviceRoot) {
- segments.add(new Segment(SegmentType.SERVICEROOT, serviceRoot));
- }
-
- protected abstract UB getThis();
-
- @Override
- public UB addQueryOption(final QueryOption option, final String value) {
- return addQueryOption(option.toString(), value);
- }
-
- @Override
- public UB addQueryOption(final String option, final String value) {
- queryOptions.put(option, value);
- return getThis();
- }
-
- @Override
- public UB appendEntitySetSegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.ENTITYSET, segmentValue));
- return getThis();
- }
-
- @Override
- public UB appendKeySegment(final Object val) {
- final String segValue = URIUtils.escape(val);
-
- segments.add(new Segment(SegmentType.KEY, "(" + segValue + ")"));
- return getThis();
- }
-
- protected abstract String noKeysWrapper();
-
- @Override
- public UB appendKeySegment(final Map<String, Object> segmentValues) {
- if (segmentValues == null || segmentValues.isEmpty()) {
- segments.add(new Segment(SegmentType.KEY, noKeysWrapper()));
- } else {
- final StringBuilder keyBuilder = new StringBuilder().append('(');
- for (Map.Entry<String, Object> entry : segmentValues.entrySet()) {
- keyBuilder.append(entry.getKey()).append('=').append(URIUtils.escape(entry.getValue()));
- keyBuilder.append(',');
- }
- keyBuilder.deleteCharAt(keyBuilder.length() - 1).append(')');
-
- segments.add(new Segment(SegmentType.KEY, keyBuilder.toString()));
- }
-
- return getThis();
- }
-
- @Override
- public UB appendPropertySegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.PROPERTY, segmentValue));
- return getThis();
-
- }
-
- @Override
- public UB appendNavigationSegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.NAVIGATION, segmentValue));
- return getThis();
- }
-
- @Override
- public UB appendDerivedEntityTypeSegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.DERIVED_ENTITY_TYPE, segmentValue));
- return getThis();
- }
-
- @Override
- public UB appendValueSegment() {
- segments.add(new Segment(SegmentType.VALUE, SegmentType.VALUE.getValue()));
- return getThis();
- }
-
- @Override
- public UB appendOperationCallSegment(final String operation, final Map<String, Object> arguments) {
- segments.add(new Segment(
- segments.size() == 1 ? SegmentType.UNBOUND_OPERATION : SegmentType.BOUND_OPERATION, operation));
- return appendKeySegment(arguments);
- }
-
- @Override
- public UB appendMetadataSegment() {
- segments.add(new Segment(SegmentType.METADATA, SegmentType.METADATA.getValue()));
- return getThis();
- }
-
- @Override
- public UB appendBatchSegment() {
- segments.add(new Segment(SegmentType.BATCH, SegmentType.BATCH.getValue()));
- return getThis();
- }
-
- @Override
- public UB count() {
- segments.add(new Segment(SegmentType.ROOT_QUERY_OPTION, "$" + QueryOption.COUNT.toString()));
- return getThis();
- }
-
- @Override
- public UB expand(final String... expandItems) {
- return addQueryOption(QueryOption.EXPAND, StringUtils.join(expandItems, ","));
- }
-
- @Override
- public UB format(final String format) {
- return addQueryOption(QueryOption.FORMAT, format);
- }
-
- @Override
- public UB filter(final URIFilter filter) {
- return addQueryOption(QueryOption.FILTER, filter.build());
- }
-
- @Override
- public UB filter(final String filter) {
- return addQueryOption(QueryOption.FILTER, filter);
- }
-
- @Override
- public UB select(final String... selectItems) {
- return addQueryOption(QueryOption.SELECT, StringUtils.join(selectItems, ","));
- }
-
- @Override
- public UB orderBy(final String order) {
- return addQueryOption(QueryOption.ORDERBY, order);
- }
-
- @Override
- public UB top(final int top) {
- return addQueryOption(QueryOption.TOP, String.valueOf(top));
- }
-
- @Override
- public UB skip(final int skip) {
- return addQueryOption(QueryOption.SKIP, String.valueOf(skip));
- }
-
- @Override
- public UB skipToken(final String skipToken) {
- return addQueryOption(QueryOption.SKIPTOKEN, skipToken);
- }
-
- protected abstract char getBoundOperationSeparator();
-
- protected abstract char getDerivedEntityTypeSeparator();
-
- @Override
- public URI build() {
- final StringBuilder segmentsBuilder = new StringBuilder();
- for (Segment seg : segments) {
- if (segmentsBuilder.length() > 0 && seg.getType() != SegmentType.KEY) {
- switch (seg.getType()) {
- case BOUND_OPERATION:
- segmentsBuilder.append(getBoundOperationSeparator());
- break;
-
- case DERIVED_ENTITY_TYPE:
- segmentsBuilder.append(getDerivedEntityTypeSeparator());
- break;
-
- default:
- segmentsBuilder.append('/');
- }
- }
-
- if (seg.getType() == SegmentType.ENTITY) {
- segmentsBuilder.append(seg.getType().getValue());
- } else {
- segmentsBuilder.append(seg.getValue());
- }
- }
-
- try {
- final org.apache.http.client.utils.URIBuilder builder =
- new org.apache.http.client.utils.URIBuilder(segmentsBuilder.toString());
-
- for (Map.Entry<String, String> option : queryOptions.entrySet()) {
- builder.addParameter("$" + option.getKey(), option.getValue());
- }
-
- return builder.build().normalize();
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException("Could not build valid URI", e);
- }
- }
-
- @Override
- public String toString() {
- return build().toASCIIString();
- }
-
-}
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/uri/URIUtils.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/URIUtils.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/URIUtils.java
deleted file mode 100644
index 70812ea..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/URIUtils.java
+++ /dev/null
@@ -1,195 +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.uri;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.net.URI;
-import java.net.URLEncoder;
-import java.text.DecimalFormat;
-import java.util.UUID;
-import org.apache.commons.codec.binary.Hex;
-import org.apache.commons.io.IOUtils;
-import org.apache.http.entity.InputStreamEntity;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.ODataConstants;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-import org.apache.olingo.odata4.client.api.domain.ODataDuration;
-import org.apache.olingo.odata4.client.api.domain.ODataTimestamp;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonFunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * URI utilities.
- */
-public final class URIUtils {
-
- /**
- * Logger.
- */
- private static final Logger LOG = LoggerFactory.getLogger(URIUtils.class);
-
- private URIUtils() {
- // Empty private constructor for static utility classes
- }
-
- /**
- * Build URI starting from the given base and href.
- * <br/>
- * If href is absolute or base is null then base will be ignored.
- *
- * @param base URI prefix.
- * @param href URI suffix.
- * @return built URI.
- */
- public static URI getURI(final String base, final String href) {
- if (href == null) {
- throw new IllegalArgumentException("Null link provided");
- }
-
- URI uri = URI.create(href);
-
- if (!uri.isAbsolute() && base != null) {
- uri = URI.create(base + "/" + href);
- }
-
- return uri.normalize();
- }
-
- /**
- * Build URI starting from the given base and href.
- * <br/>
- * If href is absolute or base is null then base will be ignored.
- *
- * @param base URI prefix.
- * @param href URI suffix.
- * @return built URI.
- */
- public static URI getURI(final URI base, final URI href) {
- if (href == null) {
- throw new IllegalArgumentException("Null link provided");
- }
- return getURI(base, href.toASCIIString());
- }
-
- /**
- * Build URI starting from the given base and href.
- * <br/>
- * If href is absolute or base is null then base will be ignored.
- *
- * @param base URI prefix.
- * @param href URI suffix.
- * @return built URI.
- */
- public static URI getURI(final URI base, final String href) {
- if (href == null) {
- throw new IllegalArgumentException("Null link provided");
- }
-
- URI uri = URI.create(href);
-
- if (!uri.isAbsolute() && base != null) {
- uri = URI.create(base.toASCIIString() + "/" + href);
- }
-
- return uri.normalize();
- }
-
- /**
- * Gets function import URI segment.
- *
- * @param entityContainer entity container.
- * @param functionImport function import.
- * @return URI segment.
- */
- public static String rootFunctionImportURISegment(
- final EntityContainer entityContainer, final CommonFunctionImport functionImport) {
-
- final StringBuilder result = new StringBuilder();
- if (!entityContainer.isDefaultEntityContainer()) {
- result.append(entityContainer.getName()).append('.');
- }
- result.append(functionImport.getName());
-
- return result.toString();
- }
-
- /**
- * Turns primitive values into their respective URI representation.
- *
- * @param obj primitive value
- * @return URI representation
- */
- public static String escape(final Object obj) {
- String value;
-
- try {
- value = (obj instanceof UUID)
- ? "guid'" + obj.toString() + "'"
- : (obj instanceof byte[])
- ? "X'" + Hex.encodeHexString((byte[]) obj) + "'"
- : ((obj instanceof ODataTimestamp) && ((ODataTimestamp) obj).getTimezone() == null)
- ? "datetime'" + URLEncoder.encode(((ODataTimestamp) obj).toString(), ODataConstants.UTF8) + "'"
- : ((obj instanceof ODataTimestamp) && ((ODataTimestamp) obj).getTimezone() != null)
- ? "datetimeoffset'" + URLEncoder.encode(((ODataTimestamp) obj).toString(), ODataConstants.UTF8)
- + "'"
- : (obj instanceof ODataDuration)
- ? "time'" + ((ODataDuration) obj).toString() + "'"
- : (obj instanceof BigDecimal)
- ? new DecimalFormat(EdmSimpleType.Decimal.pattern()).format((BigDecimal) obj) + "M"
- : (obj instanceof Double)
- ? new DecimalFormat(EdmSimpleType.Double.pattern()).format((Double) obj) + "D"
- : (obj instanceof Float)
- ? new DecimalFormat(EdmSimpleType.Single.pattern()).format((Float) obj) + "f"
- : (obj instanceof Long)
- ? ((Long) obj).toString() + "L"
- : (obj instanceof String)
- ? "'" + URLEncoder.encode((String) obj, ODataConstants.UTF8) + "'"
- : obj.toString();
- } catch (Exception e) {
- LOG.warn("While escaping '{}', using toString()", obj, e);
- value = obj.toString();
- }
-
- return value;
- }
-
- public static InputStreamEntity buildInputStreamEntity(final ODataClient client, final InputStream input) {
- InputStreamEntity entity;
- if (client.getConfiguration().isUseChuncked()) {
- entity = new InputStreamEntity(input, -1);
- } else {
- byte[] bytes = new byte[0];
- try {
- bytes = IOUtils.toByteArray(input);
- } catch (IOException e) {
- LOG.error("While reading input for not chunked encoding", e);
- }
-
- entity = new InputStreamEntity(new ByteArrayInputStream(bytes), bytes.length);
- }
- entity.setChunked(client.getConfiguration().isUseChuncked());
-
- return entity;
- }
-}
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/uri/V3URIBuilderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/V3URIBuilderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/V3URIBuilderImpl.java
deleted file mode 100644
index c721000..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/V3URIBuilderImpl.java
+++ /dev/null
@@ -1,93 +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.uri;
-
-import java.util.Map;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.odata4.client.api.V3Configuration;
-import org.apache.olingo.odata4.client.api.uri.QueryOption;
-import org.apache.olingo.odata4.client.api.uri.SegmentType;
-import org.apache.olingo.odata4.client.api.uri.V3URIBuilder;
-
-public class V3URIBuilderImpl extends AbstractURIBuilder<V3URIBuilder> implements V3URIBuilder {
-
- private static final long serialVersionUID = -3506851722447870532L;
-
- private final V3Configuration configuration;
-
- public V3URIBuilderImpl(final V3Configuration configuration, final String serviceRoot) {
- super(serviceRoot);
- this.configuration = configuration;
- }
-
- @Override
- protected V3URIBuilder getThis() {
- return this;
- }
-
- @Override
- protected char getBoundOperationSeparator() {
- return '/';
- }
-
- @Override
- protected char getDerivedEntityTypeSeparator() {
- return '/';
- }
-
- @Override
- public V3URIBuilder appendLinksSegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.LINKS, SegmentType.LINKS.getValue()));
- segments.add(new Segment(SegmentType.ENTITYSET, segmentValue));
-
- return getThis();
- }
-
- @Override
- protected String noKeysWrapper() {
- return StringUtils.EMPTY;
- }
-
- @Override
- public V3URIBuilder appendKeySegment(final Object val) {
- if (configuration.isKeyAsSegment()) {
- final String segValue = URIUtils.escape(val);
- segments.add(new Segment(SegmentType.KEY_AS_SEGMENT, segValue));
- } else {
- super.appendKeySegment(val);
- }
-
- return getThis();
- }
-
- @Override
- public V3URIBuilder appendKeySegment(final Map<String, Object> segmentValues) {
- if (!configuration.isKeyAsSegment()) {
- super.appendKeySegment(segmentValues);
- }
-
- return getThis();
- }
-
- @Override
- public V3URIBuilder inlineCount(final InlineCount inlineCount) {
- return addQueryOption(QueryOption.INLINECOUNT, inlineCount.name());
- }
-
-}
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/uri/V4URIBuilderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/V4URIBuilderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/V4URIBuilderImpl.java
deleted file mode 100644
index dcdaf62..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/V4URIBuilderImpl.java
+++ /dev/null
@@ -1,101 +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.uri;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.odata4.client.api.uri.QueryOption;
-import org.apache.olingo.odata4.client.api.uri.SegmentType;
-import org.apache.olingo.odata4.client.api.uri.V4URIBuilder;
-
-public class V4URIBuilderImpl extends AbstractURIBuilder<V4URIBuilder> implements V4URIBuilder {
-
- private static final long serialVersionUID = -3506851722447870532L;
-
- public V4URIBuilderImpl(final String serviceRoot) {
- super(serviceRoot);
- }
-
- @Override
- protected V4URIBuilder getThis() {
- return this;
- }
-
- @Override
- protected String noKeysWrapper() {
- return "()";
- }
-
- @Override
- protected char getBoundOperationSeparator() {
- return '.';
- }
-
- @Override
- protected char getDerivedEntityTypeSeparator() {
- return '.';
- }
-
- @Override
- public V4URIBuilder appendSingletonSegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.SINGLETON, segmentValue));
- return getThis();
- }
-
- @Override
- public V4URIBuilder appendEntityIdSegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.ENTITY, null));
- return addQueryOption(QueryOption.ID, segmentValue);
- }
-
- @Override
- public V4URIBuilder appendRefSegment() {
- segments.add(new Segment(SegmentType.REF, SegmentType.REF.getValue()));
- return getThis();
- }
-
- @Override
- public V4URIBuilder appendCrossjoinSegment(final String... segmentValues) {
- StringBuilder segValue = new StringBuilder(SegmentType.CROSS_JOIN.getValue()).
- append('(').append(StringUtils.join(segmentValues, ",")).append(')');
- segments.add(new Segment(SegmentType.CROSS_JOIN, segValue.toString()));
- return getThis();
- }
-
- @Override
- public V4URIBuilder count(final boolean value) {
- return addQueryOption(QueryOption.COUNT, Boolean.toString(value));
- }
-
- @Override
- public V4URIBuilder appendAllSegment() {
- segments.add(new Segment(SegmentType.ALL, SegmentType.ALL.getValue()));
- return getThis();
- }
-
- @Override
- public V4URIBuilder id(final String idValue) {
- return addQueryOption(QueryOption.ID, idValue);
- }
-
- @Override
- public V4URIBuilder search(final String expression) {
- return addQueryOption(QueryOption.SEARCH, expression);
- }
-
-}
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/uri/filter/AbstractComparingFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AbstractComparingFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AbstractComparingFilter.java
deleted file mode 100644
index c76de47..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AbstractComparingFilter.java
+++ /dev/null
@@ -1,45 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-abstract class AbstractComparingFilter implements URIFilter {
-
- private final FilterArg left;
-
- private final FilterArg right;
-
- AbstractComparingFilter(final FilterArg left, final FilterArg right) {
- this.left = left;
- this.right = right;
- }
-
- protected abstract String getOp();
-
- @Override
- public String build() {
- return new StringBuilder().
- append('(').append(left.build()).
- append(' ').append(getOp()).append(' ').
- append(right.build()).append(')').
- toString();
- }
-}
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/uri/filter/AbstractFilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AbstractFilterArgFactory.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AbstractFilterArgFactory.java
deleted file mode 100644
index b7c68aa..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AbstractFilterArgFactory.java
+++ /dev/null
@@ -1,178 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArgFactory;
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-/**
- * OData filter arguments factory.
- */
-abstract class AbstractFilterArgFactory implements FilterArgFactory {
-
- @Override
- public FilterArg _null() {
- return new FilterConst("null");
- }
-
- @Override
- public FilterArg property(final String propertyPath) {
- return new FilterProperty(propertyPath);
- }
-
- @Override
- public FilterArg literal(final Object value) {
- return new FilterLiteral(value);
- }
-
- @Override
- public FilterArg add(final FilterArg first, final FilterArg second) {
- return new FilterOp("add", first, second);
- }
-
- @Override
- public FilterArg sub(final FilterArg first, final FilterArg second) {
- return new FilterOp("add", first, second);
- }
-
- @Override
- public FilterArg mul(final FilterArg first, final FilterArg second) {
- return new FilterOp("mul", first, second);
- }
-
- @Override
- public FilterArg div(final FilterArg first, final FilterArg second) {
- return new FilterOp("div", first, second);
- }
-
- @Override
- public FilterArg mod(final FilterArg first, final FilterArg second) {
- return new FilterOp("mod", first, second);
- }
-
- @Override
- public FilterArg endswith(final FilterArg first, final FilterArg second) {
- return new FilterFunction("endswith", first, second);
- }
-
- @Override
- public FilterArg startswith(final FilterArg first, final FilterArg second) {
- return new FilterFunction("startswith", first, second);
- }
-
- @Override
- public FilterArg length(final FilterArg param) {
- return new FilterFunction("length", param);
- }
-
- @Override
- public FilterArg indexof(final FilterArg first, final FilterArg second) {
- return new FilterFunction("indexof", first, second);
- }
-
- @Override
- public FilterArg replace(final FilterArg first, final FilterArg second, final FilterArg third) {
- return new FilterFunction("replace", first, second, third);
- }
-
- @Override
- public FilterArg substring(final FilterArg arg, final FilterArg pos) {
- return new FilterFunction("substring", arg, pos);
- }
-
- @Override
- public FilterArg substring(final FilterArg arg, final FilterArg pos, final FilterArg length) {
- return new FilterFunction("substring", arg, pos, length);
- }
-
- @Override
- public FilterArg tolower(final FilterArg param) {
- return new FilterFunction("tolower", param);
- }
-
- @Override
- public FilterArg toupper(final FilterArg param) {
- return new FilterFunction("toupper", param);
- }
-
- @Override
- public FilterArg trim(final FilterArg param) {
- return new FilterFunction("trim", param);
- }
-
- @Override
- public FilterArg concat(final FilterArg first, final FilterArg second) {
- return new FilterFunction("concat", first, second);
- }
-
- @Override
- public FilterArg day(final FilterArg param) {
- return new FilterFunction("day", param);
- }
-
- @Override
- public FilterArg hour(final FilterArg param) {
- return new FilterFunction("hour", param);
- }
-
- @Override
- public FilterArg minute(final FilterArg param) {
- return new FilterFunction("minute", param);
- }
-
- @Override
- public FilterArg month(final FilterArg param) {
- return new FilterFunction("month", param);
- }
-
- @Override
- public FilterArg second(final FilterArg param) {
- return new FilterFunction("second", param);
- }
-
- @Override
- public FilterArg year(final FilterArg param) {
- return new FilterFunction("year", param);
- }
-
- @Override
- public FilterArg round(final FilterArg param) {
- return new FilterFunction("round", param);
- }
-
- @Override
- public FilterArg floor(final FilterArg param) {
- return new FilterFunction("floor", param);
- }
-
- @Override
- public FilterArg ceiling(final FilterArg param) {
- return new FilterFunction("ceiling", param);
- }
-
- @Override
- public FilterArg isof(final FilterArg type) {
- return new FilterFunction("isof", type);
- }
-
- @Override
- public FilterArg isof(final FilterArg expression, final FilterArg type) {
- return new FilterFunction("isof", expression, type);
- }
-}
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/uri/filter/AbstractFilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AbstractFilterFactory.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AbstractFilterFactory.java
deleted file mode 100644
index 288f547..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AbstractFilterFactory.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 org.apache.olingo.odata4.client.core.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-import org.apache.olingo.odata4.client.api.uri.filter.FilterFactory;
-
-abstract class AbstractFilterFactory implements FilterFactory {
-
- private static final long serialVersionUID = -6141317149802621836L;
-
- @Override
- public URIFilter match(final FilterArg arg) {
- return new MatchFilter(arg);
- }
-
- @Override
- public URIFilter eq(final String key, final Object value) {
- return new EqFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter eq(final FilterArg left, final FilterArg right) {
- return new EqFilter(left, right);
- }
-
- @Override
- public URIFilter ne(final String key, final Object value) {
- return new NeFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter ne(final FilterArg left, final FilterArg right) {
- return new NeFilter(left, right);
- }
-
- @Override
- public URIFilter gt(final String key, final Object value) {
- return new GtFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter gt(final FilterArg left, final FilterArg right) {
- return new GtFilter(left, right);
- }
-
- @Override
- public URIFilter ge(final String key, final Object value) {
- return new GeFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter ge(final FilterArg left, final FilterArg right) {
- return new GeFilter(left, right);
- }
-
- @Override
- public URIFilter lt(final String key, final Object value) {
- return new LtFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter lt(final FilterArg left, final FilterArg right) {
- return new LtFilter(left, right);
- }
-
- @Override
- public URIFilter le(final String key, final Object value) {
- return new LeFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter le(final FilterArg left, final FilterArg right) {
- return new LeFilter(left, right);
- }
-
- @Override
- public URIFilter and(final URIFilter left, final URIFilter right) {
- return new AndFilter(left, right);
- }
-
- @Override
- public URIFilter or(final URIFilter left, final URIFilter right) {
- return new OrFilter(left, right);
- }
-
- @Override
- public URIFilter not(final URIFilter filter) {
- return new NotFilter(filter);
- }
-}
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/uri/filter/AndFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AndFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AndFilter.java
deleted file mode 100644
index c9068a3..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/AndFilter.java
+++ /dev/null
@@ -1,42 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-
-public class AndFilter implements URIFilter {
-
- private final URIFilter left;
-
- private final URIFilter right;
-
- public AndFilter(final URIFilter left, final URIFilter right) {
- this.left = left;
- this.right = right;
- }
-
- @Override
- public String build() {
- return new StringBuilder().
- append('(').append(left.build()).
- append(" and ").
- append(right.build()).append(')').
- toString();
- }
-}
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/uri/filter/EqFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/EqFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/EqFilter.java
deleted file mode 100644
index 01bfd03..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/EqFilter.java
+++ /dev/null
@@ -1,33 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-public class EqFilter extends AbstractComparingFilter {
-
- EqFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "eq";
- }
-}
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/uri/filter/FilterConst.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterConst.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterConst.java
deleted file mode 100644
index 22987b6..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterConst.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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArgFactory;
-
-/**
- * Filter property path; obtain instances via <tt>FilterArgFactory</tt>.
- *
- * @see FilterArgFactory
- */
-public class FilterConst implements FilterArg {
-
- private final String value;
-
- FilterConst(final String value) {
- this.value = value;
- }
-
- @Override
- public String build() {
- return 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/uri/filter/FilterFunction.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterFunction.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterFunction.java
deleted file mode 100644
index 1f32837..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterFunction.java
+++ /dev/null
@@ -1,48 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-import org.apache.commons.lang3.StringUtils;
-
-public class FilterFunction implements FilterArg {
-
- private final String function;
-
- private final FilterArg[] params;
-
- FilterFunction(final String function, final FilterArg... params) {
- this.function = function;
- this.params = params;
- }
-
- @Override
- public String build() {
- final String[] strParams = params == null || params.length == 0 ? new String[0] : new String[params.length];
- for (int i = 0; i < strParams.length; i++) {
- strParams[i] = params[i].build();
- }
-
- return new StringBuilder(function).
- append('(').
- append(strParams.length == 0 ? StringUtils.EMPTY : StringUtils.join(strParams, ',')).
- append(')').
- toString();
- }
-}
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/uri/filter/FilterLambda.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterLambda.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterLambda.java
deleted file mode 100644
index dbb1e2a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterLambda.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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-
-public class FilterLambda implements FilterArg {
-
- private final FilterArg collection;
-
- private final String operator;
-
- private final URIFilter expression;
-
- FilterLambda(final FilterArg collection, final String operator, final URIFilter expression) {
- this.collection = collection;
- this.operator = operator;
- this.expression = expression;
- }
-
- @Override
- public String build() {
- return new StringBuilder(collection.build()).
- append('/').
- append(operator).
- append(expression.build()).
- toString();
- }
-}
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/uri/filter/FilterLiteral.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterLiteral.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterLiteral.java
deleted file mode 100644
index 578c3e3..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterLiteral.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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-import org.apache.olingo.odata4.client.core.uri.URIUtils;
-
-/**
- * Filter value literals; obtain instances via <tt>FilterArgFactory</tt>.
- *
- * @see FilterArgFactory
- */
-public class FilterLiteral implements FilterArg {
-
- private final Object value;
-
- FilterLiteral(final Object value) {
- this.value = value;
- }
-
- @Override
- public String build() {
- return URIUtils.escape(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/uri/filter/FilterOp.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterOp.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterOp.java
deleted file mode 100644
index a59fd7b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterOp.java
+++ /dev/null
@@ -1,45 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-public class FilterOp implements FilterArg {
-
- private final String op;
-
- private final FilterArg first;
-
- private final FilterArg second;
-
- FilterOp(final String op, final FilterArg first, final FilterArg second) {
- this.op = op;
- this.first = first;
- this.second = second;
- }
-
- @Override
- public String build() {
- return new StringBuilder().
- append('(').append(first.build()).
- append(' ').append(op).append(' ').
- append(second.build()).append(')').
- toString();
- }
-}
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/uri/filter/FilterProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterProperty.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterProperty.java
deleted file mode 100644
index e467a44..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/FilterProperty.java
+++ /dev/null
@@ -1,40 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-/**
- * Filter property path; obtain instances via <tt>FilterArgFactory</tt>.
- *
- * @see FilterArgFactory
- */
-public class FilterProperty implements FilterArg {
-
- private final String propertyPath;
-
- FilterProperty(final String value) {
- this.propertyPath = value;
- }
-
- @Override
- public String build() {
- return propertyPath;
- }
-}
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/uri/filter/GeFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/GeFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/GeFilter.java
deleted file mode 100644
index 77024d9..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/GeFilter.java
+++ /dev/null
@@ -1,33 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-public class GeFilter extends AbstractComparingFilter {
-
- GeFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "ge";
- }
-}
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/uri/filter/GtFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/GtFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/GtFilter.java
deleted file mode 100644
index 9f1d188..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/GtFilter.java
+++ /dev/null
@@ -1,33 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-public class GtFilter extends AbstractComparingFilter {
-
- GtFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "gt";
- }
-}
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/uri/filter/HasFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/HasFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/HasFilter.java
deleted file mode 100644
index 22f4d94..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/HasFilter.java
+++ /dev/null
@@ -1,34 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-public class HasFilter extends AbstractComparingFilter {
-
- HasFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "has";
- }
-
-}
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/uri/filter/LeFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/LeFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/LeFilter.java
deleted file mode 100644
index 122ef1b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/LeFilter.java
+++ /dev/null
@@ -1,33 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-public class LeFilter extends AbstractComparingFilter {
-
- LeFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "le";
- }
-}
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/uri/filter/LtFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/LtFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/LtFilter.java
deleted file mode 100644
index 5cbde0d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/LtFilter.java
+++ /dev/null
@@ -1,33 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-public class LtFilter extends AbstractComparingFilter {
-
- LtFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "lt";
- }
-}
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/uri/filter/MatchFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/MatchFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/MatchFilter.java
deleted file mode 100644
index ae352ad..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/MatchFilter.java
+++ /dev/null
@@ -1,36 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-public class MatchFilter implements URIFilter {
-
- private final FilterArg arg;
-
- MatchFilter(final FilterArg arg) {
- this.arg = arg;
- }
-
- @Override
- public String build() {
- return arg.build();
- }
-}
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/uri/filter/NeFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/NeFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/NeFilter.java
deleted file mode 100644
index cba18ec..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/NeFilter.java
+++ /dev/null
@@ -1,33 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-
-public class NeFilter extends AbstractComparingFilter {
-
- NeFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "ne";
- }
-}
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/uri/filter/NotFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/NotFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/NotFilter.java
deleted file mode 100644
index 8aed7bb..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/NotFilter.java
+++ /dev/null
@@ -1,35 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-
-public class NotFilter implements URIFilter {
-
- private final URIFilter filter;
-
- public NotFilter(final URIFilter left) {
- this.filter = left;
- }
-
- @Override
- public String build() {
- return new StringBuilder("not (").append(filter.build()).append(')').toString();
- }
-}
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/uri/filter/OrFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/OrFilter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/OrFilter.java
deleted file mode 100644
index 648fa27..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/OrFilter.java
+++ /dev/null
@@ -1,42 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-
-public class OrFilter implements URIFilter {
-
- private final URIFilter left;
-
- private final URIFilter right;
-
- public OrFilter(final URIFilter left, final URIFilter right) {
- this.left = left;
- this.right = right;
- }
-
- @Override
- public String build() {
- return new StringBuilder().
- append('(').append(left.build()).
- append(" or ").
- append(right.build()).append(')').
- toString();
- }
-}
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/uri/filter/V3FilterArgFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V3FilterArgFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V3FilterArgFactoryImpl.java
deleted file mode 100644
index ace149d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V3FilterArgFactoryImpl.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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-import org.apache.olingo.odata4.client.api.uri.filter.V3FilterArgFactory;
-
-public class V3FilterArgFactoryImpl extends AbstractFilterArgFactory implements V3FilterArgFactory {
-
- @Override
- public FilterArg substringof(final FilterArg first, final FilterArg second) {
- return new FilterFunction("substringof", first, second);
- }
-
-}
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/uri/filter/V3FilterFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V3FilterFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V3FilterFactoryImpl.java
deleted file mode 100644
index e966c9c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V3FilterFactoryImpl.java
+++ /dev/null
@@ -1,33 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.V3FilterArgFactory;
-import org.apache.olingo.odata4.client.api.uri.filter.V3FilterFactory;
-
-public class V3FilterFactoryImpl extends AbstractFilterFactory implements V3FilterFactory {
-
- private static final long serialVersionUID = 1092594961118334631L;
-
- @Override
- public V3FilterArgFactory getArgFactory() {
- return new V3FilterArgFactoryImpl();
- }
-
-}
[44/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntitySet.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntitySet.java
deleted file mode 100644
index 3807294..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntitySet.java
+++ /dev/null
@@ -1,25 +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.api.edm.xml;
-
-public interface EntitySet extends Named {
-
- String getEntityType();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityType.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityType.java
deleted file mode 100644
index d2e3c6d..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityType.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.edm.xml;
-
-public interface EntityType extends ComplexType {
-
- boolean isAbstractEntityType();
-
- String getBaseType();
-
- boolean isOpenType();
-
- EntityKey getKey();
-
- boolean isHasStream();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EnumType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EnumType.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EnumType.java
deleted file mode 100644
index 8e2628a..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EnumType.java
+++ /dev/null
@@ -1,34 +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.api.edm.xml;
-
-import java.util.List;
-
-public interface EnumType extends Named {
-
- String getUnderlyingType();
-
- boolean isFlags();
-
- List<Member> getMembers();
-
- Member getMember(String name);
-
- Member getMember(Integer value);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Member.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Member.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Member.java
deleted file mode 100644
index d6292c9..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Member.java
+++ /dev/null
@@ -1,26 +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.api.edm.xml;
-
-public interface Member {
-
- String getName();
-
- String getValue();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Named.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Named.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Named.java
deleted file mode 100644
index 00a0e31..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Named.java
+++ /dev/null
@@ -1,24 +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.api.edm.xml;
-
-public interface Named {
-
- String getName();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/OnDelete.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/OnDelete.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/OnDelete.java
deleted file mode 100644
index 7f48979..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/OnDelete.java
+++ /dev/null
@@ -1,24 +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.api.edm.xml;
-
-public interface OnDelete {
-
- OnDeleteAction getAction();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/OnDeleteAction.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/OnDeleteAction.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/OnDeleteAction.java
deleted file mode 100644
index 3479707..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/OnDeleteAction.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.api.edm.xml;
-
-public enum OnDeleteAction {
-
- Cascade,
- None,
- SetNull,
- SetDefault;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/PropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/PropertyRef.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/PropertyRef.java
deleted file mode 100644
index 49f0430..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/PropertyRef.java
+++ /dev/null
@@ -1,25 +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.api.edm.xml;
-
-public interface PropertyRef extends Named {
-
- String getAlias();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Schema.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Schema.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Schema.java
deleted file mode 100644
index 42dc701..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Schema.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 org.apache.olingo.odata4.client.api.edm.xml;
-
-import java.util.List;
-
-public interface Schema {
-
- String getNamespace();
-
- String getAlias();
-
- List<? extends EntityType> getEntityTypes();
-
- List<EnumType> getEnumTypes();
-
- EnumType getEnumType(String name);
-
- List<? extends CommonAnnotations> getAnnotationsList();
-
- CommonAnnotations getAnnotationsList(String target);
-
- List<? extends ComplexType> getComplexTypes();
-
- List<? extends EntityContainer> getEntityContainers();
-
- /**
- * Gets default entity container.
- *
- * @return default entity container.
- */
- EntityContainer getDefaultEntityContainer();
-
- /**
- * Gets entity container with the given name.
- *
- * @param name name.
- * @return entity container.
- */
- EntityContainer getEntityContainer(String name);
-
- /**
- * Gets entity type with the given name.
- *
- * @param name name.
- * @return entity type.
- */
- EntityType getEntityType(String name);
-
- /**
- * Gets complex type with the given name.
- *
- * @param name name.
- * @return complex type.
- */
- ComplexType getComplexType(String name);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/XMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/XMLMetadata.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/XMLMetadata.java
deleted file mode 100644
index 2350214..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/XMLMetadata.java
+++ /dev/null
@@ -1,59 +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.api.edm.xml;
-
-import java.util.List;
-
-/**
- * Entry point for access information about EDM metadata.
- */
-public interface XMLMetadata {
-
- /**
- * Checks whether the given key is a valid namespace or alias in the EdM metadata document.
- *
- * @param key namespace or alias
- * @return true if key is valid namespace or alias
- */
- boolean isNsOrAlias(String key);
-
- /**
- * Returns the Schema at the specified position in the EdM metadata document.
- *
- * @param index index of the Schema to return
- * @return the Schema at the specified position in the EdM metadata document
- */
- Schema getSchema(final int index);
-
- /**
- * Returns the Schema with the specified key (namespace or alias) in the EdM metadata document.
- *
- * @param key namespace or alias
- * @return the Schema with the specified key in the EdM metadata document
- */
- Schema getSchema(final String key);
-
- /**
- * Returns all Schema objects defined in the EdM metadata document.
- *
- * @return all Schema objects defined in the EdM metadata document
- */
- List<? extends Schema> getSchemas();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Annotations.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Annotations.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Annotations.java
deleted file mode 100644
index 03bdbe7..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Annotations.java
+++ /dev/null
@@ -1,29 +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.api.edm.xml.v3;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonAnnotations;
-
-public interface Annotations extends CommonAnnotations {
-
- List<TypeAnnotation> getTypeAnnotations();
-
- List<ValueAnnotation> getValueAnnotations();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Association.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Association.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Association.java
deleted file mode 100644
index d306125..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Association.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 org.apache.olingo.odata4.client.api.edm.xml.v3;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.Named;
-
-public interface Association extends Named {
-
- ReferentialConstraint getReferentialConstraint();
-
- List<AssociationEnd> getEnds();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationEnd.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationEnd.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationEnd.java
deleted file mode 100644
index 1f249a8..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationEnd.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.edm.xml.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.OnDelete;
-
-public interface AssociationEnd {
-
- String getType();
-
- String getRole();
-
- String getMultiplicity();
-
- OnDelete getOnDelete();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationSet.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationSet.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationSet.java
deleted file mode 100644
index 5963a0c..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationSet.java
+++ /dev/null
@@ -1,29 +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.api.edm.xml.v3;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.Named;
-
-public interface AssociationSet extends Named {
-
- String getAssociation();
-
- List<AssociationSetEnd> getEnds();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationSetEnd.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationSetEnd.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationSetEnd.java
deleted file mode 100644
index 891ba6c..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/AssociationSetEnd.java
+++ /dev/null
@@ -1,26 +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.api.edm.xml.v3;
-
-public interface AssociationSetEnd {
-
- String getRole();
-
- String getEntitySet();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/FunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/FunctionImport.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/FunctionImport.java
deleted file mode 100644
index ccc733e..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/FunctionImport.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.api.edm.xml.v3;
-
-import java.util.List;
-
-public interface FunctionImport extends org.apache.olingo.odata4.client.api.edm.xml.CommonFunctionImport {
-
- String getReturnType();
-
- String getEntitySet();
-
- String getEntitySetPath();
-
- boolean isComposable();
-
- boolean isSideEffecting();
-
- boolean isBindable();
-
- boolean isAlwaysBindable();
-
- String getHttpMethod();
-
- List<Parameter> getParameters();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/NavigationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/NavigationProperty.java
deleted file mode 100644
index f1f5ce0..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/NavigationProperty.java
+++ /dev/null
@@ -1,29 +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.api.edm.xml.v3;
-
-public interface NavigationProperty extends org.apache.olingo.odata4.client.api.edm.xml.CommonNavigationProperty {
-
- String getRelationship();
-
- String getToRole();
-
- String getFromRole();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Parameter.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Parameter.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Parameter.java
deleted file mode 100644
index 8fcbc4b..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Parameter.java
+++ /dev/null
@@ -1,24 +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.api.edm.xml.v3;
-
-public interface Parameter extends org.apache.olingo.odata4.client.api.edm.xml.CommonParameter {
-
- ParameterMode getMode();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ParameterMode.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ParameterMode.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ParameterMode.java
deleted file mode 100644
index ab05fee..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ParameterMode.java
+++ /dev/null
@@ -1,27 +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.api.edm.xml.v3;
-
-public enum ParameterMode {
-
- In,
- Out,
- InOut
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Property.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Property.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Property.java
deleted file mode 100644
index 950e562..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Property.java
+++ /dev/null
@@ -1,38 +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.api.edm.xml.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.CommonProperty;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmContentKind;
-
-public interface Property extends CommonProperty {
-
- String getFcSourcePath();
-
- String getFcTargetPath();
-
- EdmContentKind getFcContentKind();
-
- String getFcNSPrefix();
-
- String getFcNSURI();
-
- boolean isFcKeepInContent();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/PropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/PropertyValue.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/PropertyValue.java
deleted file mode 100644
index 08fcb5c..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/PropertyValue.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.api.edm.xml.v3;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Date;
-
-public interface PropertyValue {
-
- String getProperty();
-
- String getPath();
-
- String getString();
-
- BigInteger getInt();
-
- Double getFloat();
-
- BigDecimal getDecimal();
-
- Boolean getBool();
-
- Date getDateTime();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ReferentialConstraint.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ReferentialConstraint.java
deleted file mode 100644
index 6448304..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ReferentialConstraint.java
+++ /dev/null
@@ -1,26 +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.api.edm.xml.v3;
-
-public interface ReferentialConstraint {
-
- ReferentialConstraintRole getPrincipal();
-
- ReferentialConstraintRole getDependent();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ReferentialConstraintRole.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ReferentialConstraintRole.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ReferentialConstraintRole.java
deleted file mode 100644
index a47eb58..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ReferentialConstraintRole.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 org.apache.olingo.odata4.client.api.edm.xml.v3;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.PropertyRef;
-
-public interface ReferentialConstraintRole {
-
- String getRole();
-
- List<PropertyRef> getPropertyRefs();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/TypeAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/TypeAnnotation.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/TypeAnnotation.java
deleted file mode 100644
index 5b4792c..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/TypeAnnotation.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.api.edm.xml.v3;
-
-import java.util.List;
-
-public interface TypeAnnotation {
-
- String getTerm();
-
- String getQualifier();
-
- List<PropertyValue> getPropertyValues();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Using.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Using.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Using.java
deleted file mode 100644
index db69189..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/Using.java
+++ /dev/null
@@ -1,27 +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.api.edm.xml.v3;
-
-public interface Using {
-
- String getNamespace();
-
- String getAlias();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ValueAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ValueAnnotation.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ValueAnnotation.java
deleted file mode 100644
index 9f779ef..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ValueAnnotation.java
+++ /dev/null
@@ -1,45 +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.api.edm.xml.v3;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Date;
-
-public interface ValueAnnotation {
-
- Boolean getBool();
-
- Date getDateTime();
-
- BigDecimal getDecimal();
-
- Double getFloat();
-
- BigInteger getInt();
-
- String getPath();
-
- String getQualifier();
-
- String getString();
-
- String getTerm();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ValueTerm.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ValueTerm.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ValueTerm.java
deleted file mode 100644
index 9180086..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v3/ValueTerm.java
+++ /dev/null
@@ -1,26 +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.api.edm.xml.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.Named;
-
-public interface ValueTerm extends Named {
-
- String getType();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Action.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Action.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Action.java
deleted file mode 100644
index 5fb82d1..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Action.java
+++ /dev/null
@@ -1,36 +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.api.edm.xml.v4;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.Named;
-
-public interface Action extends Named {
-
- boolean isBound();
-
- String getEntitySetPath();
-
- List<Parameter> getParameters();
-
- Parameter getParameter(String name);
-
- ReturnType getReturnType();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ActionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ActionImport.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ActionImport.java
deleted file mode 100644
index 5338737..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ActionImport.java
+++ /dev/null
@@ -1,24 +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.api.edm.xml.v4;
-
-public interface ActionImport extends OperationImport {
-
- String getAction();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/AnnotatedEdmItem.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/AnnotatedEdmItem.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/AnnotatedEdmItem.java
deleted file mode 100644
index 484a830..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/AnnotatedEdmItem.java
+++ /dev/null
@@ -1,24 +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.api.edm.xml.v4;
-
-public interface AnnotatedEdmItem {
-
- Annotation getAnnotation();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Annotation.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Annotation.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Annotation.java
deleted file mode 100644
index b7e237f..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Annotation.java
+++ /dev/null
@@ -1,33 +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.api.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ConstExprConstruct;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-public interface Annotation {
-
- String getTerm();
-
- String getQualifier();
-
- ConstExprConstruct getConstExpr();
-
- DynExprConstruct getDynExpr();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Annotations.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Annotations.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Annotations.java
deleted file mode 100644
index 2f3e0aa..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Annotations.java
+++ /dev/null
@@ -1,29 +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.api.edm.xml.v4;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonAnnotations;
-
-public interface Annotations extends CommonAnnotations {
-
- List<? extends Annotation> getAnnotations();
-
- Annotation getAnnotation(String term);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/BindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/BindingTarget.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/BindingTarget.java
deleted file mode 100644
index 10f6007..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/BindingTarget.java
+++ /dev/null
@@ -1,27 +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.api.edm.xml.v4;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.Named;
-
-public interface BindingTarget extends Named, AnnotatedEdmItem {
-
- List<? extends NavigationPropertyBinding> getNavigationPropertyBindings();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/CSDLElement.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/CSDLElement.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/CSDLElement.java
deleted file mode 100644
index aec1c90..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/CSDLElement.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.api.edm.xml.v4;
-
-public enum CSDLElement {
-
- ActionImport,
- ComplexType,
- EntityContainer,
- EntitySet,
- EntityType,
- EnumType,
- FunctionImport,
- Member,
- NavigationProperty,
- Property,
- Singleton,
- Term,
- TypeDefinition
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ComplexType.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ComplexType.java
deleted file mode 100644
index 7515ce9..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ComplexType.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.api.edm.xml.v4;
-
-import java.util.List;
-
-public interface ComplexType extends org.apache.olingo.odata4.client.api.edm.xml.ComplexType, AnnotatedEdmItem {
-
- boolean isAbstractEntityType();
-
- String getBaseType();
-
- boolean isOpenType();
-
- @Override
- Property getProperty(String name);
-
- @Override
- List<Property> getProperties();
-
- @Override
- NavigationProperty getNavigationProperty(String name);
-
- @Override
- List<NavigationProperty> getNavigationProperties();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Edmx.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Edmx.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Edmx.java
deleted file mode 100644
index 2f2f609..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Edmx.java
+++ /dev/null
@@ -1,26 +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.api.edm.xml.v4;
-
-import java.util.List;
-
-public interface Edmx extends org.apache.olingo.odata4.client.api.edm.xml.Edmx {
-
- List<Reference> getReferences();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntityContainer.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntityContainer.java
deleted file mode 100644
index 6ed0846..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntityContainer.java
+++ /dev/null
@@ -1,44 +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.api.edm.xml.v4;
-
-import java.util.List;
-
-public interface EntityContainer extends org.apache.olingo.odata4.client.api.edm.xml.EntityContainer {
-
- EntitySet getEntitySet(String name);
-
- List<EntitySet> getEntitySets();
-
- List<Singleton> getSingletons();
-
- Singleton getSingleton(String name);
-
- ActionImport getActionImport(String name);
-
- List<ActionImport> getActionImports(String name);
-
- List<ActionImport> getActionImports();
-
- FunctionImport getFunctionImport(String name);
-
- List<FunctionImport> getFunctionImports(String name);
-
- List<FunctionImport> getFunctionImports();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntitySet.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntitySet.java
deleted file mode 100644
index b44bee2..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntitySet.java
+++ /dev/null
@@ -1,24 +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.api.edm.xml.v4;
-
-public interface EntitySet extends org.apache.olingo.odata4.client.api.edm.xml.EntitySet, BindingTarget {
-
- boolean isIncludeInServiceDocument();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntityType.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntityType.java
deleted file mode 100644
index cf736e1..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/EntityType.java
+++ /dev/null
@@ -1,23 +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.api.edm.xml.v4;
-
-public interface EntityType extends org.apache.olingo.odata4.client.api.edm.xml.EntityType, ComplexType {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Function.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Function.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Function.java
deleted file mode 100644
index 7662a2a..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Function.java
+++ /dev/null
@@ -1,24 +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.api.edm.xml.v4;
-
-public interface Function extends Action {
-
- boolean isComposable();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/FunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/FunctionImport.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/FunctionImport.java
deleted file mode 100644
index bae6a10..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/FunctionImport.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.api.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.CommonFunctionImport;
-
-public interface FunctionImport extends OperationImport, CommonFunctionImport {
-
- String getFunction();
-
- boolean isIncludeInServiceDocument();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Include.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Include.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Include.java
deleted file mode 100644
index e75f589..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Include.java
+++ /dev/null
@@ -1,26 +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.api.edm.xml.v4;
-
-public interface Include {
-
- String getAlias();
-
- String getNamespace();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/IncludeAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/IncludeAnnotations.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/IncludeAnnotations.java
deleted file mode 100644
index 0f25c35..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/IncludeAnnotations.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.api.edm.xml.v4;
-
-public interface IncludeAnnotations {
-
- String getQualifier();
-
- String getTargeyNamespace();
-
- String getTermNamespace();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/NavigationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/NavigationProperty.java
deleted file mode 100644
index d8d028d..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/NavigationProperty.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.OnDelete;
-import java.util.List;
-
-public interface NavigationProperty
- extends org.apache.olingo.odata4.client.api.edm.xml.CommonNavigationProperty, AnnotatedEdmItem {
-
- String getType();
-
- boolean isNullable();
-
- String getPartner();
-
- boolean isContainsTarget();
-
- List<ReferentialConstraint> getReferentialConstraints();
-
- OnDelete getOnDelete();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/NavigationPropertyBinding.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/NavigationPropertyBinding.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/NavigationPropertyBinding.java
deleted file mode 100644
index 6a4d460..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/NavigationPropertyBinding.java
+++ /dev/null
@@ -1,27 +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.api.edm.xml.v4;
-
-public interface NavigationPropertyBinding {
-
- String getPath();
-
- String getTarget();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/OperationImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/OperationImport.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/OperationImport.java
deleted file mode 100644
index cf86bd4..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/OperationImport.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.api.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.Named;
-
-public interface OperationImport extends Named, AnnotatedEdmItem {
-
- String getEntitySet();
-
- void setEntitySet(String entitySet);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Parameter.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Parameter.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Parameter.java
deleted file mode 100644
index 3a96af3..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Parameter.java
+++ /dev/null
@@ -1,24 +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.api.edm.xml.v4;
-
-public interface Parameter extends org.apache.olingo.odata4.client.api.edm.xml.CommonParameter {
-
- String getSrid();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Property.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Property.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Property.java
deleted file mode 100644
index feb8197..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Property.java
+++ /dev/null
@@ -1,25 +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.api.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.CommonProperty;
-
-public interface Property extends CommonProperty, AnnotatedEdmItem {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Reference.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Reference.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Reference.java
deleted file mode 100644
index 79f76e2..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Reference.java
+++ /dev/null
@@ -1,33 +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.api.edm.xml.v4;
-
-import java.net.URI;
-import java.util.List;
-
-public interface Reference {
-
- URI getUri();
-
- List<Include> getIncludes();
-
- List<IncludeAnnotations> getIncludeAnnotations();
-
- List<Annotation> getAnnotations();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ReferentialConstraint.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ReferentialConstraint.java
deleted file mode 100644
index f0063d2..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ReferentialConstraint.java
+++ /dev/null
@@ -1,27 +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.api.edm.xml.v4;
-
-public interface ReferentialConstraint {
-
- String getProperty();
-
- String getReferencedProperty();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ReturnType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ReturnType.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ReturnType.java
deleted file mode 100644
index 0157dc4..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/ReturnType.java
+++ /dev/null
@@ -1,34 +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.api.edm.xml.v4;
-
-public interface ReturnType {
-
- Integer getMaxLength();
-
- Integer getPrecision();
-
- Integer getScale();
-
- String getSrid();
-
- String getType();
-
- boolean isNullable();
-}
[23/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/URIBuilderTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/URIBuilderTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/URIBuilderTest.java
new file mode 100644
index 0000000..29069b7
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/URIBuilderTest.java
@@ -0,0 +1,136 @@
+/*
+ * 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.v4;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.olingo.client.api.ODataV4Client;
+import org.apache.olingo.client.api.uri.V4URIBuilder;
+import org.apache.olingo.client.core.AbstractTest;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class URIBuilderTest extends AbstractTest {
+
+ private static final String SERVICE_ROOT = "http://host/service";
+
+ @Override
+ protected ODataV4Client getClient() {
+ return v4Client;
+ }
+
+ @Test
+ public void count() throws URISyntaxException {
+ URI uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("Products").count().build();
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Products/$count").build(), uri);
+
+ uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("Products").count(true).build();
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Products").
+ addParameter("$count", "true").build(), uri);
+ }
+
+ @Test
+ public void singleton() throws URISyntaxException {
+ final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendSingletonSegment("BestProductEverCreated");
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/BestProductEverCreated").build(), uriBuilder.build());
+ }
+
+ @Test
+ public void entityId() throws URISyntaxException {
+ final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntityIdSegment("Products(0)");
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/$entity").addParameter("$id", "Products(0)").build(), uriBuilder.build());
+ }
+
+ @Test
+ public void boundAction() throws URISyntaxException {
+ final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("Categories").appendKeySegment(1).
+ appendNavigationSegment("Products").appendNavigationSegment("Model").
+ appendOperationCallSegment("AllOrders", null);
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/Categories(1)/Products/Model.AllOrders()").build(), uriBuilder.build());
+ }
+
+ @Test
+ public void ref() throws URISyntaxException {
+ V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("Categories").appendKeySegment(1).
+ appendNavigationSegment("Products").appendRefSegment();
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/Categories(1)/Products/$ref").build(), uriBuilder.build());
+
+ uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("Categories").appendKeySegment(1).
+ appendNavigationSegment("Products").appendRefSegment().id("../../Products(0)");
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/Categories(1)/Products/$ref").addParameter("$id", "../../Products(0)").build(),
+ uriBuilder.build());
+ }
+
+ @Test
+ public void derived() throws URISyntaxException {
+ final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("Customers").appendNavigationSegment("Model").
+ appendDerivedEntityTypeSegment("VipCustomer").appendKeySegment(1);
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/Customers/Model.VipCustomer(1)").build(), uriBuilder.build());
+ }
+
+ @Test
+ public void crossjoin() throws URISyntaxException {
+ final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendCrossjoinSegment("Products", "Sales");
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/$crossjoin(Products,Sales)").build(), uriBuilder.build());
+ }
+
+ @Test
+ public void all() throws URISyntaxException {
+ final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).appendAllSegment();
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/$all").build(), uriBuilder.build());
+ }
+
+ @Test
+ public void search() throws URISyntaxException {
+ final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("Products").search("blue OR green");
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/Products").addParameter("$search", "blue OR green").build(), uriBuilder.build());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/AbstractTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/AbstractTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/AbstractTest.java
deleted file mode 100644
index e5d76e5..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/AbstractTest.java
+++ /dev/null
@@ -1,58 +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.Locale;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.ODataV3Client;
-import org.apache.olingo.odata4.client.api.ODataV4Client;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.apache.olingo.odata4.client.api.format.ODataPubFormat;
-import org.junit.BeforeClass;
-
-public abstract class AbstractTest {
-
- protected static ODataV3Client v3Client;
-
- protected static ODataV4Client v4Client;
-
- protected abstract ODataClient getClient();
-
- /**
- * This is needed for correct number handling (Double, for example).
- */
- @BeforeClass
- public static void setEnglishLocale() {
- Locale.setDefault(Locale.ENGLISH);
- }
-
- @BeforeClass
- public static void setClientInstances() {
- v3Client = ODataClientFactory.getV3();
- v4Client = ODataClientFactory.getV4();
- }
-
- protected String getSuffix(final ODataPubFormat format) {
- return format == ODataPubFormat.ATOM ? "xml" : "json";
- }
-
- protected String getSuffix(final ODataFormat format) {
- return format == ODataFormat.XML ? "xml" : "json";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/ODataClientTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/ODataClientTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/ODataClientTest.java
deleted file mode 100644
index 0dc7004..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/ODataClientTest.java
+++ /dev/null
@@ -1,40 +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 static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertEquals;
-
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-import org.junit.Test;
-
-public class ODataClientTest {
-
- @Test
- public void before() {
- ODataClient client = ODataClientFactory.getV3();
- assertNotNull(client);
- assertEquals(ODataServiceVersion.V30, client.getServiceVersion());
-
- client = ODataClientFactory.getV4();
- assertNotNull(client);
- assertEquals(ODataServiceVersion.V40, client.getServiceVersion());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderPerformance.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderPerformance.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderPerformance.java
deleted file mode 100644
index 12d1bca..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderPerformance.java
+++ /dev/null
@@ -1,75 +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 static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.InputStream;
-import org.apache.commons.io.IOUtils;
-
-import org.apache.olingo.odata4.client.api.deserializer.ComplexValue;
-import org.apache.olingo.odata4.client.api.deserializer.Property;
-import org.apache.olingo.odata4.client.api.deserializer.StructuralProperty;
-import org.apache.olingo.odata4.client.api.deserializer.Value;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JsonReaderPerformance {
-
- private static final Logger LOG = LoggerFactory.getLogger(JsonReaderPerformance.class);
-
- @Test
- public void testComplexPropertyPerformance() throws Exception {
- JsonReader consumer = new JsonReader();
- int runs = 1000; // * 100;
-
- InputStream in = JsonReaderPerformance.class.getResourceAsStream("/complexProperty.json");
- String content = IOUtils.toString(in);
-
- LOG.debug("Started...");
- ComplexValue complex = null;
- long startTime = System.currentTimeMillis();
- for (int i = 0; i < runs; i++) {
- Property property = consumer.readProperty(IOUtils.toInputStream(content));
- complex = (ComplexValue) ((StructuralProperty) property).getValue();
- }
- long endTime = System.currentTimeMillis();
-
- long duration = endTime - startTime;
- LOG.debug("Duration: " + duration + " ms");
- LOG.debug("Duration per run: " + (duration / (float) runs) + " ms");
- testComplexProperty(complex);
- }
-
- private void testComplexProperty(final Value value) {
- assertNotNull(value);
- assertTrue(value.isComplex());
-
- ComplexValue complex = (ComplexValue) value;
-
- assertEquals("Obere Str. 57", complex.getValue("Street").getContent());
- assertEquals("Berlin", complex.getValue("City").getContent());
- assertNull(complex.getValue("Region").getContent());
- assertEquals("D-12209", complex.getValue("PostalCode").getContent());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderTest.java
deleted file mode 100644
index 353ee1a..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/deserializer/JsonReaderTest.java
+++ /dev/null
@@ -1,371 +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 static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.olingo.odata4.client.api.deserializer.ComplexValue;
-import org.apache.olingo.odata4.client.api.deserializer.Entity;
-import org.apache.olingo.odata4.client.api.deserializer.EntitySet;
-import org.apache.olingo.odata4.client.api.deserializer.Property;
-import org.apache.olingo.odata4.client.api.deserializer.Reader;
-import org.apache.olingo.odata4.client.api.deserializer.StructuralProperty;
-import org.apache.olingo.odata4.client.api.deserializer.Value;
-import org.junit.Test;
-
-public class JsonReaderTest {
-
- @Test
- public void testEntitySet() throws Exception {
- Reader consumer = new JsonReader();
-
- EntitySet entitySet = consumer.readEntitySet(
- JsonReaderTest.class.getResourceAsStream("/fullEntitySet.json"));
-
- List<Entity> entities = entitySet.getEntities();
- validateEntitySet(entitySet);
- assertNotNull(entities);
- Entity entity = entities.get(0);
- assertNotNull(entity);
- validateEntityAlfki(entity);
-
- StructuralProperty structuralProperty = entity.getProperty("Address", StructuralProperty.class);
- assertEquals("Address", structuralProperty.getName());
-
- Value value = structuralProperty.getValue();
- assertTrue(value.isComplex());
- ComplexValue complexValue = (ComplexValue) value;
- validateAddressBerlin(complexValue);
- validateComplexValueNavigationLinks(complexValue);
- }
-
- @Test
- public void testEntitySetWithTwoEntities() throws Exception {
- Reader consumer = new JsonReader();
-
- EntitySet entitySet = consumer.readEntitySet(getJson("/fullEntitySetWithTwoEntities.json"));
-
- List<Entity> entities = entitySet.getEntities();
- validateEntitySet(entitySet);
- assertNotNull(entities);
- assertEquals(2, entities.size());
- //
- Entity firstEntity = entities.get(0);
- assertNotNull(firstEntity);
- validateEntityAlfki(firstEntity);
-
- StructuralProperty structuralProperty = firstEntity.getProperty("Address", StructuralProperty.class);
- assertEquals("Address", structuralProperty.getName());
-
- Value value = structuralProperty.getValue();
- assertTrue(value.isComplex());
- ComplexValue complexValue = (ComplexValue) value;
- validateAddressBerlin(complexValue);
- validateComplexValueNavigationLinks(complexValue);
-
- //
- Entity secondEntity = entities.get(1);
- assertNotNull(secondEntity);
- validateEntityMuski(secondEntity);
-
- StructuralProperty addressMuster = secondEntity.getProperty("Address", StructuralProperty.class);
- assertEquals("Address", addressMuster.getName());
- validateAddressMuster((ComplexValue) addressMuster.getValue());
- }
-
- @Test
- public void streamingTestForEntitySetWithTwoEntities() throws Exception {
- Reader consumer = new JsonReader();
-
- EntitySet entitySet = consumer.readEntitySet(getJson("/fullEntitySetWithTwoEntities.json"));
- validateEntitySet(entitySet, false);
-
- for (Entity entity : entitySet) {
- if ("Customers('ALFKI')".equals(entity.getODataId())) {
- validateEntityAlfki(entity);
-
- StructuralProperty structuralProperty = entity.getProperty("Address", StructuralProperty.class);
- assertEquals("Address", structuralProperty.getName());
-
- Value value = structuralProperty.getValue();
- assertTrue(value.isComplex());
- ComplexValue complexValue = (ComplexValue) value;
- validateAddressBerlin(complexValue);
- validateComplexValueNavigationLinks(complexValue);
- } else if ("Customers('MUSKI')".equals(entity.getODataId())) {
- validateEntityMuski(entity);
-
- StructuralProperty addressMuster = entity.getProperty("Address", StructuralProperty.class);
- assertEquals("Address", addressMuster.getName());
- validateAddressMuster((ComplexValue) addressMuster.getValue());
- } else {
- fail("Got unknown entity with id '" + entity.getODataId() + "'.");
- }
- }
-
- validateEntitySet(entitySet, true);
- }
-
- @Test
- public void iteratorTestForEntitySetWithTwoEntities() throws Exception {
- Reader consumer = new JsonReader();
-
- EntitySet entitySet = consumer.readEntitySet(getJson("/fullEntitySetWithTwoEntities.json"));
- assertEquals(2, entitySet.getEntities().size());
- validateEntitySet(entitySet, true);
-
- for (Entity entity : entitySet) {
- if ("Customers('ALFKI')".equals(entity.getODataId())) {
- validateEntityAlfki(entity);
-
- StructuralProperty structuralProperty = entity.getProperty("Address", StructuralProperty.class);
- assertEquals("Address", structuralProperty.getName());
-
- Value value = structuralProperty.getValue();
- assertTrue(value.isComplex());
- ComplexValue complexValue = (ComplexValue) value;
- validateAddressBerlin(complexValue);
- validateComplexValueNavigationLinks(complexValue);
- } else if ("Customers('MUSKI')".equals(entity.getODataId())) {
- validateEntityMuski(entity);
-
- StructuralProperty addressMuster = entity.getProperty("Address", StructuralProperty.class);
- assertEquals("Address", addressMuster.getName());
- validateAddressMuster((ComplexValue) addressMuster.getValue());
- } else {
- fail("Got unknown entity with id '" + entity.getODataId() + "'.");
- }
- }
- }
-
- @Test
- public void testEntity() throws Exception {
- Reader consumer = new JsonReader();
-
- Entity entity = consumer.readEntity(JsonReaderTest.class.getResourceAsStream("/fullEntity.json"));
- validateEntityAlfki(entity);
-
- StructuralProperty structuralProperty = entity.getProperty("Address", StructuralProperty.class);
- assertEquals("Address", structuralProperty.getName());
-
- Value value = structuralProperty.getValue();
- assertTrue(value.isComplex());
- ComplexValue complexValue = (ComplexValue) value;
- validateAddressBerlin(complexValue);
- validateComplexValueNavigationLinks(complexValue);
- }
-
- @Test
- public void testComplexProperty() throws Exception {
- Reader consumer = new JsonReader();
-
- Property property = consumer.readProperty(getJson("/complexProperty.json"));
- assertEquals("Address", property.getName());
-
- assertTrue(property instanceof StructuralProperty);
- StructuralProperty structuralProperty = (StructuralProperty) property;
- Value value = structuralProperty.getValue();
- assertTrue(value.isComplex());
- ComplexValue complexValue = (ComplexValue) value;
- validateAddressBerlin(complexValue);
- validateAddressBerlin(complexValue);
- }
-
- @Test
- public void testEntityWithCollectionOfComplexProperty() throws Exception {
- Reader consumer = new JsonReader();
-
- Entity entity = consumer.readEntity(getJson("/fullEntityWithCollectionOfComplexValues.json"));
- StructuralProperty address = entity.getProperty("Address", StructuralProperty.class);
- assertTrue(address.containsCollection());
- assertEquals("Address", address.getName());
-
- List<Value> values = address.getValues();
- assertEquals(2, values.size());
-
- Value value = values.get(0);
- assertTrue(value.isComplex());
- validateAddressBerlin((ComplexValue) value);
- //
- ComplexValue addressTwo = (ComplexValue) values.get(1);
- validateAddressMuster(addressTwo);
- }
-
- @Test
- public void testSetOfPrimitive() throws Exception {
- Reader consumer = new JsonReader();
-
- InputStream content = JsonReaderTest.class.getResourceAsStream("/setOfPrimitiveProperties.json");
- Property property = consumer.readProperty(content);
- assertEquals("EmailAddresses", property.getName());
-
- assertTrue(property instanceof StructuralProperty);
- StructuralProperty structuralProperty = (StructuralProperty) property;
-
- assertTrue(structuralProperty.containsCollection());
- Collection<Value> values = structuralProperty.getValues();
- Iterator<Value> valueIt = values.iterator();
- assertEquals("Julie@Swansworth.com", valueIt.next().getContent());
- assertEquals("Julie.Swansworth@work.com", valueIt.next().getContent());
- }
-
- @Test
- public void testSetOfComplex() throws Exception {
- Reader consumer = new JsonReader();
-
- InputStream content = JsonReaderTest.class.getResourceAsStream("/setOfComplexProperties.json");
- Property property = consumer.readProperty(content);
- assertEquals("PhoneNumbers", property.getName());
- assertTrue(property instanceof StructuralProperty);
-
- StructuralProperty structuralProperty = (StructuralProperty) property;
- assertTrue(structuralProperty.containsCollection());
- List<Value> values = structuralProperty.getValues();
- assertEquals(2, values.size());
-
- ComplexValue phoneNumberOne = (ComplexValue) values.get(0);
- assertEquals("425-555-1212", phoneNumberOne.getValue("Number").getContent());
- assertEquals("Home", phoneNumberOne.getValue("Type").getContent());
- assertEquals(null, phoneNumberOne.getValue("Carrier"));
- assertEquals(null, phoneNumberOne.getAnnotationProperties().get("odata.type"));
-
- ComplexValue phoneNumberTwo = (ComplexValue) values.get(1);
- assertEquals("425-555-0178", phoneNumberTwo.getValue("Number").getContent());
- assertEquals("Cell", phoneNumberTwo.getValue("Type").getContent());
- assertEquals("Sprint", phoneNumberTwo.getValue("Carrier").getContent());
- assertEquals("#Model.CellPhoneNumber",
- phoneNumberTwo.getAnnotationProperties().get("odata.type").getValue());
-
- // ComplexValue complex = consumer.parseComplexValue(content);
- //
- // Value value = complex.getValue("PhoneNumbers");
- // assertNotNull(value);
- // assertTrue(value.isComplex());
- // ComplexValue complexValue = (ComplexValue) value;
- }
-
- private void validateEntityAlfki(final Entity entity) {
- assertNotNull(entity);
-
- assertEquals("http://host/service/$metadata#Customers/$entity", entity.getODataContext());
- assertEquals("Customers('ALFKI')", entity.getODataId());
- assertEquals("W/\"MjAxMy0wNS0yN1QxMTo1OFo=\"", entity.getODataETag());
- assertEquals("Customers('ALFKI')", entity.getODataEditLink());
-
- assertNotNull(entity.getNavigationProperties());
- assertTrue(entity.getNavigationProperties().containsKey("Orders"));
- assertEquals("Customers('ALFKI')/Orders",
- entity.getNavigationProperties().get("Orders").getNavigationLink());
-
- assertNotNull(entity.getNavigationProperties());
- assertTrue(entity.getNavigationProperties().containsKey("Orders"));
- assertEquals("Customers('ALFKI')/Orders/$ref",
- entity.getNavigationProperties().get("Orders").getAssociationLink());
-
- assertNotNull(entity.getPropertyContent("ID"));
- assertEquals("ALFKI", entity.getPropertyContent("ID"));
- assertEquals("Alfreds Futterkiste", entity.getPropertyContent("CompanyName"));
- assertEquals("Maria Anders", entity.getPropertyContent("ContactName"));
- assertEquals("Sales Representative", entity.getPropertyContent("ContactTitle"));
- assertEquals("030-0074321", entity.getPropertyContent("Phone"));
- assertEquals("030-0076545", entity.getPropertyContent("Fax"));
- }
-
- private void validateEntityMuski(final Entity entity) {
- assertNotNull(entity);
-
- assertEquals("http://host/service/$metadata#Customers/$entity", entity.getODataContext());
- assertEquals("Customers('MUSKI')", entity.getODataId());
- assertEquals("W/\"MjAxMy0wNS0yN1QxMTo1OFo=\"", entity.getODataETag());
- assertEquals("Customers('MUSKI')", entity.getODataEditLink());
-
- assertNotNull(entity.getNavigationProperties());
- assertTrue(entity.getNavigationProperties().containsKey("Orders"));
- assertEquals("Customers('MUSKI')/Orders", entity.getNavigationProperties().get("Orders").getNavigationLink());
-
- assertNotNull(entity.getNavigationProperties());
- assertTrue(entity.getNavigationProperties().containsKey("Orders"));
- assertEquals("Customers('MUSKI')/Orders/$ref",
- entity.getNavigationProperties().get("Orders").getAssociationLink());
-
- assertNotNull(entity.getPropertyContent("ID"));
- assertEquals("MUSKI", entity.getPropertyContent("ID"));
- assertEquals("Mustermanns Futterkiste", entity.getPropertyContent("CompanyName"));
- assertEquals("Mustermann Max", entity.getPropertyContent("ContactName"));
- assertEquals("Some Guy", entity.getPropertyContent("ContactTitle"));
- assertEquals("030-002222", entity.getPropertyContent("Phone"));
- assertEquals("030-004444", entity.getPropertyContent("Fax"));
- }
-
- private void validateAddressMuster(final ComplexValue addressTwo) {
- assertEquals("Musterstrasse 42", addressTwo.getValue("Street").getContent());
- assertEquals("Musterstadt", addressTwo.getValue("City").getContent());
- assertEquals("SomeRegion", addressTwo.getValue("Region").getContent());
- assertEquals("D-42042", addressTwo.getValue("PostalCode").getContent());
- }
-
- private void validateAddressBerlin(final ComplexValue complex) {
- assertNotNull(complex);
-
- assertEquals("Obere Str. 57", complex.getValue("Street").getContent());
- assertEquals("Berlin", complex.getValue("City").getContent());
- assertNull(complex.getValue("Region").getContent());
- assertEquals("D-12209", complex.getValue("PostalCode").getContent());
- }
-
- private void validateComplexValueNavigationLinks(final ComplexValue complex) {
- assertNotNull(complex.getNavigationProperties());
- assertTrue(complex.getNavigationProperties().containsKey("Country"));
- assertEquals("Customers('ALFKI')/Address/Country",
- complex.getNavigationProperties().get("Country").getNavigationLink());
-
- assertNotNull(complex.getNavigationProperties());
- assertTrue(complex.getNavigationProperties().containsKey("Country"));
- assertEquals("Customers('ALFKI')/Address/Country/$ref",
- complex.getNavigationProperties().get("Country").getAssociationLink());
- }
-
- private void validateEntitySet(final EntitySet entitySet) {
- validateEntitySet(entitySet, true);
- }
-
- private void validateEntitySet(final EntitySet entitySet, final boolean validateLinks) {
- assertNotNull(entitySet);
-
- assertEquals("http://host/service/$metadata#Customers/$entity", entitySet.getODataContext());
- assertEquals(Long.valueOf(1), entitySet.getODataCount());
- if (validateLinks) {
- assertEquals("http://host/service/EntitySet?$skiptoken=342r89", entitySet.getODataNextLink());
- assertNull(entitySet.getODataDeltaLink());
- }
- }
-
- private InputStream getJson(final String filename) {
- return JsonReaderTest.class.getResourceAsStream(filename);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/FilterFactoryTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/FilterFactoryTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/FilterFactoryTest.java
deleted file mode 100644
index cab82b1..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/FilterFactoryTest.java
+++ /dev/null
@@ -1,166 +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.v3;
-
-import org.apache.olingo.odata4.client.api.ODataV3Client;
-import static org.junit.Assert.assertEquals;
-
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-import org.apache.olingo.odata4.client.api.uri.filter.V3FilterArgFactory;
-import org.apache.olingo.odata4.client.api.uri.filter.V3FilterFactory;
-import org.apache.olingo.odata4.client.core.AbstractTest;
-import org.junit.Test;
-
-public class FilterFactoryTest extends AbstractTest {
-
- @Override
- protected ODataV3Client getClient() {
- return v3Client;
- }
-
- private V3FilterFactory getFilterFactory() {
- return getClient().getFilterFactory();
- }
-
- private V3FilterArgFactory getFilterArgFactory() {
- return getFilterFactory().getArgFactory();
- }
-
- @Test
- public void simple() {
- final URIFilter filter = getFilterFactory().lt("VIN", 16);
- assertEquals("(VIN lt 16)", filter.build());
- }
-
- @Test
- public void _null() {
- final URIFilter filter = getFilterFactory().eq(
- getFilterArgFactory().property("NullValue"), getFilterArgFactory()._null());
-
- assertEquals("(NullValue eq null)", filter.build());
- }
-
- @Test
- public void and() {
- final URIFilter filter = getFilterFactory().and(
- getFilterFactory().lt("VIN", 16),
- getFilterFactory().gt("VIN", 12));
-
- assertEquals("((VIN lt 16) and (VIN gt 12))", filter.build());
- }
-
- @Test
- public void not() {
- final URIFilter filter = getFilterFactory().not(
- getFilterFactory().or(
- getFilterFactory().ge("VIN", 16),
- getFilterFactory().le("VIN", 12)));
-
- assertEquals("not (((VIN ge 16) or (VIN le 12)))", filter.build());
- }
-
- @Test
- public void operator() {
- URIFilter filter = getFilterFactory().eq(
- getFilterArgFactory().add(
- getFilterArgFactory().property("VIN"),
- getFilterArgFactory().literal(1)),
- getFilterArgFactory().literal(16));
-
- assertEquals("((VIN add 1) eq 16)", filter.build());
-
- filter = getFilterFactory().eq(
- getFilterArgFactory().add(
- getFilterArgFactory().literal(1),
- getFilterArgFactory().property("VIN")),
- getFilterArgFactory().literal(16));
-
- assertEquals("((1 add VIN) eq 16)", filter.build());
-
- filter = getFilterFactory().eq(
- getFilterArgFactory().literal(16),
- getFilterArgFactory().add(
- getFilterArgFactory().literal(1),
- getFilterArgFactory().property("VIN")));
-
- assertEquals("(16 eq (1 add VIN))", filter.build());
- }
-
- @Test
- public void function() {
- final URIFilter filter = getFilterFactory().match(
- getFilterArgFactory().startswith(
- getFilterArgFactory().property("Description"),
- getFilterArgFactory().literal("cen")));
-
- assertEquals("startswith(Description,'cen')", filter.build());
- }
-
- @Test
- public void composed() {
- final URIFilter filter = getFilterFactory().gt(
- getFilterArgFactory().length(
- getFilterArgFactory().property("Description")),
- getFilterArgFactory().add(
- getFilterArgFactory().property("VIN"),
- getFilterArgFactory().literal(10)));
-
- assertEquals("(length(Description) gt (VIN add 10))", filter.build());
- }
-
- @Test
- public void propertyPath() {
- URIFilter filter = getFilterFactory().eq(
- getFilterArgFactory().indexof(
- getFilterArgFactory().property("PrimaryContactInfo/HomePhone/PhoneNumber"),
- getFilterArgFactory().literal("ODataJClient")),
- getFilterArgFactory().literal(1));
-
- assertEquals("(indexof(PrimaryContactInfo/HomePhone/PhoneNumber,'ODataJClient') eq 1)", filter.build());
-
- filter = getFilterFactory().ne(
- getFilterArgFactory().indexof(
- getFilterArgFactory().property("PrimaryContactInfo/HomePhone/PhoneNumber"),
- getFilterArgFactory().literal("lccvussrv")),
- getFilterArgFactory().literal(-1));
-
- assertEquals("(indexof(PrimaryContactInfo/HomePhone/PhoneNumber,'lccvussrv') ne -1)", filter.build());
- }
-
- @Test
- public void datetime() {
- final URIFilter filter = getFilterFactory().eq(
- getFilterArgFactory().month(
- getFilterArgFactory().property("PurchaseDate")),
- getFilterArgFactory().literal(12));
-
- assertEquals("(month(PurchaseDate) eq 12)", filter.build());
- }
-
- @Test
- public void isof() {
- final URIFilter filter = getFilterFactory().match(
- getFilterArgFactory().isof(
- getFilterArgFactory().literal(
- "Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee")));
-
- assertEquals("isof('Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee')", filter.build());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/MetadataTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/MetadataTest.java
deleted file mode 100644
index 96fb8ff..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/MetadataTest.java
+++ /dev/null
@@ -1,223 +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.v3;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.apache.olingo.odata4.client.api.ODataV3Client;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityType;
-import org.apache.olingo.odata4.client.api.edm.xml.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.api.http.HttpMethod;
-import org.apache.olingo.odata4.client.core.AbstractTest;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImportInfo;
-import org.apache.olingo.odata4.commons.api.edm.EdmBindingTarget;
-import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImportInfo;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
-import org.junit.Test;
-
-public class MetadataTest extends AbstractTest {
-
- @Override
- protected ODataV3Client getClient() {
- return v3Client;
- }
-
- @Test
- public void parse() {
- final XMLMetadata metadata = getClient().getDeserializer().
- toMetadata(getClass().getResourceAsStream("metadata.xml"));
- assertNotNull(metadata);
-
- final EntityType order = metadata.getSchemas().get(0).getEntityType("Order");
- assertNotNull(order);
- assertEquals("Order", order.getName());
-
- @SuppressWarnings("unchecked")
- final List<FunctionImport> functionImports = (List<FunctionImport>) metadata.getSchemas().get(0).
- getDefaultEntityContainer().getFunctionImports();
- int legacyGetters = 0;
- int legacyPosters = 0;
- int actions = 0;
- int functions = 0;
- for (FunctionImport functionImport : functionImports) {
- if (HttpMethod.GET.name().equals(functionImport.getHttpMethod())) {
- legacyGetters++;
- } else if (HttpMethod.POST.name().equals(functionImport.getHttpMethod())) {
- legacyPosters++;
- } else if (functionImport.getHttpMethod() == null) {
- if (functionImport.isSideEffecting()) {
- actions++;
- } else {
- functions++;
- }
- }
- }
- assertEquals(6, legacyGetters);
- assertEquals(1, legacyPosters);
- assertEquals(5, actions);
- assertEquals(0, functions);
- }
-
- @Test
- public void multipleSchemas() {
- final XMLMetadata metadata = getClient().getDeserializer().
- toMetadata(getClass().getResourceAsStream("northwind-metadata.xml"));
- assertNotNull(metadata);
-
- final Schema first = metadata.getSchema("NorthwindModel");
- assertNotNull(first);
-
- final Schema second = metadata.getSchema("ODataWebV3.Northwind.Model");
- assertNotNull(second);
-
- final EntityContainer entityContainer = second.getDefaultEntityContainer();
- assertNotNull(entityContainer);
- assertEquals("NorthwindEntities", entityContainer.getName());
- }
-
- @Test
- public void complexAndEntityType() {
- final Edm metadata = getClient().getReader().
- readMetadata(getClass().getResourceAsStream("metadata.xml"));
- assertNotNull(metadata);
-
- final EdmEntityContainer container = metadata.getEntityContainer(
- new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "DefaultContainer"));
- assertNotNull(container);
-
- final EdmComplexType complex = metadata.getComplexType(
- new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "ContactDetails"));
- assertNotNull(complex);
- assertFalse(complex.getPropertyNames().isEmpty());
- assertTrue(complex.getProperty("EmailBag").isCollection());
-
- final EdmEntityType entity = metadata.getEntityType(
- new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "ProductReview"));
- assertNotNull(entity);
- assertFalse(entity.getPropertyNames().isEmpty());
- assertEquals(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance(),
- entity.getProperty("ProductId").getType());
-
- assertFalse(entity.getKeyPropertyRefs().isEmpty());
- assertNotNull("ProductId", entity.getKeyPropertyRef("ProductId").getKeyPropertyName());
- }
-
- @Test
- public void functionImport() {
- final Edm metadata = getClient().getReader().
- readMetadata(getClass().getResourceAsStream("metadata.xml"));
- assertNotNull(metadata);
-
- final Set<String> actionImports = new HashSet<String>();
- for (EdmActionImportInfo info : metadata.getServiceMetadata().getActionImportInfos()) {
- actionImports.add(info.getActionImportName());
- }
- final Set<String> expectedAI = new HashSet<String>(Arrays.asList(new String[]{
- "ResetDataSource",
- "IncreaseSalaries",
- "Sack",
- "GetComputer",
- "ChangeProductDimensions",
- "ResetComputerDetailsSpecifications"}));
- assertEquals(expectedAI, actionImports);
- final Set<String> functionImports = new HashSet<String>();
- for (EdmFunctionImportInfo info : metadata.getServiceMetadata().getFunctionImportInfos()) {
- functionImports.add(info.getFunctionImportName());
- }
- final Set<String> expectedFI = new HashSet<String>(Arrays.asList(new String[]{
- "GetPrimitiveString",
- "GetSpecificCustomer",
- "GetCustomerCount",
- "GetArgumentPlusOne",
- "EntityProjectionReturnsCollectionOfComplexTypes",
- "InStreamErrorGetCustomer"}));
- assertEquals(expectedFI, functionImports);
-
- final EdmEntityContainer container = metadata.getEntityContainer(
- new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "DefaultContainer"));
- assertNotNull(container);
-
- final EdmFunctionImport getArgumentPlusOne = container.getFunctionImport("GetArgumentPlusOne");
- assertNotNull(getArgumentPlusOne);
- assertEquals(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance(),
- getArgumentPlusOne.getFunction(null).getReturnType().getType());
-
- final EdmActionImport resetDataSource = container.getActionImport("ResetDataSource");
- assertNotNull(resetDataSource);
- assertTrue(resetDataSource.getAction().getParameterNames().isEmpty());
- assertNull(resetDataSource.getAction().getReturnType());
-
- final EdmEntityType computer = metadata.getEntityType(new FullQualifiedName(container.getNamespace(), "Computer"));
- assertNotNull(computer);
-
- final EdmFunction getComputer = metadata.getFunction(
- new FullQualifiedName(container.getNamespace(), "GetComputer"),
- new FullQualifiedName(container.getNamespace(), computer.getName()),
- Boolean.FALSE, Arrays.asList(new String[]{"computer"}));
- assertNotNull(getComputer);
- assertEquals(computer, getComputer.getParameter("computer").getType());
- assertEquals(computer, getComputer.getReturnType().getType());
-
- final EdmAction resetDataSource2 = metadata.getAction(
- new FullQualifiedName(container.getNamespace(), "ResetDataSource"), null, Boolean.FALSE);
- assertNotNull(resetDataSource2);
- }
-
- @Test
- public void navigation() {
- final Edm metadata = getClient().getReader().
- readMetadata(getClass().getResourceAsStream("metadata.xml"));
- assertNotNull(metadata);
-
- final EdmEntityContainer container = metadata.getEntityContainer(
- new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "DefaultContainer"));
- assertNotNull(container);
-
- final EdmEntitySet customer = container.getEntitySet("Customer");
- assertNotNull(customer);
-
- final EdmBindingTarget order = customer.getRelatedBindingTarget("Orders");
- assertNotNull(order);
- assertTrue(order instanceof EdmEntitySet);
-
- final EdmBindingTarget customerBindingTarget = ((EdmEntitySet) order).getRelatedBindingTarget("Customer");
- assertEquals(customer.getEntityType().getName(), customerBindingTarget.getEntityType().getName());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/ServiceDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/ServiceDocumentTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/ServiceDocumentTest.java
deleted file mode 100644
index ebcc00a..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/ServiceDocumentTest.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.v3;
-
-import org.apache.olingo.odata4.client.api.ODataV3Client;
-import org.apache.olingo.odata4.client.api.domain.ODataServiceDocument;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.apache.olingo.odata4.client.core.AbstractTest;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class ServiceDocumentTest extends AbstractTest {
-
- @Override
- protected ODataV3Client getClient() {
- return v3Client;
- }
-
- private String getFileExtension(final ODataFormat format) {
- return format == ODataFormat.XML ? "xml" : "json";
- }
-
- private void parse(final ODataFormat format) {
- final ODataServiceDocument serviceDocument = getClient().getReader().readServiceDocument(
- getClass().getResourceAsStream("serviceDocument." + getFileExtension(format)), format);
- assertNotNull(serviceDocument);
- assertTrue(serviceDocument.getEntitySetTitles().contains("Persons"));
- }
-
- @Test
- public void json() {
- parse(ODataFormat.JSON);
- }
-
- @Test
- public void xml() {
- parse(ODataFormat.XML);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/URIBuilderTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/URIBuilderTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/URIBuilderTest.java
deleted file mode 100644
index 0e3c642..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v3/URIBuilderTest.java
+++ /dev/null
@@ -1,130 +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.v3;
-
-import static org.junit.Assert.assertEquals;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.olingo.odata4.client.api.ODataV3Client;
-import org.apache.olingo.odata4.client.api.uri.V3URIBuilder;
-import org.apache.olingo.odata4.client.core.AbstractTest;
-import org.junit.Test;
-
-public class URIBuilderTest extends AbstractTest {
-
- private static final String SERVICE_ROOT = "http://host/service";
-
- @Override
- protected ODataV3Client getClient() {
- return v3Client;
- }
-
- @Test
- public void metadata() throws URISyntaxException {
- final URI uri = getClient().getURIBuilder(SERVICE_ROOT).appendMetadataSegment().build();
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/$metadata").build(), uri);
- }
-
- @Test
- public void entity() throws URISyntaxException {
- final URI uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("AnEntitySet").
- appendKeySegment(11).build();
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/AnEntitySet(11)").build(), uri);
-
- final Map<String, Object> multiKey = new HashMap<String, Object>();
- multiKey.put("OrderId", -10);
- multiKey.put("ProductId", -10);
- V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("OrderLine").appendKeySegment(multiKey).
- appendPropertySegment("Quantity").appendValueSegment();
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/OrderLine(OrderId=-10,ProductId=-10)/Quantity/$value").build(), uriBuilder.build());
-
- uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("Customer").appendKeySegment(-10).
- select("CustomerId", "Name", "Orders").expand("Orders");
- assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Customer(-10)").
- addParameter("$select", "CustomerId,Name,Orders").addParameter("$expand", "Orders").build(),
- uriBuilder.build());
-
- uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("Customer").appendKeySegment(-10).appendLinksSegment("Orders");
- assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Customer(-10)/$links/Orders").build(),
- uriBuilder.build());
- }
-
- @Test
- public void count() throws URISyntaxException {
- URI uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("Products").count().build();
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Products/$count").build(), uri);
-
- uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("Products").
- inlineCount(V3URIBuilder.InlineCount.allpages).build();
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Products").
- addParameter("$inlinecount", "allpages").build(), uri);
- }
-
- @Test
- public void filter() throws URISyntaxException {
- final V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("AnEntitySet").
- filter(getClient().getFilterFactory().lt("VIN", 16));
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/AnEntitySet").
- addParameter("$filter", "(VIN lt 16)").build(),
- uriBuilder.build());
- }
-
- @Test
- public void unboundAction() throws URISyntaxException {
- final V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendOperationCallSegment("ProductsByCategoryId",
- Collections.<String, Object>singletonMap("categoryId", 2));
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/ProductsByCategoryId(categoryId=2)").build(), uriBuilder.build());
- }
-
- @Test
- public void boundAction() throws URISyntaxException {
- final V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("Products").appendOperationCallSegment("MostExpensive", null);
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/Products/MostExpensive").build(), uriBuilder.build());
- }
-
- @Test
- public void derived() throws URISyntaxException {
- final V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("Customers").appendNavigationSegment("Model").
- appendDerivedEntityTypeSegment("Namespace.VipCustomer").appendKeySegment(1);
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/Customers/Model/Namespace.VipCustomer(1)").build(), uriBuilder.build());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/FilterFactoryTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/FilterFactoryTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/FilterFactoryTest.java
deleted file mode 100644
index 72e6a7d..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/FilterFactoryTest.java
+++ /dev/null
@@ -1,84 +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.v4;
-
-import org.apache.olingo.odata4.client.api.ODataV4Client;
-import static org.junit.Assert.assertEquals;
-
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-import org.apache.olingo.odata4.client.api.uri.filter.V4FilterArgFactory;
-import org.apache.olingo.odata4.client.api.uri.filter.V4FilterFactory;
-import org.apache.olingo.odata4.client.core.AbstractTest;
-import org.apache.olingo.odata4.client.core.edm.EdmEnumTypeImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.EnumTypeImpl;
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.junit.Test;
-
-public class FilterFactoryTest extends AbstractTest {
-
- @Override
- protected ODataV4Client getClient() {
- return v4Client;
- }
-
- private V4FilterFactory getFilterFactory() {
- return getClient().getFilterFactory();
- }
-
- private V4FilterArgFactory getFilterArgFactory() {
- return getFilterFactory().getArgFactory();
- }
-
- @Test
- public void has() {
- final EdmEnumType pattern = new EdmEnumTypeImpl(
- null, new FullQualifiedName("Sales", "Pattern"), new EnumTypeImpl());
- final URIFilter filter = getFilterFactory().has(getFilterArgFactory().property("style"), pattern, "Yellow");
-
- assertEquals("(style has Sales.Pattern'Yellow')", filter.build());
- }
-
- @Test
- public void contains() {
- final URIFilter filter = getFilterFactory().match(
- getFilterArgFactory().contains(
- getFilterArgFactory().property("CompanyName"), getFilterArgFactory().literal("Alfreds")));
-
- assertEquals("contains(CompanyName,'Alfreds')", filter.build());
- }
-
- @Test
- public void maxdatetime() {
- final URIFilter filter = getFilterFactory().eq(
- getFilterArgFactory().property("EndTime"),
- getFilterArgFactory().maxdatetime());
-
- assertEquals("(EndTime eq maxdatetime())", filter.build());
- }
-
- @Test
- public void any() {
- final URIFilter filter = getFilterFactory().match(
- getFilterArgFactory().any(getFilterArgFactory().property("Items"),
- getFilterFactory().gt("d:d/Quantity", 100)));
-
- assertEquals("Items/any(d:d/Quantity gt 100)", filter.build());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/MetadataTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/MetadataTest.java
deleted file mode 100644
index 2f9f4e7..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/MetadataTest.java
+++ /dev/null
@@ -1,286 +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.v4;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.olingo.odata4.client.api.ODataV4Client;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotations;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ComplexType;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntityType;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Function;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.FunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Singleton;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.XMLMetadata;
-import org.apache.olingo.odata4.client.core.AbstractTest;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.annotation.Apply;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.annotation.Collection;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.annotation.ConstExprConstructImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.annotation.Path;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImportInfo;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-import org.apache.olingo.odata4.commons.api.edm.constants.StoreGeneratedPattern;
-import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
-import org.junit.Test;
-
-public class MetadataTest extends AbstractTest {
-
- @Override
- protected ODataV4Client getClient() {
- return v4Client;
- }
-
- @Test
- public void parse() {
- final Edm edm = getClient().getReader().
- readMetadata(getClass().getResourceAsStream("metadata.xml"));
- assertNotNull(edm);
-
- // 1. Enum
- final EdmEnumType responseEnumType = edm.getEnumType(
- new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "ResponseType"));
- assertNotNull(responseEnumType);
- assertEquals(6, responseEnumType.getMemberNames().size());
- assertEquals("3", responseEnumType.getMember("Accepted").getValue());
- assertEquals(EdmTypeKind.ENUM, responseEnumType.getKind());
-
- // 2. Complex
- final EdmComplexType responseStatus = edm.getComplexType(
- new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "ResponseStatus"));
- assertNotNull(responseStatus);
- assertTrue(responseStatus.getNavigationPropertyNames().isEmpty());
- assertEquals("Recipient", responseStatus.getBaseType().getName());
- assertEquals(EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance(),
- responseStatus.getProperty("Time").getType());
-
- // 3. Entity
- final EdmEntityType user = edm.getEntityType(
- new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "User"));
- assertNotNull(user);
- final EdmEntityType entity = edm.getEntityType(
- new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "Entity"));
- assertEquals(entity, user.getBaseType());
- assertFalse(user.getPropertyNames().isEmpty());
- assertFalse(user.getNavigationPropertyNames().isEmpty());
- final EdmEntityType folder = edm.getEntityType(
- new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "Folder"));
- assertEquals(folder, user.getNavigationProperty("Inbox").getType());
-
- // 4. Action
- final EdmAction move = edm.getAction(
- new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "Move"),
- new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "Folder"),
- false);
- assertNotNull(move);
- assertTrue(move.isBound());
- assertEquals(2, move.getParameterNames().size());
- assertEquals(
- EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance(), move.getParameter("DestinationId").getType());
-
- // 5. EntityContainer
- final EdmEntityContainer container = edm.getEntityContainer(
- new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "EntityContainer"));
- assertNotNull(container);
- final EdmEntitySet users = container.getEntitySet("Users");
- assertNotNull(users);
- assertEquals(edm.getEntityType(new FullQualifiedName(container.getNamespace(), "User")),
- users.getEntityType());
- assertEquals(container.getEntitySet("Folders"), users.getRelatedBindingTarget("Folders"));
- }
-
- @Test
- public void demo() {
- final XMLMetadata metadata = getClient().getDeserializer().
- toMetadata(getClass().getResourceAsStream("demo-metadata.xml"));
- assertNotNull(metadata);
-
- assertFalse(metadata.getSchema(0).getAnnotationsList().isEmpty());
- final Annotations annots = metadata.getSchema(0).getAnnotationsList("ODataDemo.DemoService/Suppliers");
- assertNotNull(annots);
- assertFalse(annots.getAnnotations().isEmpty());
- assertEquals(ConstExprConstructImpl.Type.String,
- annots.getAnnotation("Org.OData.Publication.V1.PrivacyPolicyUrl").getConstExpr().getType());
- assertEquals("http://www.odata.org/",
- annots.getAnnotation("Org.OData.Publication.V1.PrivacyPolicyUrl").getConstExpr().getValue());
- }
-
- @Test
- public void multipleSchemas() {
- final XMLMetadata metadata = getClient().getDeserializer().
- toMetadata(getClass().getResourceAsStream("northwind-metadata.xml"));
- assertNotNull(metadata);
-
- final Schema first = metadata.getSchema("NorthwindModel");
- assertNotNull(first);
-
- final Schema second = metadata.getSchema("ODataWebExperimental.Northwind.Model");
- assertNotNull(second);
-
- assertEquals(StoreGeneratedPattern.Identity,
- first.getEntityType("Category").getProperty("CategoryID").getStoreGeneratedPattern());
-
- final EntityContainer entityContainer = second.getEntityContainer();
- assertNotNull(entityContainer);
- assertEquals("NorthwindEntities", entityContainer.getName());
- assertTrue(entityContainer.isLazyLoadingEnabled());
- }
-
- /**
- * Tests Example 85 from CSDL specification.
- */
- @Test
- public void fromdoc1() {
- final XMLMetadata metadata = getClient().getDeserializer().
- toMetadata(getClass().getResourceAsStream("fromdoc1-metadata.xml"));
- assertNotNull(metadata);
-
- assertFalse(metadata.getReferences().isEmpty());
- assertEquals("Org.OData.Measures.V1", metadata.getReferences().get(1).getIncludes().get(0).getNamespace());
-
- final EntityType product = metadata.getSchema(0).getEntityType("Product");
- assertTrue(product.isHasStream());
- assertEquals("UoM.ISOCurrency", product.getProperty("Price").getAnnotation().getTerm());
- assertEquals("Products", product.getNavigationProperty("Supplier").getPartner());
-
- final EntityType category = metadata.getSchema(0).getEntityType("Category");
- assertNotNull(category);
-
- final ComplexType address = metadata.getSchema(0).getComplexType("Address");
- assertFalse(address.getNavigationProperty("Country").getReferentialConstraints().isEmpty());
- assertEquals("Name",
- address.getNavigationProperty("Country").getReferentialConstraints().get(0).getReferencedProperty());
-
- final Function productsByRating = metadata.getSchema(0).getFunctions("ProductsByRating").get(0);
- assertNotNull(productsByRating.getParameter("Rating"));
- assertEquals("Edm.Int32", productsByRating.getParameter("Rating").getType());
- assertEquals("Collection(ODataDemo.Product)", productsByRating.getReturnType().getType());
-
- final Singleton contoso = metadata.getSchema(0).getEntityContainer().getSingleton("Contoso");
- assertNotNull(contoso);
- assertFalse(contoso.getNavigationPropertyBindings().isEmpty());
- assertEquals("Products", contoso.getNavigationPropertyBindings().get(0).getPath());
-
- final FunctionImport functionImport = metadata.getSchema(0).getEntityContainer().
- getFunctionImport("ProductsByRating");
- assertNotNull(functionImport);
- assertEquals(metadata.getSchema(0).getNamespace() + "." + productsByRating.getName(),
- functionImport.getFunction());
-
- // Now let's go high-level
- final Edm edm = getClient().getReader().
- readMetadata(getClass().getResourceAsStream("fromdoc1-metadata.xml"));
- assertNotNull(edm);
-
- final EdmFunctionImportInfo fiInfo = edm.getServiceMetadata().getFunctionImportInfos().get(0);
- final EdmEntityContainer demoService = edm.getEntityContainer(
- new FullQualifiedName(metadata.getSchema(0).getNamespace(), fiInfo.getEntityContainerName()));
- assertNotNull(demoService);
- final EdmFunctionImport fi = demoService.getFunctionImport(fiInfo.getFunctionImportName());
- assertNotNull(fi);
- assertEquals(demoService.getEntitySet("Products"), fi.getReturnedEntitySet());
-
- final EdmFunction function = edm.getFunction(
- new FullQualifiedName(metadata.getSchema(0).getNamespace(), "ProductsByRating"),
- null, Boolean.FALSE, null);
- assertNotNull(function);
- assertEquals(function.getName(), fi.getFunction(null).getName());
- assertEquals(function.getNamespace(), fi.getFunction(null).getNamespace());
- assertEquals(function.getParameterNames(), fi.getFunction(null).getParameterNames());
- assertEquals(function.getReturnType().getType().getName(),
- fi.getFunction(null).getReturnType().getType().getName());
- assertEquals(function.getReturnType().getType().getNamespace(),
- fi.getFunction(null).getReturnType().getType().getNamespace());
- }
-
- /**
- * Tests Example 86 from CSDL specification.
- */
- @Test
- public void fromdoc2() {
- final XMLMetadata metadata = getClient().getDeserializer().
- toMetadata(getClass().getResourceAsStream("fromdoc2-metadata.xml"));
- assertNotNull(metadata);
-
- // Check displayName
- final Annotation displayName = metadata.getSchema(0).getAnnotationsList("ODataDemo.Supplier").
- getAnnotation("Vocabulary1.DisplayName");
- assertNotNull(displayName);
- assertNull(displayName.getConstExpr());
- assertNotNull(displayName.getDynExpr());
-
- assertTrue(displayName.getDynExpr() instanceof Apply);
- final Apply apply = (Apply) displayName.getDynExpr();
- assertEquals(Apply.CANONICAL_FUNCTION_CONCAT, apply.getFunction());
- assertEquals(3, apply.getParameters().size());
-
- final Path firstArg = new Path();
- firstArg.setValue("Name");
- assertEquals(firstArg, apply.getParameters().get(0));
-
- final ConstExprConstructImpl secondArg = new ConstExprConstructImpl();
- secondArg.setType(ConstExprConstructImpl.Type.String);
- secondArg.setValue(" in ");
- assertEquals(secondArg, apply.getParameters().get(1));
-
- final Path thirdArg = new Path();
- thirdArg.setValue("Address/CountryName");
- assertEquals(thirdArg, apply.getParameters().get(2));
-
- // Check Tags
- final Annotation tags = metadata.getSchema(0).getAnnotationsList("ODataDemo.Product").
- getAnnotation("Vocabulary1.Tags");
- assertNotNull(tags);
- assertNull(tags.getConstExpr());
- assertNotNull(tags.getDynExpr());
-
- assertTrue(tags.getDynExpr() instanceof Collection);
- final Collection collection = (Collection) tags.getDynExpr();
- assertEquals(1, collection.getItems().size());
- assertEquals(ConstExprConstructImpl.Type.String, ((ConstExprConstructImpl) collection.getItems().get(0)).getType());
- assertEquals("MasterData", ((ConstExprConstructImpl) collection.getItems().get(0)).getValue());
- }
-
- /**
- * Various annotation examples taken from CSDL specification.
- */
- @Test
- public void fromdoc3() {
- final Edm metadata = getClient().getReader().
- readMetadata(getClass().getResourceAsStream("fromdoc3-metadata.xml"));
- assertNotNull(metadata);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/ServiceDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/ServiceDocumentTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/ServiceDocumentTest.java
deleted file mode 100644
index fbc251c..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/ServiceDocumentTest.java
+++ /dev/null
@@ -1,67 +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.v4;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URI;
-import org.apache.olingo.odata4.client.api.ODataV4Client;
-import org.apache.olingo.odata4.client.api.domain.ODataServiceDocument;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.apache.olingo.odata4.client.core.AbstractTest;
-import org.junit.Test;
-
-public class ServiceDocumentTest extends AbstractTest {
-
- @Override
- protected ODataV4Client getClient() {
- return v4Client;
- }
-
- private String getFileExtension(final ODataFormat format) {
- return format == ODataFormat.XML ? "xml" : "json";
- }
-
- private ODataServiceDocument parse(final ODataFormat format) {
- final ODataServiceDocument serviceDocument = getClient().getReader().readServiceDocument(
- getClass().getResourceAsStream("serviceDocument." + getFileExtension(format)), format);
- assertNotNull(serviceDocument);
- assertEquals(URI.create("http://host/service/$metadata"), serviceDocument.getMetadataContext());
- assertTrue(serviceDocument.getEntitySetTitles().contains("Order Details"));
- assertEquals(URI.create("http://host/service/TopProducts"),
- serviceDocument.getFunctionImportURI("Best-Selling Products"));
- assertEquals(URI.create("http://host/HR/"),
- serviceDocument.getRelatedServiceDocumentsURIs().iterator().next());
-
- return serviceDocument;
- }
-
- @Test
- public void json() {
- parse(ODataFormat.JSON);
- }
-
- @Test
- public void xml() {
- final ODataServiceDocument serviceDocument = parse(ODataFormat.XML);
- assertEquals("W/\"MjAxMy0wNS0xM1QxNDo1NFo=\"", serviceDocument.getMetadataETag());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/URIBuilderTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/URIBuilderTest.java b/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/URIBuilderTest.java
deleted file mode 100644
index b632e6d..0000000
--- a/lib/client-core/src/test/java/org/apache/olingo/odata4/client/core/v4/URIBuilderTest.java
+++ /dev/null
@@ -1,133 +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.v4;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import org.apache.olingo.odata4.client.api.ODataV4Client;
-import org.apache.olingo.odata4.client.api.uri.V4URIBuilder;
-import org.apache.olingo.odata4.client.core.AbstractTest;
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-
-public class URIBuilderTest extends AbstractTest {
-
- private static final String SERVICE_ROOT = "http://host/service";
-
- @Override
- protected ODataV4Client getClient() {
- return v4Client;
- }
-
- @Test
- public void count() throws URISyntaxException {
- URI uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("Products").count().build();
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Products/$count").build(), uri);
-
- uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("Products").count(true).build();
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Products").
- addParameter("$count", "true").build(), uri);
- }
-
- @Test
- public void singleton() throws URISyntaxException {
- final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendSingletonSegment("BestProductEverCreated");
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/BestProductEverCreated").build(), uriBuilder.build());
- }
-
- @Test
- public void entityId() throws URISyntaxException {
- final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntityIdSegment("Products(0)");
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/$entity").addParameter("$id", "Products(0)").build(), uriBuilder.build());
- }
-
- @Test
- public void boundAction() throws URISyntaxException {
- final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("Categories").appendKeySegment(1).
- appendNavigationSegment("Products").appendNavigationSegment("Model").
- appendOperationCallSegment("AllOrders", null);
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/Categories(1)/Products/Model.AllOrders()").build(), uriBuilder.build());
- }
-
- @Test
- public void ref() throws URISyntaxException {
- V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("Categories").appendKeySegment(1).
- appendNavigationSegment("Products").appendRefSegment();
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/Categories(1)/Products/$ref").build(), uriBuilder.build());
-
- uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("Categories").appendKeySegment(1).
- appendNavigationSegment("Products").appendRefSegment().id("../../Products(0)");
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/Categories(1)/Products/$ref").addParameter("$id", "../../Products(0)").build(),
- uriBuilder.build());
- }
-
- @Test
- public void derived() throws URISyntaxException {
- final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("Customers").appendNavigationSegment("Model").
- appendDerivedEntityTypeSegment("VipCustomer").appendKeySegment(1);
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/Customers/Model.VipCustomer(1)").build(), uriBuilder.build());
- }
-
- @Test
- public void crossjoin() throws URISyntaxException {
- final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendCrossjoinSegment("Products", "Sales");
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/$crossjoin(Products,Sales)").build(), uriBuilder.build());
- }
-
- @Test
- public void all() throws URISyntaxException {
- final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).appendAllSegment();
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/$all").build(), uriBuilder.build());
- }
-
- @Test
- public void search() throws URISyntaxException {
- final V4URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
- appendEntitySetSegment("Products").search("blue OR green");
-
- assertEquals(new org.apache.http.client.utils.URIBuilder(
- SERVICE_ROOT + "/Products").addParameter("$search", "blue OR green").build(), uriBuilder.build());
- }
-
-}
[04/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/PropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/PropertyRef.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/PropertyRef.java
new file mode 100644
index 0000000..cf64050
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/PropertyRef.java
@@ -0,0 +1,55 @@
+/*
+ * 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.server.api.edm.provider;
+
+public class PropertyRef {
+
+ private String propertyName;
+
+ private String alias;
+
+ private String path;
+
+ public String getPath() {
+ return path;
+ }
+
+ public PropertyRef setPath(final String path) {
+ this.path = path;
+ return this;
+ }
+
+ public String getPropertyName() {
+ return propertyName;
+ }
+
+ public PropertyRef setPropertyName(final String name) {
+ propertyName = name;
+ return this;
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public PropertyRef setAlias(final String alias) {
+ this.alias = alias;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReferentialConstraint.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReferentialConstraint.java
new file mode 100644
index 0000000..bf454eb
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReferentialConstraint.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.server.api.edm.provider;
+
+public class ReferentialConstraint {
+
+ // TODO: check data type
+ private String property;
+
+ private String referencedProperty;
+
+ // Annotations
+ public String getProperty() {
+ return property;
+ }
+
+ public ReferentialConstraint setProperty(final String property) {
+ this.property = property;
+ return this;
+ }
+
+ public String getReferencedProperty() {
+ return referencedProperty;
+ }
+
+ public ReferentialConstraint setReferencedProperty(final String referencedProperty) {
+ this.referencedProperty = referencedProperty;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReturnType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReturnType.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReturnType.java
new file mode 100644
index 0000000..1206a9d
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ReturnType.java
@@ -0,0 +1,91 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class ReturnType {
+
+ private FullQualifiedName type;
+
+ private boolean isCollection;
+
+ // facets
+ private Boolean nullable;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ public FullQualifiedName getType() {
+ return type;
+ }
+
+ public ReturnType setType(final FullQualifiedName type) {
+ this.type = type;
+ return this;
+ }
+
+ public boolean isCollection() {
+ return isCollection;
+ }
+
+ public ReturnType setCollection(final boolean isCollection) {
+ this.isCollection = isCollection;
+ return this;
+ }
+
+ public Boolean getNullable() {
+ return nullable;
+ }
+
+ public ReturnType setNullable(final Boolean nullable) {
+ this.nullable = nullable;
+ return this;
+ }
+
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public ReturnType setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ return this;
+ }
+
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public ReturnType setPrecision(final Integer precision) {
+ this.precision = precision;
+ return this;
+ }
+
+ public Integer getScale() {
+ return scale;
+ }
+
+ public ReturnType setScale(final Integer scale) {
+ this.scale = scale;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Schema.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Schema.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Schema.java
new file mode 100644
index 0000000..ce249da
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Schema.java
@@ -0,0 +1,135 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+public class Schema {
+
+ private String namespace;
+
+ private String alias;
+
+ private List<EnumType> enumTypes;
+
+ private List<TypeDefinition> typeDefinitions;
+
+ private List<EntityType> entityTypes;
+
+ private List<ComplexType> complexTypes;
+
+ private List<Action> actions;
+
+ private List<Function> functions;
+
+ private EntityContainer entityContainer;
+
+ private List<Term> terms;
+
+ // Annotations
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public Schema setNamespace(final String namespace) {
+ this.namespace = namespace;
+ return this;
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public Schema setAlias(final String alias) {
+ this.alias = alias;
+ return this;
+ }
+
+ public List<EnumType> getEnumTypes() {
+ return enumTypes;
+ }
+
+ public Schema setEnumTypes(final List<EnumType> enumTypes) {
+ this.enumTypes = enumTypes;
+ return this;
+ }
+
+ public List<TypeDefinition> getTypeDefinitions() {
+ return typeDefinitions;
+ }
+
+ public Schema setTypeDefinitions(final List<TypeDefinition> typeDefinitions) {
+ this.typeDefinitions = typeDefinitions;
+ return this;
+ }
+
+ public List<EntityType> getEntityTypes() {
+ return entityTypes;
+ }
+
+ public Schema setEntityTypes(final List<EntityType> entityTypes) {
+ this.entityTypes = entityTypes;
+ return this;
+ }
+
+ public List<ComplexType> getComplexTypes() {
+ return complexTypes;
+ }
+
+ public Schema setComplexTypes(final List<ComplexType> complexTypes) {
+ this.complexTypes = complexTypes;
+ return this;
+ }
+
+ public List<Action> getActions() {
+ return actions;
+ }
+
+ public Schema setActions(final List<Action> actions) {
+ this.actions = actions;
+ return this;
+ }
+
+ public List<Function> getFunctions() {
+ return functions;
+ }
+
+ public Schema setFunctions(final List<Function> functions) {
+ this.functions = functions;
+ return this;
+ }
+
+ public EntityContainer getEntityContainer() {
+ return entityContainer;
+ }
+
+ public Schema setEntityContainer(final EntityContainer entityContainer) {
+ this.entityContainer = entityContainer;
+ return this;
+ }
+
+ public List<Term> getTerms() {
+ return terms;
+ }
+
+ public Schema setTerms(final List<Term> terms) {
+ this.terms = terms;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Singleton.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Singleton.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Singleton.java
new file mode 100644
index 0000000..a6560c2
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Singleton.java
@@ -0,0 +1,44 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class Singleton extends BindingTarget {
+
+ @Override
+ public Singleton setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public Singleton setType(final FullQualifiedName type) {
+ this.type = type;
+ return this;
+ }
+
+ @Override
+ public Singleton setNavigationPropertyBindings(final List<NavigationPropertyBinding> navigationPropertyBindings) {
+ this.navigationPropertyBindings = navigationPropertyBindings;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/StructuredType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/StructuredType.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/StructuredType.java
new file mode 100644
index 0000000..fec63fa
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/StructuredType.java
@@ -0,0 +1,93 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public abstract class StructuredType {
+
+ protected String name;
+
+ protected boolean isOpenType;
+
+ protected FullQualifiedName baseType;
+
+ protected boolean isAbstract;
+
+ protected List<Property> properties;
+
+ protected List<NavigationProperty> navigationProperties;
+
+ // What about mapping and annotations?
+ public String getName() {
+ return name;
+ }
+
+ public StructuredType setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public boolean isOpenType() {
+ return isOpenType;
+ }
+
+ public StructuredType setOpenType(final boolean isOpenType) {
+ this.isOpenType = isOpenType;
+ return this;
+ }
+
+ public FullQualifiedName getBaseType() {
+ return baseType;
+ }
+
+ public StructuredType setBaseType(final FullQualifiedName baseType) {
+ this.baseType = baseType;
+ return this;
+ }
+
+ public boolean isAbstract() {
+ return isAbstract;
+ }
+
+ public StructuredType setAbstract(final boolean isAbstract) {
+ this.isAbstract = isAbstract;
+ return this;
+ }
+
+ public List<Property> getProperties() {
+ return properties;
+ }
+
+ public StructuredType setProperties(final List<Property> properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ public List<NavigationProperty> getNavigationProperties() {
+ return navigationProperties;
+ }
+
+ public StructuredType setNavigationProperties(final List<NavigationProperty> navigationProperties) {
+ this.navigationProperties = navigationProperties;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Term.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Term.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Term.java
new file mode 100644
index 0000000..9990cb9
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Term.java
@@ -0,0 +1,150 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class Term {
+
+ private String name;
+
+ private FullQualifiedName type;
+
+ private FullQualifiedName baseTerm;
+
+ // TODO: AppliesTo is a list of csdl elements => should we put this list inside an enum?
+ private String appliesTo;
+
+ private boolean isCollection;
+
+ // Facets
+ private String defaultValue;
+
+ private Boolean nullable;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ // Annotation
+ private List<Annotation> annotations;
+
+ public String getName() {
+ return name;
+ }
+
+ public Term setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public FullQualifiedName getType() {
+ return type;
+ }
+
+ public Term setType(final FullQualifiedName type) {
+ this.type = type;
+ return this;
+ }
+
+ public FullQualifiedName getBaseTerm() {
+ return baseTerm;
+ }
+
+ public Term setBaseTerm(final FullQualifiedName baseTerm) {
+ this.baseTerm = baseTerm;
+ return this;
+ }
+
+ public String getAppliesTo() {
+ return appliesTo;
+ }
+
+ public Term setAppliesTo(final String appliesTo) {
+ this.appliesTo = appliesTo;
+ return this;
+ }
+
+ public boolean isCollection() {
+ return isCollection;
+ }
+
+ public Term setCollection(final boolean isCollection) {
+ this.isCollection = isCollection;
+ return this;
+ }
+
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ public Term setDefaultValue(final String defaultValue) {
+ this.defaultValue = defaultValue;
+ return this;
+ }
+
+ public Boolean getNullable() {
+ return nullable;
+ }
+
+ public Term setNullable(final Boolean nullable) {
+ this.nullable = nullable;
+ return this;
+ }
+
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public Term setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ return this;
+ }
+
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public Term setPrecision(final Integer precision) {
+ this.precision = precision;
+ return this;
+ }
+
+ public Integer getScale() {
+ return scale;
+ }
+
+ public Term setScale(final Integer scale) {
+ this.scale = scale;
+ return this;
+ }
+
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+ public Term setAnnotations(final List<Annotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/TypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/TypeDefinition.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/TypeDefinition.java
new file mode 100644
index 0000000..f90a378
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/TypeDefinition.java
@@ -0,0 +1,94 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class TypeDefinition {
+
+ private String name;
+
+ // TODO: UnderlyingType can only be primitve...
+ private FullQualifiedName underlyingType;
+
+ // Facets
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private Boolean isUnicode;
+
+ // Annotations
+ public String getName() {
+ return name;
+ }
+
+ public TypeDefinition setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public FullQualifiedName getUnderlyingType() {
+ return underlyingType;
+ }
+
+ public TypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) {
+ this.underlyingType = underlyingType;
+ return this;
+ }
+
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public TypeDefinition setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ return this;
+ }
+
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public TypeDefinition setPrecision(final Integer precision) {
+ this.precision = precision;
+ return this;
+ }
+
+ public Integer getScale() {
+ return scale;
+ }
+
+ public TypeDefinition setScale(final Integer scale) {
+ this.scale = scale;
+ return this;
+ }
+
+ public Boolean getIsUnicode() {
+ return isUnicode;
+ }
+
+ public TypeDefinition setIsUnicode(final Boolean isUnicode) {
+ this.isUnicode = isUnicode;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
new file mode 100644
index 0000000..7fbc2d1
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfo.java
@@ -0,0 +1,48 @@
+/*
+ * 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.server.api.uri;
+
+
+/**
+ * Object acting as general access to URI information extracted from the request URI. Depending on
+ * the URI info kind different interfaces are used to provide access to that information. </p>
+ * Use method {@link #getKind()} to obtain URI info kind information and to perform an appropriate cast.
+ */
+public interface UriInfo extends
+ UriInfoService, UriInfoAll, UriInfoBatch, UriInfoCrossjoin,
+ UriInfoEntityId, UriInfoMetadata, UriInfoResource {
+
+ public UriInfoKind getKind();
+
+ public UriInfoService asUriInfoService();
+
+ public UriInfoAll asUriInfoAll();
+
+ public UriInfoBatch asUriInfoBatch();
+
+ public UriInfoCrossjoin asUriInfoCrossjoin();
+
+ public UriInfoEntityId asUriInfoEntityId();
+
+ public UriInfoMetadata asUriInfoMetadata();
+
+ public UriInfoResource asUriInfoResource();
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoAll.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoAll.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoAll.java
new file mode 100644
index 0000000..5845ad4
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoAll.java
@@ -0,0 +1,28 @@
+/*
+ * 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.server.api.uri;
+
+
+/**
+ * Used for URI info kind {@link UriInfoKind#all} to describe URIs like
+ * http://.../serviceroot/$all
+ */
+public interface UriInfoAll {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoBatch.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoBatch.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoBatch.java
new file mode 100644
index 0000000..d4debad
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoBatch.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Used for URI info kind {@link UriInfoKind#batch} to describe URIs like
+ * http://.../serviceroot/$batch
+ */
+public interface UriInfoBatch {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoCrossjoin.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoCrossjoin.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoCrossjoin.java
new file mode 100644
index 0000000..15a42bb
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoCrossjoin.java
@@ -0,0 +1,34 @@
+/*
+ * 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.server.api.uri;
+
+import java.util.List;
+
+/**
+ * Used for URI info kind {@link UriInfoKind#crossjoin} to describe URIs like
+ * http://.../serviceroot/$crossjoin(...)
+ */
+public interface UriInfoCrossjoin {
+
+ /**
+ * @return List of entity set names
+ */
+ List<String> getEntitySetNames();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoEntityId.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoEntityId.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoEntityId.java
new file mode 100644
index 0000000..2bac67c
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoEntityId.java
@@ -0,0 +1,68 @@
+/*
+ * 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.server.api.uri;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
+import org.apache.olingo.server.api.uri.queryoption.ExpandOption;
+import org.apache.olingo.server.api.uri.queryoption.FormatOption;
+import org.apache.olingo.server.api.uri.queryoption.IdOption;
+import org.apache.olingo.server.api.uri.queryoption.SelectOption;
+
+/**
+ * Used for URI info kind {@link UriInfoKind#entityId} to describe URIs like
+ * http://.../serviceroot/$entity...
+ */
+public interface UriInfoEntityId {
+
+ /**
+ * @return List of custom query options used in the URI
+ */
+ public List<CustomQueryOption> getCustomQueryOptions();
+
+ /**
+ * Behind $entity a optional type cast can be used in the URI.
+ * For example: http://.../serviceroot/$entity/namespace.entitytype
+ * @return Type cast if found, otherwise null
+ */
+ public EdmEntityType getEntityTypeCast();
+
+ /**
+ * @return Object containing information of the $expand option
+ */
+ public ExpandOption getExpandOption();
+
+ /**
+ * @return Object containing information of the $format option
+ */
+ public FormatOption getFormatOption();
+
+ /**
+ * @return Object containing information of the $id option
+ */
+ public IdOption getIdOption();
+
+ /**
+ * @return Object containing information of the $select option
+ */
+ public SelectOption getSelectOption();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoKind.java
new file mode 100644
index 0000000..ec86fd9
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoKind.java
@@ -0,0 +1,67 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Defining the various info kinds
+ */
+public enum UriInfoKind {
+
+ /**
+ * Class: {@link UriInfoAll}<br>
+ * URI: http://.../serviceroot/$all
+ */
+ all,
+
+ /**
+ * Class: {@link UriInfoBatch}<br>
+ * URI: http://.../serviceroot/$batch
+ */
+ batch,
+
+ /**
+ * Class: {@link UriInfoCrossjoin}<br>
+ * URI: http://.../serviceroot/$crossjoin
+ */
+ crossjoin,
+
+ /**
+ * Class: {@link UriInfoEntityId}<br>
+ * URI: http://.../serviceroot/$entity(...)
+ */
+ entityId,
+
+ /**
+ * Class: {@link UriInfoMetadata}<br>
+ * URI: http://.../serviceroot/$metadata...
+ */
+ metadata,
+
+ /**
+ * Class: {@link UriInfoResource}<br>
+ * URI: http://.../serviceroot/entitySet
+ */
+ resource,
+
+ /**
+ * Class: {@link UriInfoService}<br>
+ * URI: http://.../serviceroot
+ */
+ service;
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoMetadata.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoMetadata.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoMetadata.java
new file mode 100644
index 0000000..49cf905
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoMetadata.java
@@ -0,0 +1,39 @@
+/*
+ * 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.server.api.uri;
+
+import org.apache.olingo.server.api.uri.queryoption.FormatOption;
+
+/**
+ * Used for URI info kind {@link UriInfoKind#metadata} to describe URIs like
+ * http://.../serviceroot/$metadata...
+ */
+public interface UriInfoMetadata {
+
+ /**
+ * @return Object containing information of the $id option
+ */
+ public FormatOption getFormatOption();
+
+ /**
+ * @return Object containing information of the URI fragment
+ */
+ public String getFragment();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
new file mode 100644
index 0000000..a7f759e
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoResource.java
@@ -0,0 +1,118 @@
+/*
+ * 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.server.api.uri;
+
+import java.util.List;
+
+import org.apache.olingo.server.api.uri.queryoption.CountOption;
+import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
+import org.apache.olingo.server.api.uri.queryoption.ExpandOption;
+import org.apache.olingo.server.api.uri.queryoption.FilterOption;
+import org.apache.olingo.server.api.uri.queryoption.FormatOption;
+import org.apache.olingo.server.api.uri.queryoption.IdOption;
+import org.apache.olingo.server.api.uri.queryoption.OrderByOption;
+import org.apache.olingo.server.api.uri.queryoption.SearchOption;
+import org.apache.olingo.server.api.uri.queryoption.SelectOption;
+import org.apache.olingo.server.api.uri.queryoption.SkipOption;
+import org.apache.olingo.server.api.uri.queryoption.SkipTokenOption;
+import org.apache.olingo.server.api.uri.queryoption.TopOption;
+
+/**
+ * Used for URI info kind {@link UriInfoKind#resource} to describe URIs like
+ * E.g. http://.../serviceroot/entitySet
+ */
+public interface UriInfoResource {
+
+ /**
+ * @return List of custom query options used in the URI
+ */
+ List<CustomQueryOption> getCustomQueryOptions();
+
+ /**
+ * @return Object containing information of the $expand option
+ */
+ ExpandOption getExpandOption();
+
+ /**
+ * @return Object containing information of the $filter option
+ */
+ FilterOption getFilterOption();
+
+ /**
+ * @return Object containing information of the $format option
+ */
+ FormatOption getFormatOption();
+
+ /**
+ * @return Object containing information of the $id option
+ */
+ IdOption getIdOption();
+
+ /**
+ * @return Object containing information of the $count option
+ */
+ CountOption getCountOption();
+
+ /**
+ * @return Object containing information of the $orderby option
+ */
+ OrderByOption getOrderByOption();
+
+ /**
+ * @return Object containing information of the $search option
+ */
+ SearchOption getSearchOption();
+
+ /**
+ * @return Object containing information of the $select option
+ */
+ SelectOption getSelectOption();
+
+ /**
+ * @return Object containing information of the $skip option
+ */
+ SkipOption getSkipOption();
+
+ /**
+ * @return Object containing information of the $skiptoken option
+ */
+ SkipTokenOption getSkipTokenOption();
+
+ /**
+ * @return Object containing information of the $top option
+ */
+ TopOption getTopOption();
+
+ /**
+ * The path segments behind the service root define which resources are
+ * requested by that URI. This may be entities/functions/actions and more.
+ * Each segments information (name, key predicates, function parameters, ...) is
+ * stored within an resource object dedicated for that segment type.</p>
+ * For example: the URI http://.../serviceroot/entitySet(1)/Adresse will
+ * have 2 ResourceParts:<br>
+ * - The first one of type {@link UriResourceEntitySet}
+ * containing the name of the entity set and also the key predicate information.<br>
+ * - The second one of type {@link UriResourceComplexProperty} containing the name of
+ * the accessed complex property
+ *
+ * @return List of resource parts.
+ */
+ List<UriResource> getUriResourceParts();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoService.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoService.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoService.java
new file mode 100644
index 0000000..ab2ccb6
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriInfoService.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Used for URI info kind {@link UriInfoKind#service} to describe URIs like
+ * http://.../serviceroot
+ */
+public interface UriInfoService {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriParameter.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriParameter.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriParameter.java
new file mode 100644
index 0000000..669c4dd
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriParameter.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.server.api.uri;
+
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+
+/**
+ * Represents an function parameter or key predicate when used in the URI.
+ */
+public interface UriParameter {
+
+ /**
+ * @return Alias name if the parameters values is an alias, otherwise null
+ */
+ public String getAlias();
+
+ /**
+ * @return Text of the parameters value
+ */
+ public String getText();
+
+ /**
+ * @return If the parameters value is a expression and expression is returned, otherwise null
+ */
+ public Expression getExression();
+
+ /**
+ * @return Name of the parameter
+ */
+ public String getName();
+
+ /**
+ * @return Name of the referenced property when referential constrains are used
+ */
+ public String getRefencedProperty();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResource.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResource.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResource.java
new file mode 100644
index 0000000..9d22435
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResource.java
@@ -0,0 +1,35 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Super interface for all objects representing resource parts.
+ * See {@link UriInfoResource} for details.
+ */
+public interface UriResource {
+
+ /**
+ * @return Kind of the resource part
+ */
+ UriResourceKind getKind();
+
+ @Override
+ String toString();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceAction.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceAction.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceAction.java
new file mode 100644
index 0000000..ee2ddcb
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceAction.java
@@ -0,0 +1,42 @@
+/*
+ * 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.server.api.uri;
+
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmActionImport;
+
+/**
+ * Used to describe an action used within an resource path
+ * For example: http://.../serviceroot/action()
+ */
+public interface UriResourceAction extends UriResourcePartTyped {
+
+ /**
+ * @return Action used in the resource path
+ */
+ EdmAction getAction();
+
+ /**
+ * Convenience method which returns the {@link EdmActionImport} which was used in
+ * the resource path to define the {@link EdmAction}.
+ * @return
+ */
+ EdmActionImport getActionImport();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceComplexProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceComplexProperty.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceComplexProperty.java
new file mode 100644
index 0000000..72affe8
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceComplexProperty.java
@@ -0,0 +1,41 @@
+/*
+ * 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.server.api.uri;
+
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+
+/**
+ * Used to describe an complex property used within an resource path
+ * E.g. http://.../serviceroot/entityset(1)/complexproperty
+ */
+public interface UriResourceComplexProperty extends UriResourceProperty {
+
+ /**
+ * @return Complex property used in the resource path
+ */
+ EdmComplexType getComplexType();
+
+ /**
+ * Behind a complex property may be a type filter
+ * E.g. http://.../serviceroot/entityset(1)/complexproperty/namespace.complextype
+ * @return Type filter if found, otherwise null
+ */
+ EdmComplexType getComplexTypeFilter();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceCount.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceCount.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceCount.java
new file mode 100644
index 0000000..ef68b4b
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceCount.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Used to describe an $count used within an resource path
+ * For example: http://.../serviceroot/entityset(1)/$count
+ */
+public interface UriResourceCount extends UriResource {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceEntitySet.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceEntitySet.java
new file mode 100644
index 0000000..d3ef52e
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceEntitySet.java
@@ -0,0 +1,58 @@
+/*
+ * 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.server.api.uri;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmType;
+
+/**
+ * Used to describe an entity set used within an resource path
+ * For example: http://.../serviceroot/entityset(1)
+ */
+public interface UriResourceEntitySet extends UriResourcePartTyped {
+
+ /**
+ * @return Entity set used in the resource path
+ */
+ EdmEntitySet getEntitySet();
+
+ /**
+ * @return Type of the entity set
+ */
+ EdmEntityType getEntityType();
+
+ /**
+ * @return Key predicates if used, otherwise null
+ */
+ List<UriParameter> getKeyPredicates();
+
+ /**
+ * @return Type filter before key predicates if used, otherwise null
+ */
+ EdmType getTypeFilterOnCollection();
+
+ /**
+ * @return Type filter behind key predicates if used, otherwise null
+ */
+ EdmType getTypeFilterOnEntry();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceFunction.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceFunction.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceFunction.java
new file mode 100644
index 0000000..a4da5ee
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceFunction.java
@@ -0,0 +1,66 @@
+/*
+ * 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.server.api.uri;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+import org.apache.olingo.commons.api.edm.EdmType;
+
+/**
+ * Used to describe an function import or bound function used within an resource path
+ * For example: http://.../serviceroot/functionImport(P1=1,P2='A')
+ */
+public interface UriResourceFunction extends UriResourcePartTyped {
+
+ /**
+ * @return Function used in the resource path
+ */
+ EdmFunction getFunction();
+
+ /**
+ * Convenience method which returns the {@link EdmFunctionImport} which was used in
+ * the resource path to define the {@link EdmFunction}.
+ * @return
+ */
+ EdmFunctionImport getFunctionImport();
+
+ /**
+ * @return Key predicates if used, otherwise null
+ */
+ List<UriParameter> getKeyPredicates();
+
+
+ /**
+ * @return List of function parameters
+ */
+ List<UriParameter> getParameters();
+
+ /**
+ * @return Type filter before key predicates if used, otherwise null
+ */
+ EdmType getTypeFilterOnCollection();
+
+ /**
+ * @return Type filter behind key predicates if used, otherwise null
+ */
+ EdmType getTypeFilterOnEntry();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceIt.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceIt.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceIt.java
new file mode 100644
index 0000000..8854f8c
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceIt.java
@@ -0,0 +1,38 @@
+/*
+ * 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.server.api.uri;
+
+import org.apache.olingo.commons.api.edm.EdmType;
+
+/**
+ * Class indicating the $it reference. $it may be used within expression to
+ * refer to the last EDM object referenced in the resource path.
+ */
+public interface UriResourceIt extends UriResourcePartTyped {
+
+ /**
+ * @return Type filter if $it refers to a collection
+ */
+ EdmType getTypeFilterOnCollection();
+
+ /**
+ * @return Type filter if $it refers to a single entry
+ */
+ EdmType getTypeFilterOnEntry();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceKind.java
new file mode 100644
index 0000000..6cecce7
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceKind.java
@@ -0,0 +1,115 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Defining the various resource part types
+ */
+public enum UriResourceKind {
+
+ /**
+ * Class: {@link UriResourceAction}<br>
+ * URI: http://.../serviceroot/action()
+ */
+ action,
+
+ /**
+ * Class: {@link UriResourceComplexProperty}<br>
+ * URI: http://.../serviceroot/entityset(1)/complexproperty()
+ */
+ complexProperty,
+
+ /**
+ * Class: {@link UriResourceCount}<br>
+ * URI: http://.../serviceroot/entityset/$count
+ */
+ count,
+
+ /**
+ * Class: {@link UriResourceEntitySet}<br>
+ * URI: http://.../serviceroot/entityset
+ */
+ entitySet,
+
+ /**
+ * Class: {@link UriResourceFunction}<br>
+ * URI: http://.../serviceroot/functionimport(P1=1,P2='a')
+ */
+ function,
+
+ /**
+ * Class: {@link UriResourceIt}<br>
+ * URI: http://.../serviceroot/entityset?$filter=$it/property
+ */
+ it,
+
+ /**
+ * Class: {@link UriResourceLambdaAll}<br>
+ * URI: http://.../serviceroot/entityset/all(...)
+ */
+ lambdaAll,
+
+ /**
+ * Class: {@link UriResourceLambdaAny}<br>
+ * URI: http://.../serviceroot/entityset/any(...)
+ */
+ lambdaAny,
+
+ /**
+ * Class: {@link UriResourceLambdaVariable}<br>
+ * URI: http://.../serviceroot/entityset/listofstring/any(d: 'string' eq d)
+ */
+ lambdaVariable,
+
+ /**
+ * Class: {@link UriResourceNavigation}<br>
+ * URI: http://.../serviceroot/entityset(1)/navProperty
+ */
+ navigationProperty,
+
+ /**
+ * Class: {@link UriResourceRef}<br>
+ * URI: http://.../serviceroot/entityset/$ref
+ */
+ ref,
+
+ /**
+ * Class: {@link UriResourceRoot}<br>
+ * URI: http://.../serviceroot/entityset(1)?$filter=property eq $root/singleton/configstring
+ */
+ root,
+
+ /**
+ * Class: {@link UriResourceProperty}<br>
+ * URI: http://.../serviceroot/entityset(1)/property
+ */
+ primitiveProperty,
+
+ /**
+ * Class: {@link UriResourceSingleton}<br>
+ * URI: http://.../serviceroot/singleton
+ */
+ singleton,
+
+ /**
+ * Class: {@link UriResourceValue}<br>
+ * URI: http://.../serviceroot/entityset(1)/property/$value
+ */
+ value,
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAll.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAll.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAll.java
new file mode 100644
index 0000000..6fa218d
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAll.java
@@ -0,0 +1,39 @@
+/*
+ * 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.server.api.uri;
+
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+
+/**
+ * Used to describe an all lambda expression used within an resource path
+ * For example: http://.../serviceroot/entityset/all(...)
+ */
+public interface UriResourceLambdaAll extends UriResourcePartTyped {
+
+ /**
+ * @return Name of the lambda variable
+ */
+ public String getLambdaVariable();
+
+ /**
+ * @return Lambda expression
+ */
+ public Expression getExpression();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAny.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAny.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAny.java
new file mode 100644
index 0000000..57b127b
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaAny.java
@@ -0,0 +1,39 @@
+/*
+ * 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.server.api.uri;
+
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+
+/**
+ * Used to describe an any lambda expression used within an resource path
+ * For example: http://.../serviceroot/entityset/any(...)
+ */
+public interface UriResourceLambdaAny extends UriResourcePartTyped {
+
+ /**
+ * @return Name of the lambda variable
+ */
+ public String getLamdaVariable();
+
+ /**
+ * @return Lambda expression
+ */
+ public Expression getExpression();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaVariable.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaVariable.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaVariable.java
new file mode 100644
index 0000000..b846010
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceLambdaVariable.java
@@ -0,0 +1,33 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Used to describe an lambda variable used within an resource path
+ * For example: http://.../serviceroot/entityset/listofstring/any(d: 'string' eq d)
+ */
+public interface UriResourceLambdaVariable extends UriResourcePartTyped {
+
+
+ /**
+ * @return Name of the lambda variable
+ */
+ public String getVariableName();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceNavigation.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceNavigation.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceNavigation.java
new file mode 100644
index 0000000..16f8786
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceNavigation.java
@@ -0,0 +1,51 @@
+/*
+ * 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.server.api.uri;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmType;
+
+/**
+ * Used to describe an navigation property used within an resource path
+ * For example: http://.../serviceroot/entityset(1)/navProperty
+ */
+public interface UriResourceNavigation extends UriResourcePartTyped {
+
+ /**
+ * @return Navigation property
+ */
+ EdmNavigationProperty getProperty();
+
+ /**
+ * @return Key predicates if used, otherwise null
+ */
+ List<UriParameter> getKeyPredicates();
+
+ /**
+ * @return Type filter before key predicates if used, otherwise null
+ */
+ EdmType getTypeFilterOnCollection();
+
+ /**
+ * @return Type filter behind key predicates if used, otherwise null
+ */
+ EdmType getTypeFilterOnEntry();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePartTyped.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePartTyped.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePartTyped.java
new file mode 100644
index 0000000..4652817
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePartTyped.java
@@ -0,0 +1,43 @@
+/*
+ * 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.server.api.uri;
+
+import org.apache.olingo.commons.api.edm.EdmType;
+
+/**
+ * Used to describe an typed resource part (super interface)
+ */
+public interface UriResourcePartTyped extends UriResource {
+
+ /**
+ * @return Type of the resource part
+ */
+ EdmType getType();
+
+ /**
+ * @return True if the resource part is a collection, otherwise false
+ */
+ boolean isCollection();
+
+ /**
+ * @return String representation of the type
+ */
+ String toString(boolean includeFilters);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePrimitiveProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePrimitiveProperty.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePrimitiveProperty.java
new file mode 100644
index 0000000..7f4265c
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourcePrimitiveProperty.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Used to describe an primitive property used within an resource path
+ * For example: http://.../serviceroot/entityset(1)/property
+ */
+public interface UriResourcePrimitiveProperty extends UriResourceProperty {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceProperty.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceProperty.java
new file mode 100644
index 0000000..72af9cf
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceProperty.java
@@ -0,0 +1,33 @@
+/*
+ * 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.server.api.uri;
+
+import org.apache.olingo.commons.api.edm.EdmProperty;
+
+/**
+ * Used to describe an resource part which is an property (super interface)
+ */
+public interface UriResourceProperty extends UriResourcePartTyped {
+
+ /**
+ * @return Property used in the resource path
+ */
+ EdmProperty getProperty();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRef.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRef.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRef.java
new file mode 100644
index 0000000..d5af947
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRef.java
@@ -0,0 +1,28 @@
+/*
+ * 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.server.api.uri;
+
+
+/**
+ * Used to describe an $ref used within an resource path
+ * For example: http://.../serviceroot/entityset/$ref
+ */
+public interface UriResourceRef extends UriResource {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRoot.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRoot.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRoot.java
new file mode 100644
index 0000000..ebd3e47
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceRoot.java
@@ -0,0 +1,28 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Class indicating the $root reference. $root may be used within expressions to
+ * refer to the current OData service
+ * For example: http://.../serviceroot/entityset(1)?$filter=property eq $root/singleton/configstring
+ */
+public interface UriResourceRoot extends UriResource {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceSingleton.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceSingleton.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceSingleton.java
new file mode 100644
index 0000000..b523962
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceSingleton.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.server.api.uri;
+
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmSingleton;
+
+/**
+ * Used to describe an entity set used within an resource path
+ * For example: http://.../serviceroot/singleton
+ */
+public interface UriResourceSingleton extends UriResourcePartTyped {
+
+ /**
+ * @return Singleton used in the resource path
+ */
+ EdmSingleton getSingleton();
+
+ /**
+ * @return Type of the Singleton
+ */
+ EdmEntityType getEntityType();
+
+
+ /**
+ * @return Type filter
+ */
+ EdmEntityType getEntityTypeFilter();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceValue.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceValue.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceValue.java
new file mode 100644
index 0000000..aa92dfd
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/UriResourceValue.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri;
+
+/**
+ * Used to describe an $value used within an resource path
+ * For example: http://.../serviceroot/entityset(1)/property/$value
+ */
+public interface UriResourceValue extends UriResource {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/AliasQueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/AliasQueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/AliasQueryOption.java
new file mode 100644
index 0000000..24fb1f2
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/AliasQueryOption.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+
+public interface AliasQueryOption extends QueryOption {
+
+ public Expression getValue();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CountOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CountOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CountOption.java
new file mode 100644
index 0000000..7ffef9e
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CountOption.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface CountOption extends SystemQueryOption {
+
+ boolean getValue();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CustomQueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CustomQueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CustomQueryOption.java
new file mode 100644
index 0000000..0d2d7fc
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/CustomQueryOption.java
@@ -0,0 +1,23 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface CustomQueryOption extends QueryOption {
+
+}
[38/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/PropertyValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/PropertyValueImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/PropertyValueImpl.java
new file mode 100644
index 0000000..17c5369
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/PropertyValueImpl.java
@@ -0,0 +1,129 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+
+import org.apache.olingo.client.api.edm.xml.v3.PropertyValue;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class PropertyValueImpl extends AbstractEdmItem implements PropertyValue {
+
+ private static final long serialVersionUID = -6580934436491418564L;
+
+ @JsonProperty(value = "Property", required = true)
+ private String property;
+
+ @JsonProperty("Path")
+ private String path;
+
+ @JsonProperty("String")
+ private String string;
+
+ @JsonProperty("Int")
+ private BigInteger _int;
+
+ @JsonProperty("Float")
+ private Double _float;
+
+ @JsonProperty("Decimal")
+ private BigDecimal decimal;
+
+ @JsonProperty("Bool")
+ private Boolean bool;
+
+ @JsonProperty("DateTime")
+ private Date dateTime;
+
+ @Override
+ public String getProperty() {
+ return property;
+ }
+
+ public void setProperty(final String property) {
+ this.property = property;
+ }
+
+ @Override
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(final String path) {
+ this.path = path;
+ }
+
+ @Override
+ public String getString() {
+ return string;
+ }
+
+ public void setString(final String string) {
+ this.string = string;
+ }
+
+ @Override
+ public BigInteger getInt() {
+ return _int;
+ }
+
+ public void setInt(final BigInteger _int) {
+ this._int = _int;
+ }
+
+ @Override
+ public Double getFloat() {
+ return _float;
+ }
+
+ public void setFloat(final Double _float) {
+ this._float = _float;
+ }
+
+ @Override
+ public BigDecimal getDecimal() {
+ return decimal;
+ }
+
+ public void setDecimal(final BigDecimal decimal) {
+ this.decimal = decimal;
+ }
+
+ @Override
+ public Boolean getBool() {
+ return bool;
+ }
+
+ public void setBool(final Boolean bool) {
+ this.bool = bool;
+ }
+
+ @Override
+ public Date getDateTime() {
+ return dateTime == null ? null : new Date(dateTime.getTime());
+ }
+
+ public void setDateTime(final Date dateTime) {
+ this.dateTime = dateTime == null ? null : new Date(dateTime.getTime());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintImpl.java
new file mode 100644
index 0000000..b60f581
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintImpl.java
@@ -0,0 +1,57 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v3.ReferentialConstraint;
+import org.apache.olingo.client.api.edm.xml.v3.ReferentialConstraintRole;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class ReferentialConstraintImpl extends AbstractEdmItem implements ReferentialConstraint {
+
+ private static final long serialVersionUID = 9067893732765127269L;
+
+ @JsonProperty(value = "Principal", required = true)
+ private ReferentialConstraintRoleImpl principal;
+
+ @JsonProperty(value = "Dependent", required = true)
+ private ReferentialConstraintRoleImpl dependent;
+
+ @Override
+ public ReferentialConstraintRoleImpl getPrincipal() {
+ return principal;
+ }
+
+ @JsonIgnore
+ public void setPrincipal(final ReferentialConstraintRole principal) {
+ this.principal = (ReferentialConstraintRoleImpl) principal;
+ }
+
+ @Override
+ public ReferentialConstraintRoleImpl getDependent() {
+ return dependent;
+ }
+
+ @JsonIgnore
+ public void setDependent(final ReferentialConstraintRole dependent) {
+ this.dependent = (ReferentialConstraintRoleImpl) dependent;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java
new file mode 100644
index 0000000..6a46e1e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.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.edm.xml.v3;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.PropertyRefImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class ReferentialConstraintRoleDeserializer extends AbstractEdmDeserializer<ReferentialConstraintRoleImpl> {
+
+ @Override
+ protected ReferentialConstraintRoleImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final ReferentialConstraintRoleImpl refConstRole = new ReferentialConstraintRoleImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Role".equals(jp.getCurrentName())) {
+ refConstRole.setRole(jp.nextTextValue());
+ } else if ("PropertyRef".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ refConstRole.getPropertyRefs().add(jp.readValueAs( PropertyRefImpl.class));
+ }
+ }
+ }
+
+ return refConstRole;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleImpl.java
new file mode 100644
index 0000000..4f2ddd5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleImpl.java
@@ -0,0 +1,51 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.PropertyRef;
+import org.apache.olingo.client.api.edm.xml.v3.ReferentialConstraintRole;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+@JsonDeserialize(using = ReferentialConstraintRoleDeserializer.class)
+public class ReferentialConstraintRoleImpl extends AbstractEdmItem implements ReferentialConstraintRole {
+
+ private static final long serialVersionUID = -3712887115248634164L;
+
+ private String role;
+
+ private List<PropertyRef> propertyRefs = new ArrayList<PropertyRef>();
+
+ @Override
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(final String role) {
+ this.role = role;
+ }
+
+ public List<PropertyRef> getPropertyRefs() {
+ return propertyRefs;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/SchemaImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/SchemaImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/SchemaImpl.java
new file mode 100644
index 0000000..9f6bba4
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/SchemaImpl.java
@@ -0,0 +1,138 @@
+/*
+ * 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.edm.xml.v3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.ComplexType;
+import org.apache.olingo.client.api.edm.xml.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.EntityType;
+import org.apache.olingo.client.api.edm.xml.EnumType;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.api.edm.xml.v3.Annotations;
+import org.apache.olingo.client.api.edm.xml.v3.Association;
+import org.apache.olingo.client.api.edm.xml.v3.Using;
+import org.apache.olingo.client.api.edm.xml.v3.ValueTerm;
+import org.apache.olingo.client.core.edm.xml.AbstractSchema;
+
+public class SchemaImpl extends AbstractSchema implements Schema {
+
+ private static final long serialVersionUID = 4453992249818796144L;
+
+ private final List<Annotations> annotationList = new ArrayList<Annotations>();
+
+ private final List<Association> associations = new ArrayList<Association>();
+
+ private final List<ComplexType> complexTypes = new ArrayList<ComplexType>();
+
+ private final List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
+
+ private final List<EntityType> entityTypes = new ArrayList<EntityType>();
+
+ private final List<EnumType> enumTypes = new ArrayList<EnumType>();
+
+ private final List<Using> usings = new ArrayList<Using>();
+
+ private final List<ValueTerm> valueTerms = new ArrayList<ValueTerm>();
+
+ public Association getAssociation(final String name) {
+ return getOneByName(name, getAssociations());
+ }
+
+ @Override
+ public List<Annotations> getAnnotationsList() {
+ return annotationList;
+ }
+
+ @Override
+ public Annotations getAnnotationsList(final String target) {
+ Annotations result = null;
+ for (Annotations annots : getAnnotationsList()) {
+ if (target.equals(annots.getTarget())) {
+ result = annots;
+ }
+ }
+ return result;
+ }
+
+ public List<Association> getAssociations() {
+ return associations;
+ }
+
+ public List<Using> getUsings() {
+ return usings;
+ }
+
+ public List<ValueTerm> getValueTerms() {
+ return valueTerms;
+ }
+
+ @Override
+ public List<EntityContainer> getEntityContainers() {
+ return entityContainers;
+ }
+
+ @Override
+ public EntityContainer getDefaultEntityContainer() {
+ EntityContainer result = null;
+ for (EntityContainer container : getEntityContainers()) {
+ if (container.isDefaultEntityContainer()) {
+ result = container;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public EntityContainer getEntityContainer(final String name) {
+ return getOneByName(name, getEntityContainers());
+ }
+
+ @Override
+ public EnumTypeImpl getEnumType(final String name) {
+ return (EnumTypeImpl) super.getEnumType(name);
+ }
+
+ @Override
+ public List<EnumType> getEnumTypes() {
+ return enumTypes;
+ }
+
+ @Override
+ public ComplexTypeImpl getComplexType(final String name) {
+ return (ComplexTypeImpl) super.getComplexType(name);
+ }
+
+ @Override
+ public List<ComplexType> getComplexTypes() {
+ return complexTypes;
+ }
+
+ @Override
+ public EntityTypeImpl getEntityType(final String name) {
+ return (EntityTypeImpl) super.getEntityType(name);
+ }
+
+ @Override
+ public List<EntityType> getEntityTypes() {
+ return entityTypes;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationDeserializer.java
new file mode 100644
index 0000000..331f1b1
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationDeserializer.java
@@ -0,0 +1,54 @@
+/*
+ * 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.edm.xml.v3;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class TypeAnnotationDeserializer extends AbstractEdmDeserializer<TypeAnnotationImpl> {
+
+ @Override
+ protected TypeAnnotationImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final TypeAnnotationImpl typeAnnot = new TypeAnnotationImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Term".equals(jp.getCurrentName())) {
+ typeAnnot.setTerm(jp.nextTextValue());
+ } else if ("Qualifier".equals(jp.getCurrentName())) {
+ typeAnnot.setQualifier(jp.nextTextValue());
+ } else if ("PropertyValue".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ typeAnnot.getPropertyValues().add(jp.readValueAs( PropertyValueImpl.class));
+ }
+ }
+ }
+
+ return typeAnnot;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationImpl.java
new file mode 100644
index 0000000..fe713d4
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationImpl.java
@@ -0,0 +1,64 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v3.PropertyValue;
+import org.apache.olingo.client.api.edm.xml.v3.TypeAnnotation;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+@JsonDeserialize(using = TypeAnnotationDeserializer.class)
+public class TypeAnnotationImpl extends AbstractEdmItem implements TypeAnnotation {
+
+ private static final long serialVersionUID = -7585489230017331877L;
+
+ private String term;
+
+ private String qualifier;
+
+ private List<PropertyValue> propertyValues = new ArrayList<PropertyValue>();
+
+ @Override
+ public String getTerm() {
+ return term;
+ }
+
+ public void setTerm(final String term) {
+ this.term = term;
+ }
+
+ @Override
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public void setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ }
+
+ @Override
+ public List<PropertyValue> getPropertyValues() {
+ return propertyValues;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/UsingImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/UsingImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/UsingImpl.java
new file mode 100644
index 0000000..e701682
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/UsingImpl.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.edm.xml.v3;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v3.Using;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class UsingImpl extends AbstractEdmItem implements Using {
+
+ private static final long serialVersionUID = 2086957510154443445L;
+
+ @JsonProperty(value = "Namespace", required = true)
+ private String namespace;
+
+ @JsonProperty("Alias")
+ private String alias;
+
+ @Override
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(final String namespace) {
+ this.namespace = namespace;
+ }
+
+ @Override
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(final String alias) {
+ this.alias = alias;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ValueAnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ValueAnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ValueAnnotationImpl.java
new file mode 100644
index 0000000..b55270f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ValueAnnotationImpl.java
@@ -0,0 +1,141 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+
+import org.apache.olingo.client.api.edm.xml.v3.ValueAnnotation;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class ValueAnnotationImpl extends AbstractEdmItem implements ValueAnnotation {
+
+ private static final long serialVersionUID = -1826414005417952278L;
+
+ @JsonProperty(value = "Term", required = true)
+ private String term;
+
+ @JsonProperty("Qualifier")
+ private String qualifier;
+
+ @JsonProperty("Path")
+ private String path;
+
+ @JsonProperty("String")
+ private String string;
+
+ @JsonProperty("Int")
+ private BigInteger _int;
+
+ @JsonProperty("Float")
+ private Double _float;
+
+ @JsonProperty("Decimal")
+ private BigDecimal decimal;
+
+ @JsonProperty("Bool")
+ private Boolean bool;
+
+ @JsonProperty("DateTime")
+ private Date dateTime;
+
+ @Override
+ public String getTerm() {
+ return term;
+ }
+
+ public void setTerm(final String term) {
+ this.term = term;
+ }
+
+ @Override
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public void setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ }
+
+ @Override
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(final String path) {
+ this.path = path;
+ }
+
+ @Override
+ public String getString() {
+ return string;
+ }
+
+ public void setString(final String string) {
+ this.string = string;
+ }
+
+ @Override
+ public BigInteger getInt() {
+ return _int;
+ }
+
+ public void setInt(final BigInteger _int) {
+ this._int = _int;
+ }
+
+ @Override
+ public Double getFloat() {
+ return _float;
+ }
+
+ public void setFloat(final Double _float) {
+ this._float = _float;
+ }
+
+ @Override
+ public BigDecimal getDecimal() {
+ return decimal;
+ }
+
+ public void setDecimal(final BigDecimal decimal) {
+ this.decimal = decimal;
+ }
+
+ @Override
+ public Boolean getBool() {
+ return bool;
+ }
+
+ public void setBool(final Boolean bool) {
+ this.bool = bool;
+ }
+
+ @Override
+ public Date getDateTime() {
+ return dateTime == null ? null : new Date(dateTime.getTime());
+ }
+
+ public void setDateTime(final Date dateTime) {
+ this.dateTime = dateTime == null ? null : new Date(dateTime.getTime());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ValueTermImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ValueTermImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ValueTermImpl.java
new file mode 100644
index 0000000..9b2e663
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ValueTermImpl.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.edm.xml.v3;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v3.ValueTerm;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class ValueTermImpl extends AbstractEdmItem implements ValueTerm {
+
+ private static final long serialVersionUID = 6149019886137610604L;
+
+ @JsonProperty(value = "Name", required = true)
+ private String name;
+
+ @JsonProperty(value = "Type", required = true)
+ private String type;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/XMLMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/XMLMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/XMLMetadataImpl.java
new file mode 100644
index 0000000..82601db
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/XMLMetadataImpl.java
@@ -0,0 +1,31 @@
+/*
+ * 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.edm.xml.v3;
+
+import org.apache.olingo.client.core.edm.xml.AbstractXMLMetadata;
+
+public class XMLMetadataImpl extends AbstractXMLMetadata {
+
+ private static final long serialVersionUID = -7765327879691528010L;
+
+ public XMLMetadataImpl(final EdmxImpl edmx) {
+ super(edmx);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AbstractAnnotatedEdmItem.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AbstractAnnotatedEdmItem.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AbstractAnnotatedEdmItem.java
new file mode 100644
index 0000000..18b01be
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AbstractAnnotatedEdmItem.java
@@ -0,0 +1,45 @@
+/*
+ * 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.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.v4.AnnotatedEdmItem;
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public abstract class AbstractAnnotatedEdmItem extends AbstractEdmItem implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = -8859729466090997718L;
+
+ @JsonProperty("Annotation")
+ private AnnotationImpl annotation;
+
+ @Override
+ public AnnotationImpl getAnnotation() {
+ return annotation;
+ }
+
+ @JsonIgnore
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = (AnnotationImpl) annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionDeserializer.java
new file mode 100644
index 0000000..3bde506
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionDeserializer.java
@@ -0,0 +1,62 @@
+/*
+ * 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.edm.xml.v4;
+
+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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class ActionDeserializer extends AbstractEdmDeserializer<ActionImpl> {
+
+ @Override
+ protected ActionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final ActionImpl action = new ActionImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ action.setName(jp.nextTextValue());
+ } else if ("IsBound".equals(jp.getCurrentName())) {
+ action.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("EntitySetPath".equals(jp.getCurrentName())) {
+ action.setEntitySetPath(jp.nextTextValue());
+ } else if ("Parameter".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ action.getParameters().add(jp.readValueAs(ParameterImpl.class));
+ } else if ("ReturnType".equals(jp.getCurrentName())) {
+ action.setReturnType(parseReturnType(jp, "Action"));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ action.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return action;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionImpl.java
new file mode 100644
index 0000000..9ad13c8
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionImpl.java
@@ -0,0 +1,91 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Action;
+import org.apache.olingo.client.api.edm.xml.v4.Parameter;
+import org.apache.olingo.client.api.edm.xml.v4.ReturnType;
+
+@JsonDeserialize(using = ActionDeserializer.class)
+public class ActionImpl extends AbstractAnnotatedEdmItem implements Action {
+
+ private static final long serialVersionUID = -99977447455438193L;
+
+ private String name;
+
+ private boolean bound = false;
+
+ private String entitySetPath;
+
+ private final List<Parameter> parameters = new ArrayList<Parameter>();
+
+ private ReturnType returnType;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean isBound() {
+ return bound;
+ }
+
+ public void setBound(final boolean bound) {
+ this.bound = bound;
+ }
+
+ @Override
+ public String getEntitySetPath() {
+ return entitySetPath;
+ }
+
+ public void setEntitySetPath(final String entitySetPath) {
+ this.entitySetPath = entitySetPath;
+ }
+
+ @Override
+ public Parameter getParameter(final String name) {
+ return getOneByName(name, getParameters());
+ }
+
+ @Override
+ public List<Parameter> getParameters() {
+ return parameters;
+ }
+
+ @Override
+ public ReturnType getReturnType() {
+ return returnType;
+ }
+
+ public void setReturnType(final ReturnType returnType) {
+ this.returnType = returnType;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionImportImpl.java
new file mode 100644
index 0000000..d543998
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionImportImpl.java
@@ -0,0 +1,66 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v4.ActionImport;
+
+public class ActionImportImpl extends AbstractAnnotatedEdmItem implements ActionImport {
+
+ private static final long serialVersionUID = -866422101558426421L;
+
+ @JsonProperty(value = "Name", required = true)
+ private String name;
+
+ @JsonProperty(value = "Action", required = true)
+ private String action;
+
+ @JsonProperty(value = "EntitySet")
+ private String entitySet;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getAction() {
+ return action;
+ }
+
+ public void setAction(final String action) {
+ this.action = action;
+ }
+
+ @Override
+ public String getEntitySet() {
+ return entitySet;
+ }
+
+ @Override
+ public void setEntitySet(final String entitySet) {
+ this.entitySet = entitySet;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationDeserializer.java
new file mode 100644
index 0000000..c5c3bb6
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationDeserializer.java
@@ -0,0 +1,59 @@
+/*
+ * 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.edm.xml.v4;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.v4.annotation.DynExprConstructImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class AnnotationDeserializer extends AbstractEdmDeserializer<AnnotationImpl> {
+
+ @Override
+ protected AnnotationImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AnnotationImpl annotation = new AnnotationImpl();
+
+ for (; jp.getCurrentToken() != null && jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Term".equals(jp.getCurrentName())) {
+ annotation.setTerm(jp.nextTextValue());
+ } else if ("Qualifier".equals(jp.getCurrentName())) {
+ annotation.setQualifier(jp.nextTextValue());
+ } else if (isAnnotationConstExprConstruct(jp)) {
+ // Constant Expressions
+ annotation.setConstExpr(parseAnnotationConstExprConstruct(jp));
+ } else {
+ // Dynamic Expressions
+ annotation.setDynExpr(jp.readValueAs( DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationImpl.java
new file mode 100644
index 0000000..d495b8c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationImpl.java
@@ -0,0 +1,77 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.annotation.ConstExprConstruct;
+import org.apache.olingo.client.api.edm.xml.v4.annotation.DynExprConstruct;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+@JsonDeserialize(using = AnnotationDeserializer.class)
+public class AnnotationImpl extends AbstractEdmItem implements Annotation {
+
+ private static final long serialVersionUID = -5600031479702563436L;
+
+ private String term;
+
+ private String qualifier;
+
+ private ConstExprConstruct constExpr;
+
+ private DynExprConstruct dynExpr;
+
+ @Override
+ public String getTerm() {
+ return term;
+ }
+
+ public void setTerm(final String term) {
+ this.term = term;
+ }
+
+ @Override
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public void setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ }
+
+ @Override
+ public ConstExprConstruct getConstExpr() {
+ return constExpr;
+ }
+
+ public void setConstExpr(final ConstExprConstruct constExpr) {
+ this.constExpr = constExpr;
+ }
+
+ @Override
+ public DynExprConstruct getDynExpr() {
+ return dynExpr;
+ }
+
+ public void setDynExpr(final DynExprConstruct dynExpr) {
+ this.dynExpr = dynExpr;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsDeserializer.java
new file mode 100644
index 0000000..c46adb5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsDeserializer.java
@@ -0,0 +1,55 @@
+/*
+ * 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.edm.xml.v4;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class AnnotationsDeserializer extends AbstractEdmDeserializer<AnnotationsImpl> {
+
+ @Override
+ protected AnnotationsImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AnnotationsImpl annotations = new AnnotationsImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Target".equals(jp.getCurrentName())) {
+ annotations.setTarget(jp.nextTextValue());
+ } else if ("Qualifier".equals(jp.getCurrentName())) {
+ annotations.setQualifier(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ annotations.getAnnotations().add(jp.readValueAs( AnnotationImpl.class));
+ }
+ }
+ }
+
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsImpl.java
new file mode 100644
index 0000000..a579624
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsImpl.java
@@ -0,0 +1,51 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Annotations;
+import org.apache.olingo.client.core.edm.xml.AbstractAnnotations;
+
+@JsonDeserialize(using = AnnotationsDeserializer.class)
+public class AnnotationsImpl extends AbstractAnnotations implements Annotations {
+
+ private static final long serialVersionUID = 3877353656301805410L;
+
+ private final List<AnnotationImpl> annotations = new ArrayList<AnnotationImpl>();
+
+ @Override
+ public List<AnnotationImpl> getAnnotations() {
+ return annotations;
+ }
+
+ @Override
+ public AnnotationImpl getAnnotation(final String term) {
+ AnnotationImpl result = null;
+ for (AnnotationImpl annotation : getAnnotations()) {
+ if (term.equals(annotation.getTerm())) {
+ result = annotation;
+ }
+ }
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ComplexTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ComplexTypeImpl.java
new file mode 100644
index 0000000..b91259a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ComplexTypeImpl.java
@@ -0,0 +1,102 @@
+/*
+ * 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 >ied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.ComplexType;
+import org.apache.olingo.client.api.edm.xml.v4.NavigationProperty;
+import org.apache.olingo.client.api.edm.xml.v4.Property;
+import org.apache.olingo.client.core.edm.xml.AbstractComplexType;
+
+public class ComplexTypeImpl extends AbstractComplexType implements ComplexType {
+
+ private static final long serialVersionUID = -1251230308269425962L;
+
+ private boolean abstractEntityType = false;
+
+ private String baseType;
+
+ private boolean openType = false;
+
+ private final List<Property> properties = new ArrayList<Property>();
+
+ private final List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
+
+ private Annotation annotation;
+
+ @Override
+ public boolean isAbstractEntityType() {
+ return abstractEntityType;
+ }
+
+ public void setAbstractEntityType(final boolean abstractEntityType) {
+ this.abstractEntityType = abstractEntityType;
+ }
+
+ @Override
+ public String getBaseType() {
+ return baseType;
+ }
+
+ public void setBaseType(final String baseType) {
+ this.baseType = baseType;
+ }
+
+ @Override
+ public boolean isOpenType() {
+ return openType;
+ }
+
+ public void setOpenType(final boolean openType) {
+ this.openType = openType;
+ }
+
+ @Override
+ public Property getProperty(final String name) {
+ return (Property) super.getProperty(name);
+ }
+
+ @Override
+ public List<Property> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public NavigationProperty getNavigationProperty(final String name) {
+ return (NavigationProperty) super.getNavigationProperty(name);
+ }
+
+ @Override
+ public List<NavigationProperty> getNavigationProperties() {
+ return navigationProperties;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/DataServicesImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/DataServicesImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/DataServicesImpl.java
new file mode 100644
index 0000000..bf4ed66
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/DataServicesImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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.edm.xml.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Schema;
+import org.apache.olingo.client.core.edm.xml.AbstractDataServices;
+
+public class DataServicesImpl extends AbstractDataServices {
+
+ private static final long serialVersionUID = -7954360771258897632L;
+
+ private final List<Schema> schemas = new ArrayList<Schema>();
+
+ @Override
+ public List<Schema> getSchemas() {
+ return schemas;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EdmxImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EdmxImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EdmxImpl.java
new file mode 100644
index 0000000..d1bbd07
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EdmxImpl.java
@@ -0,0 +1,44 @@
+/*
+ * 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.edm.xml.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Edmx;
+import org.apache.olingo.client.api.edm.xml.v4.Reference;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmx;
+
+public class EdmxImpl extends AbstractEdmx implements Edmx {
+
+ private static final long serialVersionUID = -8031883176876401375L;
+
+ private final List<Reference> references = new ArrayList<Reference>();
+
+ @Override
+ public DataServicesImpl getDataServices() {
+ return (DataServicesImpl) super.getDataServices();
+ }
+
+ @Override
+ public List<Reference> getReferences() {
+ return references;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntityContainerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntityContainerImpl.java
new file mode 100644
index 0000000..c67e17d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntityContainerImpl.java
@@ -0,0 +1,129 @@
+/*
+ * 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.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.v4.ActionImport;
+import org.apache.olingo.client.api.edm.xml.v4.AnnotatedEdmItem;
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.v4.EntitySet;
+import org.apache.olingo.client.api.edm.xml.v4.FunctionImport;
+import org.apache.olingo.client.api.edm.xml.v4.Singleton;
+import org.apache.olingo.client.core.edm.xml.AbstractEntityContainer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class EntityContainerImpl extends AbstractEntityContainer implements AnnotatedEdmItem, EntityContainer {
+
+ private static final long serialVersionUID = 2526002525927260320L;
+
+ private final List<EntitySet> entitySets = new ArrayList<EntitySet>();
+
+ private final List<Singleton> singletons = new ArrayList<Singleton>();
+
+ private final List<ActionImport> actionImports = new ArrayList<ActionImport>();
+
+ private final List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
+
+ private Annotation annotation;
+
+ @Override
+ public void setDefaultEntityContainer(final boolean defaultEntityContainer) {
+ // no action: a single entity container MUST be available as per OData 4.0
+ }
+
+ @Override
+ public boolean isDefaultEntityContainer() {
+ return true;
+ }
+
+ @Override
+ public EntitySet getEntitySet(final String name) {
+ return (EntitySet) super.getEntitySet(name);
+ }
+
+ @Override
+ public List<EntitySet> getEntitySets() {
+ return entitySets;
+ }
+
+ @Override
+ public List<Singleton> getSingletons() {
+ return singletons;
+ }
+
+ @Override
+ public Singleton getSingleton(final String name) {
+ return getOneByName(name, getSingletons());
+ }
+
+ @Override
+ public FunctionImport getFunctionImport(final String name) {
+ return (FunctionImport) super.getFunctionImport(name);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<FunctionImport> getFunctionImports(final String name) {
+ return (List<FunctionImport>) super.getFunctionImports(name);
+ }
+
+ /**
+ * Gets the first action import with given name.
+ *
+ * @param name name.
+ * @return action import.
+ */
+ @Override
+ public ActionImport getActionImport(final String name) {
+ return getOneByName(name, getActionImports());
+ }
+
+ /**
+ * Gets all action imports with given name.
+ *
+ * @param name name.
+ * @return action imports.
+ */
+ @Override
+ public List<ActionImport> getActionImports(final String name) {
+ return getAllByName(name, getActionImports());
+ }
+
+ @Override
+ public List<ActionImport> getActionImports() {
+ return actionImports;
+ }
+
+ @Override
+ public List<FunctionImport> getFunctionImports() {
+ return functionImports;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntitySetImpl.java
new file mode 100644
index 0000000..9ef33c7
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntitySetImpl.java
@@ -0,0 +1,62 @@
+/*
+ * 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.edm.xml.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.EntitySet;
+import org.apache.olingo.client.api.edm.xml.v4.NavigationPropertyBinding;
+import org.apache.olingo.client.core.edm.xml.AbstractEntitySet;
+
+public class EntitySetImpl extends AbstractEntitySet implements EntitySet {
+
+ private static final long serialVersionUID = 5570833733884884012L;
+
+ private boolean includeInServiceDocument = true;
+
+ private Annotation annotation;
+
+ private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
+
+ @Override
+ public boolean isIncludeInServiceDocument() {
+ return includeInServiceDocument;
+ }
+
+ public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
+ this.includeInServiceDocument = includeInServiceDocument;
+ }
+
+ @Override
+ public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
+ return navigationPropertyBindings;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntityTypeImpl.java
new file mode 100644
index 0000000..4de9101
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EntityTypeImpl.java
@@ -0,0 +1,69 @@
+/*
+ * 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.edm.xml.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.EntityType;
+import org.apache.olingo.client.api.edm.xml.v4.NavigationProperty;
+import org.apache.olingo.client.api.edm.xml.v4.Property;
+import org.apache.olingo.client.core.edm.xml.AbstractEntityType;
+
+public class EntityTypeImpl extends AbstractEntityType implements EntityType {
+
+ private static final long serialVersionUID = 8727765036150269547L;
+
+ private final List<Property> properties = new ArrayList<Property>();
+
+ private final List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
+
+ private Annotation annotation;
+
+ @Override
+ public Property getProperty(final String name) {
+ return (Property) super.getProperty(name);
+ }
+
+ @Override
+ public List<Property> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public NavigationProperty getNavigationProperty(final String name) {
+ return (NavigationProperty) super.getNavigationProperty(name);
+ }
+
+ @Override
+ public List<NavigationProperty> getNavigationProperties() {
+ return navigationProperties;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EnumTypeImpl.java
new file mode 100644
index 0000000..9c9b84d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/EnumTypeImpl.java
@@ -0,0 +1,40 @@
+/*
+ * 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.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.v4.AnnotatedEdmItem;
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.core.edm.xml.AbstractEnumType;
+
+public class EnumTypeImpl extends AbstractEnumType implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = -3329664331877556957L;
+
+ private Annotation annotation;
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionDeserializer.java
new file mode 100644
index 0000000..f316d2f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionDeserializer.java
@@ -0,0 +1,64 @@
+/*
+ * 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.edm.xml.v4;
+
+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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class FunctionDeserializer extends AbstractEdmDeserializer<FunctionImpl> {
+
+ @Override
+ protected FunctionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final FunctionImpl functionImpl = new FunctionImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ functionImpl.setName(jp.nextTextValue());
+ } else if ("IsBound".equals(jp.getCurrentName())) {
+ functionImpl.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("IsComposable".equals(jp.getCurrentName())) {
+ functionImpl.setComposable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("EntitySetPath".equals(jp.getCurrentName())) {
+ functionImpl.setEntitySetPath(jp.nextTextValue());
+ } else if ("Parameter".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ functionImpl.getParameters().add(jp.readValueAs(ParameterImpl.class));
+ } else if ("ReturnType".equals(jp.getCurrentName())) {
+ functionImpl.setReturnType(parseReturnType(jp, "Function"));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ functionImpl.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return functionImpl;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionImpl.java
new file mode 100644
index 0000000..7041bff
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionImpl.java
@@ -0,0 +1,41 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.v4.Function;
+
+@JsonDeserialize(using = FunctionDeserializer.class)
+public class FunctionImpl extends ActionImpl implements Function {
+
+ private static final long serialVersionUID = -5888231162358116515L;
+
+ private boolean composable = false;
+
+ @Override
+ public boolean isComposable() {
+ return composable;
+ }
+
+ public void setComposable(final boolean composable) {
+ this.composable = composable;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionImportImpl.java
new file mode 100644
index 0000000..5391d93
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionImportImpl.java
@@ -0,0 +1,93 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.FunctionImport;
+
+public class FunctionImportImpl implements FunctionImport {
+
+ private static final long serialVersionUID = 3023813358471000019L;
+
+ @JsonProperty(value = "Name", required = true)
+ private String name;
+
+ @JsonProperty(value = "Function", required = true)
+ private String function;
+
+ @JsonProperty(value = "EntitySet")
+ private String entitySet;
+
+ @JsonProperty(value = "IncludeInServiceDocument")
+ private boolean includeInServiceDocument = false;
+
+ @JsonProperty(value = "Annotation")
+ private Annotation annotation;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getFunction() {
+ return function;
+ }
+
+ public void setFunction(final String function) {
+ this.function = function;
+ }
+
+ @Override
+ public String getEntitySet() {
+ return entitySet;
+ }
+
+ @Override
+ public void setEntitySet(final String entitySet) {
+ this.entitySet = entitySet;
+ }
+
+ @Override
+ public boolean isIncludeInServiceDocument() {
+ return includeInServiceDocument;
+ }
+
+ public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
+ this.includeInServiceDocument = includeInServiceDocument;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @JsonIgnore
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/IncludeAnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/IncludeAnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/IncludeAnnotationsImpl.java
new file mode 100644
index 0000000..a38345d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/IncludeAnnotationsImpl.java
@@ -0,0 +1,66 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v4.IncludeAnnotations;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class IncludeAnnotationsImpl extends AbstractEdmItem implements IncludeAnnotations {
+
+ private static final long serialVersionUID = -5600031479702563436L;
+
+ @JsonProperty(value = "TermNamespace", required = true)
+ private String termNamespace;
+
+ @JsonProperty(value = "Qualifier")
+ private String qualifier;
+
+ @JsonProperty(value = "TargetNamespace")
+ private String targeyNamespace;
+
+ @Override
+ public String getTermNamespace() {
+ return termNamespace;
+ }
+
+ public void setTermNamespace(final String termNamespace) {
+ this.termNamespace = termNamespace;
+ }
+
+ @Override
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public void setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ }
+
+ @Override
+ public String getTargeyNamespace() {
+ return targeyNamespace;
+ }
+
+ public void setTargeyNamespace(final String targeyNamespace) {
+ this.targeyNamespace = targeyNamespace;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/IncludeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/IncludeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/IncludeImpl.java
new file mode 100644
index 0000000..ea9bc01
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/IncludeImpl.java
@@ -0,0 +1,54 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v4.Include;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class IncludeImpl extends AbstractEdmItem implements Include {
+
+ private static final long serialVersionUID = -5600031479702563436L;
+
+ @JsonProperty(value = "Namespace", required = true)
+ private String namespace;
+
+ @JsonProperty(value = "Alias")
+ private String alias;
+
+ @Override
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(final String namespace) {
+ this.namespace = namespace;
+ }
+
+ @Override
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(final String alias) {
+ this.alias = alias;
+ }
+
+}
[46/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/utils/EdmTypeInfo.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/utils/EdmTypeInfo.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/utils/EdmTypeInfo.java
new file mode 100644
index 0000000..5184614
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/utils/EdmTypeInfo.java
@@ -0,0 +1,81 @@
+/*
+ * 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.api.utils;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class EdmTypeInfo {
+
+ private final String typeExpression;
+
+ private final boolean collection;
+
+ private final FullQualifiedName fullQualifiedName;
+
+ public EdmTypeInfo(final String typeExpression, final String defaultNamespace) {
+ this(typeExpression.indexOf('.') == -1
+ ? defaultNamespace + "." + typeExpression
+ : typeExpression);
+ }
+
+ public EdmTypeInfo(final String typeExpression) {
+ this.typeExpression = typeExpression;
+
+ String baseType;
+ final int collStartIdx = typeExpression.indexOf("Collection(");
+ final int collEndIdx = typeExpression.lastIndexOf(')');
+ if (collStartIdx == -1) {
+ baseType = typeExpression;
+ this.collection = false;
+ } else {
+ if (collEndIdx == -1) {
+ throw new IllegalArgumentException("Malformed type: " + typeExpression);
+ }
+
+ this.collection = true;
+ baseType = typeExpression.substring(collStartIdx + 11, collEndIdx);
+ }
+
+ final int lastDotIdx = baseType.lastIndexOf('.');
+ if (lastDotIdx == -1) {
+ throw new IllegalArgumentException("Cannot find namespace or alias in " + typeExpression);
+ }
+ final String namespace = baseType.substring(0, lastDotIdx);
+ final String typeName = baseType.substring(lastDotIdx + 1);
+ if (StringUtils.isBlank(typeName)) {
+ throw new IllegalArgumentException("Null or empty type name in " + typeExpression);
+ }
+
+ this.fullQualifiedName = new FullQualifiedName(namespace, typeName);
+ }
+
+ public String getTypeExpression() {
+ return typeExpression;
+ }
+
+ public boolean isCollection() {
+ return collection;
+ }
+
+ public FullQualifiedName getFullQualifiedName() {
+ return fullQualifiedName;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/utils/XMLUtils.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/utils/XMLUtils.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/utils/XMLUtils.java
new file mode 100644
index 0000000..8880d15
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/utils/XMLUtils.java
@@ -0,0 +1,178 @@
+/*
+ * 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.api.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.Constants;
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+import org.apache.olingo.client.api.domain.geospatial.Geospatial;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * XML utilities.
+ */
+public final class XMLUtils {
+
+ /**
+ * DOM factory.
+ */
+ public static final DocumentBuilderFactory DOC_BUILDER_FACTORY = DocumentBuilderFactory.newInstance();
+
+ private XMLUtils() {
+ // Empty private constructor for static utility classes
+ }
+
+ /**
+ * Gets XML node name.
+ *
+ * @param node node.
+ * @return node name.
+ */
+ public static String getSimpleName(final Node node) {
+ return node.getLocalName() == null
+ ? node.getNodeName().substring(node.getNodeName().indexOf(':') + 1)
+ : node.getLocalName();
+ }
+
+ /**
+ * Gets the given node's children of the given type.
+ *
+ * @param node parent.
+ * @param nodetype searched child type.
+ * @return children.
+ */
+ public static List<Node> getChildNodes(final Node node, final short nodetype) {
+ final List<Node> result = new ArrayList<Node>();
+
+ final NodeList children = node.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ final Node child = children.item(i);
+ if (child.getNodeType() == nodetype) {
+ result.add(child);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Gets the given node's children with the given name.
+ *
+ * @param node parent.
+ * @param name searched child name.
+ * @return children.
+ */
+ public static List<Element> getChildElements(final Element node, final String name) {
+ final List<Element> result = new ArrayList<Element>();
+
+ if (StringUtils.isNotBlank(name)) {
+ final NodeList children = node.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ final Node child = children.item(i);
+ if ((child instanceof Element) && name.equals(child.getNodeName())) {
+ result.add((Element) child);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Checks if the given node has <tt>element</tt> children.
+ *
+ * @param node parent.
+ * @return 'TRUE' if the given node has at least one <tt>element</tt> child; 'FALSE' otherwise.
+ */
+ public static boolean hasElementsChildNode(final Node node) {
+ boolean found = false;
+
+ for (Node child : getChildNodes(node, Node.ELEMENT_NODE)) {
+ if (Constants.ELEM_ELEMENT.equals(XMLUtils.getSimpleName(child))) {
+ found = true;
+ }
+ }
+
+ return found;
+ }
+
+ /**
+ * Checks if the given node has only text children.
+ *
+ * @param node parent.
+ * @return 'TRUE' if the given node has only text children; 'FALSE' otherwise.
+ */
+ public static boolean hasOnlyTextChildNodes(final Node node) {
+ boolean result = true;
+ final NodeList children = node.getChildNodes();
+ for (int i = 0; result && i < children.getLength(); i++) {
+ final Node child = children.item(i);
+ if (child.getNodeType() != Node.TEXT_NODE) {
+ result = false;
+ }
+ }
+
+ return result;
+ }
+
+ public static EdmSimpleType simpleTypeForNode(final Geospatial.Dimension dimension, final Node node) {
+ EdmSimpleType type = null;
+
+ if (Constants.ELEM_POINT.equals(node.getNodeName())) {
+ type = dimension == Geospatial.Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyPoint
+ : EdmSimpleType.GeometryPoint;
+ } else if (Constants.ELEM_MULTIPOINT.equals(node.getNodeName())) {
+ type = dimension == Geospatial.Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyMultiPoint
+ : EdmSimpleType.GeometryMultiPoint;
+ } else if (Constants.ELEM_LINESTRING.equals(node.getNodeName())) {
+ type = dimension == Geospatial.Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyLineString
+ : EdmSimpleType.GeometryLineString;
+ } else if (Constants.ELEM_MULTILINESTRING.equals(node.getNodeName())) {
+ type = dimension == Geospatial.Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyMultiLineString
+ : EdmSimpleType.GeometryMultiLineString;
+ } else if (Constants.ELEM_POLYGON.equals(node.getNodeName())) {
+ type = dimension == Geospatial.Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyPolygon
+ : EdmSimpleType.GeometryPolygon;
+ } else if (Constants.ELEM_MULTIPOLYGON.equals(node.getNodeName())) {
+ type = dimension == Geospatial.Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyMultiPolygon
+ : EdmSimpleType.GeometryMultiPolygon;
+ } else if (Constants.ELEM_GEOCOLLECTION.equals(node.getNodeName())
+ || Constants.ELEM_GEOMEMBERS.equals(node.getNodeName())) {
+
+ type = dimension == Geospatial.Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyCollection
+ : EdmSimpleType.GeometryCollection;
+ }
+
+ return type;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/Configuration.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/Configuration.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/Configuration.java
deleted file mode 100644
index 6e69032..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/Configuration.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 org.apache.olingo.odata4.client.api;
-
-import org.apache.olingo.odata4.client.api.http.HttpUriRequestFactory;
-import org.apache.olingo.odata4.client.api.http.HttpClientFactory;
-import java.io.Serializable;
-import java.util.concurrent.ExecutorService;
-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;
-
-/**
- * Configuration wrapper.
- */
-public interface Configuration extends Serializable {
-
- /**
- * Gets the configured OData format for AtomPub exchanges. If this configuration parameter doesn't exist the
- * JSON_FULL_METADATA format will be used as default.
- *
- * @return configured OData format for AtomPub if specified; JSON_FULL_METADATA format otherwise.
- * @see ODataPubFormat#JSON_FULL_METADATA
- */
- ODataPubFormat getDefaultPubFormat();
-
- /**
- * Sets the default OData format for AtomPub exchanges.
- *
- * @param format default format.
- */
- void setDefaultPubFormat(ODataPubFormat format);
-
- /**
- * Gets the configured OData format. This value depends on what is returned from <tt>getDefaultPubFormat()</tt>.
- *
- * @return configured OData format
- * @see #getDefaultPubFormat()
- */
- ODataFormat getDefaultFormat();
-
- /**
- * Gets the configured OData value format. If this configuration parameter doesn't exist the TEXT format will be used
- * as default.
- *
- * @return configured OData value format if specified; TEXT format otherwise.
- * @see ODataValueFormat#TEXT
- */
- ODataValueFormat getDefaultValueFormat();
-
- /**
- * Sets the default OData value format.
- *
- * @param format default format.
- */
- void setDefaultValueFormat(ODataValueFormat format);
-
- /**
- * Gets the configured OData media format. If this configuration parameter doesn't exist the APPLICATION_OCTET_STREAM
- * format will be used as default.
- *
- * @return configured OData media format if specified; APPLICATION_OCTET_STREAM format otherwise.
- * @see ODataMediaFormat#WILDCARD
- */
- ODataMediaFormat getDefaultMediaFormat();
-
- /**
- * Sets the default OData media format.
- *
- * @param format default format.
- */
- void setDefaultMediaFormat(ODataMediaFormat format);
-
- /**
- * Gets the HttpClient factory to be used for executing requests.
- *
- * @return provided implementation (if configured via <tt>setHttpClientFactory</tt> or default.
- * @see DefaultHttpClientFactory
- */
- HttpClientFactory getHttpClientFactory();
-
- /**
- * Sets the HttpClient factory to be used for executing requests.
- *
- * @param factory implementation of <tt>HttpClientFactory</tt>.
- * @see HttpClientFactory
- */
- void setHttpClientFactory(HttpClientFactory factory);
-
- /**
- * Gets the HttpUriRequest factory for generating requests to be executed.
- *
- * @return provided implementation (if configured via <tt>setHttpUriRequestFactory</tt> or default.
- * @see DefaultHttpUriRequestFactory
- */
- HttpUriRequestFactory getHttpUriRequestFactory();
-
- /**
- * Sets the HttpUriRequest factory generating requests to be executed.
- *
- * @param factory implementation of <tt>HttpUriRequestFactory</tt>.
- * @see HttpUriRequestFactory
- */
- void setHttpUriRequestFactory(HttpUriRequestFactory factory);
-
- /**
- * Gets whether <tt>PUT</tt>, <tt>MERGE</tt>, <tt>PATCH</tt>, <tt>DELETE</tt> HTTP methods need to be translated to
- * <tt>POST</tt> with additional <tt>X-HTTTP-Method</tt> header.
- *
- * @return whether <tt>X-HTTTP-Method</tt> header is to be used
- */
- boolean isUseXHTTPMethod();
-
- /**
- * Sets whether <tt>PUT</tt>, <tt>MERGE</tt>, <tt>PATCH</tt>, <tt>DELETE</tt> HTTP methods need to be translated to
- * <tt>POST</tt> with additional <tt>X-HTTTP-Method</tt> header.
- *
- * @param value 'TRUE' to use tunneling.
- */
- void setUseXHTTPMethod(boolean value);
-
- /**
- * Checks whether Gzip compression (e.g. support for <tt>Accept-Encoding: gzip</tt> and
- * <tt>Content-Encoding: gzip</tt> HTTP headers) is enabled.
- *
- * @return whether HTTP Gzip compression is enabled
- */
- boolean isGzipCompression();
-
- /**
- * Sets Gzip compression (e.g. support for <tt>Accept-Encoding: gzip</tt> and
- * <tt>Content-Encoding: gzip</tt> HTTP headers) enabled or disabled.
- *
- * @param value whether to use Gzip compression.
- */
- void setGzipCompression(boolean value);
-
- /**
- * Checks whether chunk HTTP encoding is being used.
- *
- * @return whether chunk HTTP encoding is being used
- */
- boolean isUseChuncked();
-
- /**
- * Sets chunk HTTP encoding enabled or disabled.
- *
- * @param value whether to use chunk HTTP encoding.
- */
- void setUseChuncked(boolean value);
-
- /**
- * Retrieves request executor service.
- *
- * @return request executor service.
- */
- ExecutorService getExecutor();
-
- /**
- * Sets request executor service.
- *
- * @param executorService new executor services.
- */
- void setExecutor(ExecutorService executorService);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/Constants.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/Constants.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/Constants.java
deleted file mode 100644
index 9345057..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/Constants.java
+++ /dev/null
@@ -1,217 +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.api;
-
-import javax.xml.XMLConstants;
-
-/**
- * Constant values related to the OData protocol.
- */
-public class Constants {
-
- // Other stuff
- public final static String UTF8 = "UTF-8";
-
- public final static String NAME = "name";
-
- public final static String PROPERTIES = "properties";
-
- // XML namespaces and prefixes
- public final static String NS_ATOM = "http://www.w3.org/2005/Atom";
-
- public static final String NS_GEORSS = "http://www.georss.org/georss";
-
- public static final String NS_GML = "http://www.opengis.net/gml";
-
- public static final String XMLNS_DATASERVICES = XMLConstants.XMLNS_ATTRIBUTE + ":d";
-
- public static final String PREFIX_DATASERVICES = "d:";
-
- public static final String XMLNS_METADATA = XMLConstants.XMLNS_ATTRIBUTE + ":m";
-
- public static final String PREFIX_METADATA = "m:";
-
- public static final String XMLNS_GEORSS = XMLConstants.XMLNS_ATTRIBUTE + ":georss";
-
- public static final String PREFIX_GEORSS = "georss:";
-
- public static final String XMLNS_GML = XMLConstants.XMLNS_ATTRIBUTE + ":gml";
-
- public static final String PREFIX_GML = "gml:";
-
- /**
- * Edit link rel value.
- */
- public static final String EDIT_LINK_REL = "edit";
-
- /**
- * Self link rel value.
- */
- public static final String SELF_LINK_REL = "self";
-
- public static final String NEXT_LINK_REL = "next";
-
- // XML elements and attributes
- public static final String ELEM_PROPERTIES = PREFIX_METADATA + PROPERTIES;
-
- public static final String ELEM_ELEMENT = "element";
-
- public final static String ATTR_TYPE = "type";
-
- public static final String ATTR_M_TYPE = PREFIX_METADATA + ATTR_TYPE;
-
- public static final String ATTR_NULL = PREFIX_METADATA + "null";
-
- public static final String ATTR_XMLBASE = "xml:base";
-
- public static final String ATTR_REL = "rel";
-
- public static final String ATTR_HREF = "href";
-
- public static final String ATTR_METADATA = "metadata";
-
- public static final String ATTR_TITLE = "title";
-
- public static final String ATTR_TARGET = "target";
-
- public static final String ELEM_COLLECTION = "collection";
-
- public static final String ATTR_SRSNAME = PREFIX_GML + "srsName";
-
- public static final String ELEM_POINT = PREFIX_GML + "Point";
-
- public static final String ELEM_MULTIPOINT = PREFIX_GML + "MultiPoint";
-
- public static final String ELEM_POINTMEMBERS = PREFIX_GML + "pointMembers";
-
- public static final String ELEM_LINESTRING = PREFIX_GML + "LineString";
-
- public static final String ELEM_MULTILINESTRING = PREFIX_GML + "MultiCurve";
-
- public static final String ELEM_LINESTRINGMEMBERS = PREFIX_GML + "curveMembers";
-
- public static final String ELEM_POLYGON = PREFIX_GML + "Polygon";
-
- public static final String ELEM_POLYGON_EXTERIOR = PREFIX_GML + "exterior";
-
- public static final String ELEM_POLYGON_INTERIOR = PREFIX_GML + "interior";
-
- public static final String ELEM_POLYGON_LINEARRING = PREFIX_GML + "LinearRing";
-
- public static final String ELEM_MULTIPOLYGON = PREFIX_GML + "MultiSurface";
-
- public static final String ELEM_SURFACEMEMBERS = PREFIX_GML + "surfaceMembers";
-
- public static final String ELEM_GEOCOLLECTION = PREFIX_GML + "MultiGeometry";
-
- public static final String ELEM_GEOMEMBERS = PREFIX_GML + "geometryMembers";
-
- public static final String ELEM_POS = PREFIX_GML + "pos";
-
- public static final String ELEM_POSLIST = PREFIX_GML + "posList";
-
- public static final String ELEM_PROPERTY = "property";
-
- public static final String ELEM_URI = "uri";
-
- // JSON stuff
- public final static String JSON_METADATA = "odata.metadata";
-
- public final static String JSON_TYPE = "odata.type";
-
- public final static String JSON_ETAG = "odata.etag";
-
- public final static String JSON_MEDIA_ETAG = "odata.mediaETag";
-
- public final static String JSON_ID = "odata.id";
-
- public final static String JSON_READ_LINK = "odata.readLink";
-
- public final static String JSON_EDIT_LINK = "odata.editLink";
-
- public final static String JSON_MEDIAREAD_LINK = "odata.mediaReadLink";
-
- public final static String JSON_MEDIAEDIT_LINK = "odata.mediaEditLink";
-
- public final static String JSON_MEDIA_CONTENT_TYPE = "odata.mediaContentType";
-
- public final static String JSON_NAVIGATION_LINK_SUFFIX = "@odata.navigationLinkUrl";
-
- public final static String JSON_BIND_LINK_SUFFIX = "@odata.bind";
-
- public final static String JSON_ASSOCIATION_LINK_SUFFIX = "@odata.associationLinkUrl";
-
- public final static String JSON_MEDIAEDIT_LINK_SUFFIX = "@odata.mediaEditLink";
-
- public final static String JSON_VALUE = "value";
-
- public final static String JSON_URL = "url";
-
- public final static String JSON_COORDINATES = "coordinates";
-
- public final static String JSON_GEOMETRIES = "geometries";
-
- public final static String JSON_CRS = "crs";
-
- public final static String JSON_GIS_URLPREFIX = "http://www.opengis.net/def/crs/EPSG/0/";
-
- // Atom stuff
- public final static String ATOM_ELEM_ENTRY = "entry";
-
- public final static String ATOM_ELEM_FEED = "feed";
-
- public final static String ATOM_ELEM_CATEGORY = "category";
-
- public final static String ATOM_ELEM_ID = "id";
-
- public final static String ATOM_ELEM_LINK = "link";
-
- public final static String ATOM_ELEM_CONTENT = "content";
-
- public static final String ATOM_ELEM_TITLE = "title";
-
- public static final String ATOM_ELEM_SUMMARY = "summary";
-
- public static final String ATOM_ELEM_UPDATED = "updated";
-
- public static final String ATOM_ELEM_AUTHOR = "author";
-
- public static final String ATOM_ELEM_AUTHOR_NAME = "name";
-
- public static final String ATOM_ELEM_AUTHOR_URI = "uri";
-
- public static final String ATOM_ELEM_AUTHOR_EMAIL = "email";
-
- public static final String ATOM_ELEM_ACTION = PREFIX_METADATA + "action";
-
- public static final String ATOM_ELEM_INLINE = PREFIX_METADATA + "inline";
-
- public static final String ATOM_ATTR_TITLE = "atom:title";
-
- public static final String ATOM_ATTR_TERM = "term";
-
- public static final String ATOM_ATTR_SCHEME = "scheme";
-
- public static final String ATOM_ATTR_SRC = "src";
-
- public static final String ATOM_ATTR_ETAG = PREFIX_METADATA + "etag";
-
- public static final String ATOM_ATTR_COUNT = PREFIX_METADATA + "count";
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataClient.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataClient.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataClient.java
deleted file mode 100644
index b13c866..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataClient.java
+++ /dev/null
@@ -1,55 +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.api;
-
-import org.apache.olingo.odata4.client.api.op.ODataBinder;
-import org.apache.olingo.odata4.client.api.op.ODataDeserializer;
-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.uri.URIBuilder;
-import org.apache.olingo.odata4.client.api.uri.filter.FilterFactory;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public interface ODataClient {
-
- ODataServiceVersion getServiceVersion();
-
- //ODataHeaders getVersionHeaders();
- Configuration getConfiguration();
-
- URIBuilder<?> getURIBuilder(String serviceRoot);
-
- FilterFactory getFilterFactory();
-
- ODataSerializer getSerializer();
-
- ODataDeserializer getDeserializer();
-
- ODataReader getReader();
-
-// ODataWriter getWriter();
- ODataBinder getBinder();
-
-// ODataObjectFactory getObjectFactory();
-// RetrieveRequestFactory getRetrieveRequestFactory();
-// CUDRequestFactory getCUDRequestFactory();
-// StreamedRequestFactory getStreamedRequestFactory();
-// InvokeRequestFactory<?, ?, ?, ?, ?, ?, ?, ?> getInvokeRequestFactory();
-// BatchRequestFactory getBatchRequestFactory();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataConstants.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataConstants.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataConstants.java
deleted file mode 100644
index 9c4b3ed..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataConstants.java
+++ /dev/null
@@ -1,219 +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.api;
-
-import javax.xml.XMLConstants;
-
-/**
- * Constant values related to the OData protocol.
- */
-public class ODataConstants {
-
- // Other stuff
- public final static String UTF8 = "UTF-8";
-
- public final static String NAME = "name";
-
- public final static String PROPERTIES = "properties";
-
- // XML namespaces and prefixes
- public final static String NS_ATOM = "http://www.w3.org/2005/Atom";
-
- public static final String NS_GEORSS = "http://www.georss.org/georss";
-
- public static final String NS_GML = "http://www.opengis.net/gml";
-
- public static final String XMLNS_DATASERVICES = XMLConstants.XMLNS_ATTRIBUTE + ":d";
-
- public static final String PREFIX_DATASERVICES = "d:";
-
- public static final String XMLNS_METADATA = XMLConstants.XMLNS_ATTRIBUTE + ":m";
-
- public static final String PREFIX_METADATA = "m:";
-
- public static final String XMLNS_GEORSS = XMLConstants.XMLNS_ATTRIBUTE + ":georss";
-
- public static final String PREFIX_GEORSS = "georss:";
-
- public static final String XMLNS_GML = XMLConstants.XMLNS_ATTRIBUTE + ":gml";
-
- public static final String PREFIX_GML = "gml:";
-
- /**
- * Edit link rel value.
- */
- public static final String EDIT_LINK_REL = "edit";
-
- /**
- * Self link rel value.
- */
- public static final String SELF_LINK_REL = "self";
-
- public static final String NEXT_LINK_REL = "next";
-
- // XML elements and attributes
- public static final String ELEM_PROPERTIES = PREFIX_METADATA + PROPERTIES;
-
- public static final String ELEM_ELEMENT = "element";
-
- public final static String ATTR_TYPE = "type";
-
- public static final String ATTR_M_TYPE = PREFIX_METADATA + ATTR_TYPE;
-
- public static final String ATTR_NULL = PREFIX_METADATA + "null";
-
- public static final String ATTR_XMLBASE = "xml:base";
-
- public static final String ATTR_REL = "rel";
-
- public static final String ATTR_HREF = "href";
-
- public static final String ATTR_METADATA = "metadata";
-
- public static final String ATTR_TITLE = "title";
-
- public static final String ATTR_TARGET = "target";
-
- public static final String ELEM_COLLECTION = "collection";
-
- public static final String ATTR_SRSNAME = PREFIX_GML + "srsName";
-
- public static final String ELEM_POINT = PREFIX_GML + "Point";
-
- public static final String ELEM_MULTIPOINT = PREFIX_GML + "MultiPoint";
-
- public static final String ELEM_POINTMEMBERS = PREFIX_GML + "pointMembers";
-
- public static final String ELEM_LINESTRING = PREFIX_GML + "LineString";
-
- public static final String ELEM_MULTILINESTRING = PREFIX_GML + "MultiCurve";
-
- public static final String ELEM_LINESTRINGMEMBERS = PREFIX_GML + "curveMembers";
-
- public static final String ELEM_POLYGON = PREFIX_GML + "Polygon";
-
- public static final String ELEM_POLYGON_EXTERIOR = PREFIX_GML + "exterior";
-
- public static final String ELEM_POLYGON_INTERIOR = PREFIX_GML + "interior";
-
- public static final String ELEM_POLYGON_LINEARRING = PREFIX_GML + "LinearRing";
-
- public static final String ELEM_MULTIPOLYGON = PREFIX_GML + "MultiSurface";
-
- public static final String ELEM_SURFACEMEMBERS = PREFIX_GML + "surfaceMembers";
-
- public static final String ELEM_GEOCOLLECTION = PREFIX_GML + "MultiGeometry";
-
- public static final String ELEM_GEOMEMBERS = PREFIX_GML + "geometryMembers";
-
- public static final String ELEM_POS = PREFIX_GML + "pos";
-
- public static final String ELEM_POSLIST = PREFIX_GML + "posList";
-
- public static final String ELEM_PROPERTY = "property";
-
- public static final String ELEM_URI = "uri";
-
- // JSON stuff
- public final static String JSON_CONTEXT = "@odata.context";
-
- public final static String JSON_METADATA = "odata.metadata";
-
- public final static String JSON_TYPE = "odata.type";
-
- public final static String JSON_ETAG = "odata.etag";
-
- public final static String JSON_MEDIA_ETAG = "odata.mediaETag";
-
- public final static String JSON_ID = "odata.id";
-
- public final static String JSON_READ_LINK = "odata.readLink";
-
- public final static String JSON_EDIT_LINK = "odata.editLink";
-
- public final static String JSON_MEDIAREAD_LINK = "odata.mediaReadLink";
-
- public final static String JSON_MEDIAEDIT_LINK = "odata.mediaEditLink";
-
- public final static String JSON_MEDIA_CONTENT_TYPE = "odata.mediaContentType";
-
- public final static String JSON_NAVIGATION_LINK_SUFFIX = "@odata.navigationLinkUrl";
-
- public final static String JSON_BIND_LINK_SUFFIX = "@odata.bind";
-
- public final static String JSON_ASSOCIATION_LINK_SUFFIX = "@odata.associationLinkUrl";
-
- public final static String JSON_MEDIAEDIT_LINK_SUFFIX = "@odata.mediaEditLink";
-
- public final static String JSON_VALUE = "value";
-
- public final static String JSON_URL = "url";
-
- public final static String JSON_COORDINATES = "coordinates";
-
- public final static String JSON_GEOMETRIES = "geometries";
-
- public final static String JSON_CRS = "crs";
-
- public final static String JSON_GIS_URLPREFIX = "http://www.opengis.net/def/crs/EPSG/0/";
-
- // Atom stuff
- public final static String ATOM_ELEM_ENTRY = "entry";
-
- public final static String ATOM_ELEM_FEED = "feed";
-
- public final static String ATOM_ELEM_CATEGORY = "category";
-
- public final static String ATOM_ELEM_ID = "id";
-
- public final static String ATOM_ELEM_LINK = "link";
-
- public final static String ATOM_ELEM_CONTENT = "content";
-
- public static final String ATOM_ELEM_TITLE = "title";
-
- public static final String ATOM_ELEM_SUMMARY = "summary";
-
- public static final String ATOM_ELEM_UPDATED = "updated";
-
- public static final String ATOM_ELEM_AUTHOR = "author";
-
- public static final String ATOM_ELEM_AUTHOR_NAME = "name";
-
- public static final String ATOM_ELEM_AUTHOR_URI = "uri";
-
- public static final String ATOM_ELEM_AUTHOR_EMAIL = "email";
-
- public static final String ATOM_ELEM_ACTION = PREFIX_METADATA + "action";
-
- public static final String ATOM_ELEM_INLINE = PREFIX_METADATA + "inline";
-
- public static final String ATOM_ATTR_TITLE = "atom:title";
-
- public static final String ATOM_ATTR_TERM = "term";
-
- public static final String ATOM_ATTR_SCHEME = "scheme";
-
- public static final String ATOM_ATTR_SRC = "src";
-
- public static final String ATOM_ATTR_ETAG = PREFIX_METADATA + "etag";
-
- public static final String ATOM_ATTR_COUNT = PREFIX_METADATA + "count";
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataError.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataError.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataError.java
deleted file mode 100644
index 4e45cfd..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataError.java
+++ /dev/null
@@ -1,67 +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.api;
-
-/**
- * OData error.
- */
-public interface ODataError {
-
- /**
- * Gets error code.
- *
- * @return error code.
- */
- String getCode();
-
- /**
- * Gets error message language.
- *
- * @return error message language.
- */
- String getMessageLang();
-
- /**
- * Gets error message.
- *
- * @return error message.
- */
- String getMessageValue();
-
- /**
- * Gets inner error message.
- *
- * @return inner error message.
- */
- String getInnerErrorMessage();
-
- /**
- * Gets inner error type.
- *
- * @return inner error type.
- */
- String getInnerErrorType();
-
- /**
- * Gets inner error stack-trace.
- *
- * @return inner error stack-trace
- */
- String getInnerErrorStacktrace();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataV3Client.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataV3Client.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataV3Client.java
deleted file mode 100644
index ed2d413..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataV3Client.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api;
-
-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;
-
-public interface ODataV3Client extends ODataClient {
-
- @Override
- V3Configuration getConfiguration();
-
- @Override
- V3URIBuilder getURIBuilder(String serviceRoot);
-
- @Override
- V3FilterFactory getFilterFactory();
-
- @Override
- ODataV3Deserializer getDeserializer();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataV4Client.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataV4Client.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataV4Client.java
deleted file mode 100644
index 1f493b3..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/ODataV4Client.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api;
-
-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;
-
-public interface ODataV4Client extends ODataClient {
-
- @Override
- V4Configuration getConfiguration();
-
- @Override
- V4URIBuilder getURIBuilder(String serviceRoot);
-
- @Override
- V4FilterFactory getFilterFactory();
-
- @Override
- ODataV4Deserializer getDeserializer();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/UnsupportedInV3Exception.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/UnsupportedInV3Exception.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/UnsupportedInV3Exception.java
deleted file mode 100644
index 71dd6c2..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/UnsupportedInV3Exception.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.api;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-
-public class UnsupportedInV3Exception extends EdmException {
-
- private static final long serialVersionUID = 4773734640262424651L;
-
- public UnsupportedInV3Exception() {
- super("Not supported in OData 3.0");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/V3Configuration.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/V3Configuration.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/V3Configuration.java
deleted file mode 100644
index c391705..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/V3Configuration.java
+++ /dev/null
@@ -1,44 +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.api;
-
-public interface V3Configuration extends Configuration {
-
- /**
- * Checks whether URIs contain entity key between parentheses (standard) or instead as additional segment.
- * <br/>
- * 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.
- */
- boolean isKeyAsSegment();
-
- /**
- * Sets whether URIs shall be built with entity key between parentheses (standard) or instead as additional segment.
- * <br/>
- * 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.
- */
- void setKeyAsSegment(boolean value);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/V4Configuration.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/V4Configuration.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/V4Configuration.java
deleted file mode 100644
index 668b0aa..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/V4Configuration.java
+++ /dev/null
@@ -1,24 +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.api;
-
-public interface V4Configuration extends Configuration {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/data/ServiceDocument.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/data/ServiceDocument.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/data/ServiceDocument.java
deleted file mode 100644
index acd6103..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/data/ServiceDocument.java
+++ /dev/null
@@ -1,138 +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.api.data;
-
-import java.net.URI;
-import java.util.List;
-
-/**
- * REST resource for an <tt>ODataServiceDocument</tt>.
- *
- * @see org.apache.olingo.odata4.client.api.domain.ODataServiceDocument
- */
-public interface ServiceDocument {
-
- String getTitle();
-
- /**
- * Gets base URI.
- *
- * @return base URI.
- */
- URI getBaseURI();
-
- /**
- * Returns metadata context.
- *
- * @return metadata context
- */
- String getMetadataContext();
-
- /**
- * Returns metadata ETag.
- *
- * @return metadata ETag
- */
- String getMetadataETag();
-
- /**
- * Gets top level entity sets.
- *
- * @return top level entity sets.
- */
- List<ServiceDocumentItem> getEntitySets();
-
- /**
- * Gets top level entity set with given name.
- *
- * @param name entity set name
- * @return entity set with given name if found, otherwise null
- */
- ServiceDocumentItem getEntitySetByName(String name);
-
- /**
- * Gets top level entity set with given title.
- *
- * @param title entity set title
- * @return entity set with given title if found, otherwise null
- */
- ServiceDocumentItem getEntitySetByTitle(String title);
-
- /**
- * Gets top level function imports.
- *
- * @return top level function imports.
- */
- List<ServiceDocumentItem> getFunctionImports();
-
- /**
- * Gets top level function import set with given name.
- *
- * @param name function import name
- * @return function import with given name if found, otherwise null
- */
- ServiceDocumentItem getFunctionImportByName(String name);
-
- /**
- * Gets top level function import with given title.
- *
- * @param title function import title
- * @return function import with given title if found, otherwise null
- */
- ServiceDocumentItem getFunctionImportByTitle(String title);
-
- /**
- * Gets top level singletons.
- *
- * @return top level singletons.
- */
- List<ServiceDocumentItem> getSingletons();
-
- /**
- * Gets top level singleton with given name.
- *
- * @param name singleton name
- * @return singleton with given name if found, otherwise null
- */
- ServiceDocumentItem getSingletonByName(String name);
-
- /**
- * Gets top level singleton with given title.
- *
- * @param title singleton title
- * @return singleton with given title if found, otherwise null
- */
- ServiceDocumentItem getSingletonByTitle(String title);
-
- /**
- * Gets related service documents.
- *
- * @return related service documents.
- */
- List<ServiceDocumentItem> getRelatedServiceDocuments();
-
- /**
- * Gets related service document with given title.
- *
- * @param title related service document title
- * @return related service document with given title if found, otherwise null
- */
- ServiceDocumentItem getRelatedServiceDocumentByTitle(String title);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/data/ServiceDocumentItem.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/data/ServiceDocumentItem.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/data/ServiceDocumentItem.java
deleted file mode 100644
index 4f4bd77..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/data/ServiceDocumentItem.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 org.apache.olingo.odata4.client.api.data;
-
-public interface ServiceDocumentItem {
-
- String getHref();
-
- String getName();
-
- String getTitle();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/AnnotationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/AnnotationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/AnnotationProperty.java
deleted file mode 100644
index 47f641d..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/AnnotationProperty.java
+++ /dev/null
@@ -1,24 +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.api.deserializer;
-
-public interface AnnotationProperty extends Property {
-
- String getValue();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/ClientException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/ClientException.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/ClientException.java
deleted file mode 100644
index 04e0714..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/ClientException.java
+++ /dev/null
@@ -1,36 +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.api.deserializer;
-
-public class ClientException extends Exception {
-
- private static final long serialVersionUID = 5148670827051750921L;
-
- public ClientException() {
- super();
- }
-
- public ClientException(final String message) {
- super(message);
- }
-
- public ClientException(final String message, final Throwable cause) {
- super(message, cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/ComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/ComplexValue.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/ComplexValue.java
deleted file mode 100644
index a9aa9a7..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/ComplexValue.java
+++ /dev/null
@@ -1,35 +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.api.deserializer;
-
-import java.util.List;
-import java.util.Map;
-
-public interface ComplexValue extends Value {
-
- Value getValue(String name);
-
- List<Property> getProperties();
-
- Map<String, NavigationProperty> getNavigationProperties();
-
- Map<String, AnnotationProperty> getAnnotationProperties();
-
- Map<String, StructuralProperty> getStructuralProperties();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Entity.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Entity.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Entity.java
deleted file mode 100644
index 7c15b9c..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Entity.java
+++ /dev/null
@@ -1,59 +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.api.deserializer;
-
-import java.util.List;
-import java.util.Map;
-
-public interface Entity {
-
- String getODataContext();
-
- String getODataMetaDataEtag();
-
- String getODataType();
-
- Long getODataCount();
-
- String getODataNextLink();
-
- String getODataDeltaLink();
-
- String getODataId();
-
- String getODataETag();
-
- String getODataEditLink();
-
- String getODataReadLink();
-
- List<Property> getProperties();
-
- Map<String, NavigationProperty> getNavigationProperties();
-
- Map<String, AnnotationProperty> getAnnotationProperties();
-
- Map<String, StructuralProperty> getStructuralProperties();
-
- Property getProperty(String name);
-
- <T extends Property> T getProperty(String name, Class<T> clazz);
-
- Object getPropertyContent(String name);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/EntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/EntitySet.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/EntitySet.java
deleted file mode 100644
index e873824..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/EntitySet.java
+++ /dev/null
@@ -1,34 +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.api.deserializer;
-
-import java.util.List;
-
-public interface EntitySet extends Iterable<Entity> {
-
- String getODataContext();
-
- Long getODataCount();
-
- String getODataNextLink();
-
- String getODataDeltaLink();
-
- List<Entity> getEntities();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/NavigationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/NavigationProperty.java
deleted file mode 100644
index 418da20..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/NavigationProperty.java
+++ /dev/null
@@ -1,27 +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.api.deserializer;
-
-public interface NavigationProperty extends Property {
-
- public abstract String getAssociationLink();
-
- public abstract String getNavigationLink();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Property.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Property.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Property.java
deleted file mode 100644
index 45c063f..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Property.java
+++ /dev/null
@@ -1,24 +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.api.deserializer;
-
-public interface Property {
-
- String getName();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Reader.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Reader.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Reader.java
deleted file mode 100644
index af526bc..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Reader.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 org.apache.olingo.odata4.client.api.deserializer;
-
-import java.io.InputStream;
-
-public interface Reader {
-
- EntitySet readEntitySet(InputStream in) throws ClientException;
-
- Entity readEntity(InputStream in) throws ClientException;
-
- Property readProperty(InputStream in) throws ClientException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/StructuralProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/StructuralProperty.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/StructuralProperty.java
deleted file mode 100644
index 3523dd8..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/StructuralProperty.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 org.apache.olingo.odata4.client.api.deserializer;
-
-import java.util.List;
-
-public interface StructuralProperty extends Property {
-
- boolean containsCollection();
-
- Value getValue();
-
- List<Value> getValues();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Value.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Value.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Value.java
deleted file mode 100644
index 70e23e9..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/deserializer/Value.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.api.deserializer;
-
-public interface Value {
-
- boolean isComplex();
-
- Object getContent();
-
- <T> T getContentAs(T type);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/EdmSimpleType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/EdmSimpleType.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/EdmSimpleType.java
deleted file mode 100644
index f99df2b..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/EdmSimpleType.java
+++ /dev/null
@@ -1,288 +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.api.domain;
-
-import java.math.BigDecimal;
-import java.net.URI;
-import java.util.UUID;
-import org.apache.olingo.odata4.client.api.domain.geospatial.Geospatial;
-import org.apache.olingo.odata4.client.api.domain.geospatial.GeospatialCollection;
-import org.apache.olingo.odata4.client.api.domain.geospatial.LineString;
-import org.apache.olingo.odata4.client.api.domain.geospatial.MultiLineString;
-import org.apache.olingo.odata4.client.api.domain.geospatial.MultiPoint;
-import org.apache.olingo.odata4.client.api.domain.geospatial.MultiPolygon;
-import org.apache.olingo.odata4.client.api.domain.geospatial.Point;
-import org.apache.olingo.odata4.client.api.domain.geospatial.Polygon;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-/**
- * Represent the primitive types of the Entity Data Model (EDM).
- *
- * @see http://dl.windowsazure.com/javadoc/com/microsoft/windowsazure/services/table/models/EdmType.html
- * <p>
- * For an overview of the available EDM primitive data types and names, see the <a
- * href="http://www.odata.org/developers/protocols/overview#AbstractTypeSystem">Primitive Data Types</a> section of the
- * <a href="http://www.odata.org/developers/protocols/overview">OData Protocol Overview</a>.
- * </p>
- * <p>
- * The Abstract Type System used to define the primitive types supported by OData is defined in detail in <a
- * href="http://msdn.microsoft.com/en-us/library/dd541474.aspx">[MC-CSDL] (section 2.2.1).</a>
- * </p>
- */
-public enum EdmSimpleType {
-
- /**
- * The absence of a value.
- */
- Null(Void.class),
- /**
- * An array of bytes.
- */
- Binary(byte[].class),
- /**
- * A Boolean value.
- */
- Boolean(Boolean.class),
- /**
- * Unsigned 8-bit integer value.
- */
- Byte(Integer.class),
- /**
- * A signed 8-bit integer value.
- */
- SByte(Byte.class),
- /**
- * A 64-bit value expressed as Coordinated Universal Time (UTC).
- */
- DateTime(new ODataServiceVersion[]{ODataServiceVersion.V30}, ODataTimestamp.class, "yyyy-MM-dd'T'HH:mm:ss"),
- /**
- * Date without a time-zone offset.
- */
- Date(new ODataServiceVersion[]{ODataServiceVersion.V40}, ODataTimestamp.class, "yyyy-MM-dd"),
- /**
- * Date and time as an Offset in minutes from GMT.
- */
- DateTimeOffset(ODataTimestamp.class, "yyyy-MM-dd'T'HH:mm:ss"),
- /**
- * The time of day with values ranging from 0:00:00.x to 23:59:59.y, where x and y depend upon the precision.
- */
- Time(new ODataServiceVersion[]{ODataServiceVersion.V30}, ODataDuration.class),
- /**
- * The time of day with values ranging from 0:00:00.x to 23:59:59.y, where x and y depend upon the precision.
- */
- TimeOfDay(new ODataServiceVersion[]{ODataServiceVersion.V40}, ODataDuration.class),
- /**
- * Signed duration in days, hours, minutes, and (sub)seconds.
- */
- Duration(new ODataServiceVersion[]{ODataServiceVersion.V40}, ODataDuration.class),
- /**
- * Numeric values with fixed precision and scale.
- */
- Decimal(BigDecimal.class, "#.#######################"),
- /**
- * A floating point number with 7 digits precision.
- */
- Single(Float.class, "#.#######E0"),
- /**
- * A 64-bit double-precision floating point value.
- */
- Double(Double.class, "#.#######################E0"),
- // --- Geospatial ---
- Geography(Geospatial.class),
- GeographyPoint(Point.class),
- GeographyLineString(LineString.class),
- GeographyPolygon(Polygon.class),
- GeographyMultiPoint(MultiPoint.class),
- GeographyMultiLineString(MultiLineString.class),
- GeographyMultiPolygon(MultiPolygon.class),
- GeographyCollection(GeospatialCollection.class),
- Geometry(Geospatial.class),
- GeometryPoint(Point.class),
- GeometryLineString(LineString.class),
- GeometryPolygon(Polygon.class),
- GeometryMultiPoint(MultiPoint.class),
- GeometryMultiLineString(MultiLineString.class),
- GeometryMultiPolygon(MultiPolygon.class),
- GeometryCollection(GeospatialCollection.class),
- /**
- * A 128-bit globally unique identifier.
- */
- Guid(UUID.class),
- /**
- * A 16-bit integer value.
- */
- Int16(Short.class),
- /**
- * A 32-bit integer value.
- */
- Int32(Integer.class),
- /**
- * A 64-bit integer value.
- */
- Int64(Long.class),
- /**
- * A UTF-16-encoded value. String values may be up to 64 KB in size.
- */
- String(String.class),
- /**
- * Resource stream (for media entities).
- */
- Stream(URI.class);
-
- private final Class<?> clazz;
-
- private final String pattern;
-
- private final ODataServiceVersion[] versions;
-
- /**
- * Constructor (all OData versions).
- *
- * @param clazz type.
- */
- EdmSimpleType(final Class<?> clazz) {
- this(ODataServiceVersion.values(), clazz, null);
- }
-
- /**
- * Constructor.
- *
- * @param versions supported OData versions.
- * @param clazz type.
- */
- EdmSimpleType(final ODataServiceVersion[] versions, final Class<?> clazz) {
- this(versions, clazz, null);
- }
-
- /**
- * Constructor (all OData versions).
- *
- * @param clazz type.
- * @param pattern pattern.
- */
- EdmSimpleType(final Class<?> clazz, final String pattern) {
- this(ODataServiceVersion.values(), clazz, pattern);
- }
-
- /**
- * Constructor.
- *
- * @param versions supported OData versions.
- * @param clazz type.
- * @param pattern pattern.
- */
- EdmSimpleType(final ODataServiceVersion[] versions, final Class<?> clazz, final String pattern) {
- this.clazz = clazz;
- this.pattern = pattern;
- this.versions = versions.clone();
- }
-
- /**
- * Gets pattern.
- *
- * @return pattern.
- */
- public String pattern() {
- return pattern;
- }
-
- /**
- * Gets corresponding java type.
- *
- * @return java type.
- */
- public Class<?> javaType() {
- return this.clazz;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public String toString() {
- return namespace() + "." + name();
- }
-
- /**
- * Checks if is a geospatial type.
- *
- * @return <tt>true</tt> if is geospatial type; <tt>false</tt> otherwise.
- */
- public boolean isGeospatial() {
- return name().startsWith("Geo");
- }
-
- /**
- * Checks if the given type is a geospatial type.
- *
- * @param type type.
- * @return <tt>true</tt> if is geospatial type; <tt>false</tt> otherwise.
- */
- public static boolean isGeospatial(final String type) {
- return type != null && type.startsWith(namespace() + ".Geo");
- }
-
- /**
- * Gets <tt>EdmSimpleType</tt> from string.
- *
- * @param value string value type.
- * @return <tt>EdmSimpleType</tt> object.
- */
- public static EdmSimpleType fromValue(final String value) {
- final String noNsValue = value.substring(4);
- for (EdmSimpleType edmSimpleType : EdmSimpleType.values()) {
- if (edmSimpleType.name().equals(noNsValue)) {
- return edmSimpleType;
- }
- }
- throw new IllegalArgumentException(value);
- }
-
- /**
- * Gets <tt>EdmSimpleType</tt> from object instance.
- *
- * @param workingVersion OData version.
- * @param obj object.
- * @return <tt>EdmSimpleType</tt> object.
- */
- public static EdmSimpleType fromObject(final ODataServiceVersion workingVersion, final Object obj) {
- for (EdmSimpleType edmSimpleType : EdmSimpleType.values()) {
- if (edmSimpleType.javaType().equals(obj.getClass())) {
- return edmSimpleType == DateTimeOffset || edmSimpleType == DateTime || edmSimpleType == Date
- ? ((ODataTimestamp) obj).isOffset()
- ? DateTimeOffset : workingVersion == ODataServiceVersion.V30 ? DateTime : Date
- : edmSimpleType;
- }
- }
- throw new IllegalArgumentException(obj.getClass().getSimpleName() + " is not a simple type");
- }
-
- /**
- * Gets namespace.
- *
- * @return namespace.
- */
- public static String namespace() {
- return "Edm";
- }
-
- public ODataServiceVersion[] getSupportedVersions() {
- return versions.clone();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataCollectionValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataCollectionValue.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataCollectionValue.java
deleted file mode 100644
index 253083b..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataCollectionValue.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 org.apache.olingo.odata4.client.api.domain;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * OData collection property value.
- */
-public class ODataCollectionValue extends ODataValue implements Iterable<ODataValue> {
-
- private static final long serialVersionUID = -3665659846001987187L;
-
- /**
- * Type name;
- */
- private final String typeName;
-
- /**
- * Values.
- */
- private final List<ODataValue> values = new ArrayList<ODataValue>();
-
- /**
- * Constructor.
- *
- * @param typeName type name.
- */
- public ODataCollectionValue(final String typeName) {
- this.typeName = typeName;
- }
-
- /**
- * Adds a value to the collection.
- *
- * @param value value to be added.
- */
- public void add(final ODataValue value) {
- if (value.isPrimitive() || value.isComplex()) {
- values.add(value);
- }
- }
-
- /**
- * Value iterator.
- *
- * @return value iterator.
- */
- @Override
- public Iterator<ODataValue> iterator() {
- return values.iterator();
- }
-
- /**
- * Gets value type name.
- *
- * @return value type name.
- */
- public String getTypeName() {
- return typeName;
- }
-
- /**
- * Gets collection size.
- *
- * @return collection size.
- */
- public int size() {
- return values.size();
- }
-
- /**
- * Checks if collection is empty.
- *
- * @return 'TRUE' if empty; 'FALSE' otherwise.
- */
- public boolean isEmpty() {
- return values.isEmpty();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataComplexValue.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataComplexValue.java
deleted file mode 100644
index 6bca821..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataComplexValue.java
+++ /dev/null
@@ -1,97 +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.api.domain;
-
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * OData complex property value.
- */
-public class ODataComplexValue extends ODataValue implements Iterable<ODataProperty> {
-
- private static final long serialVersionUID = -1878555027714020431L;
-
- /**
- * Type name.
- */
- private final String typeName;
-
- /**
- * Complex type fields.
- */
- private final Map<String, ODataProperty> fields = new LinkedHashMap<String, ODataProperty>();
-
- /**
- * Constructor.
- *
- * @param typeName type name.
- */
- public ODataComplexValue(final String typeName) {
- this.typeName = typeName;
- }
-
- /**
- * Adds field to the complex type.
- *
- * @param field field to be added.
- */
- public void add(final ODataProperty field) {
- fields.put(field.getName(), field);
- }
-
- /**
- * Gets field.
- *
- * @param name name of the field to be retrieved.
- * @return requested field.
- */
- public ODataProperty get(final String name) {
- return fields.get(name);
- }
-
- /**
- * Complex property fields iterator.
- *
- * @return fields iterator.
- */
- @Override
- public Iterator<ODataProperty> iterator() {
- return fields.values().iterator();
- }
-
- /**
- * Gest value type name.
- *
- * @return value type name.
- */
- public String getTypeName() {
- return typeName;
- }
-
- /**
- * Gets number of fields.
- *
- * @return number of fields.
- */
- public int size() {
- return fields.size();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataDuration.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataDuration.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataDuration.java
deleted file mode 100644
index 5a8a108..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataDuration.java
+++ /dev/null
@@ -1,79 +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.api.domain;
-
-import java.io.Serializable;
-import javax.xml.datatype.DatatypeConfigurationException;
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.Duration;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-
-/**
- * Helper class for handling time (as duration) primitive values.
- *
- * @see Duration
- */
-public final class ODataDuration implements Serializable {
-
- private static final long serialVersionUID = 778404231943967899L;
-
- private final Duration duration;
-
- public ODataDuration(final String input) {
- try {
- final DatatypeFactory dtFactory = DatatypeFactory.newInstance();
- this.duration = dtFactory.newDuration(input);
- } catch (DatatypeConfigurationException e) {
- throw new IllegalArgumentException("Could not parse '" + input + "' as Duration", e);
- }
- }
-
- public ODataDuration(final Duration duration) {
- this.duration = duration;
- }
-
- public Duration getDuration() {
- return duration;
- }
-
- /**
- * {@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 this.duration.toString();
- }
-}
[50/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/Configuration.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/Configuration.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/Configuration.java
new file mode 100644
index 0000000..20d1fa6
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/Configuration.java
@@ -0,0 +1,184 @@
+/*
+ * 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.api;
+
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.client.api.format.ODataMediaFormat;
+import org.apache.olingo.client.api.format.ODataPubFormat;
+import org.apache.olingo.client.api.format.ODataValueFormat;
+import org.apache.olingo.client.api.http.HttpClientFactory;
+import org.apache.olingo.client.api.http.HttpUriRequestFactory;
+
+import java.io.Serializable;
+import java.util.concurrent.ExecutorService;
+
+/**
+ * Configuration wrapper.
+ */
+public interface Configuration extends Serializable {
+
+ /**
+ * Gets the configured OData format for AtomPub exchanges. If this configuration parameter doesn't exist the
+ * JSON_FULL_METADATA format will be used as default.
+ *
+ * @return configured OData format for AtomPub if specified; JSON_FULL_METADATA format otherwise.
+ * @see ODataPubFormat#JSON_FULL_METADATA
+ */
+ ODataPubFormat getDefaultPubFormat();
+
+ /**
+ * Sets the default OData format for AtomPub exchanges.
+ *
+ * @param format default format.
+ */
+ void setDefaultPubFormat(ODataPubFormat format);
+
+ /**
+ * Gets the configured OData format. This value depends on what is returned from <tt>getDefaultPubFormat()</tt>.
+ *
+ * @return configured OData format
+ * @see #getDefaultPubFormat()
+ */
+ ODataFormat getDefaultFormat();
+
+ /**
+ * Gets the configured OData value format. If this configuration parameter doesn't exist the TEXT format will be used
+ * as default.
+ *
+ * @return configured OData value format if specified; TEXT format otherwise.
+ * @see ODataValueFormat#TEXT
+ */
+ ODataValueFormat getDefaultValueFormat();
+
+ /**
+ * Sets the default OData value format.
+ *
+ * @param format default format.
+ */
+ void setDefaultValueFormat(ODataValueFormat format);
+
+ /**
+ * Gets the configured OData media format. If this configuration parameter doesn't exist the APPLICATION_OCTET_STREAM
+ * format will be used as default.
+ *
+ * @return configured OData media format if specified; APPLICATION_OCTET_STREAM format otherwise.
+ * @see ODataMediaFormat#WILDCARD
+ */
+ ODataMediaFormat getDefaultMediaFormat();
+
+ /**
+ * Sets the default OData media format.
+ *
+ * @param format default format.
+ */
+ void setDefaultMediaFormat(ODataMediaFormat format);
+
+ /**
+ * Gets the HttpClient factory to be used for executing requests.
+ *
+ * @return provided implementation (if configured via <tt>setHttpClientFactory</tt> or default.
+ * @see DefaultHttpClientFactory
+ */
+ HttpClientFactory getHttpClientFactory();
+
+ /**
+ * Sets the HttpClient factory to be used for executing requests.
+ *
+ * @param factory implementation of <tt>HttpClientFactory</tt>.
+ * @see HttpClientFactory
+ */
+ void setHttpClientFactory(HttpClientFactory factory);
+
+ /**
+ * Gets the HttpUriRequest factory for generating requests to be executed.
+ *
+ * @return provided implementation (if configured via <tt>setHttpUriRequestFactory</tt> or default.
+ * @see DefaultHttpUriRequestFactory
+ */
+ HttpUriRequestFactory getHttpUriRequestFactory();
+
+ /**
+ * Sets the HttpUriRequest factory generating requests to be executed.
+ *
+ * @param factory implementation of <tt>HttpUriRequestFactory</tt>.
+ * @see HttpUriRequestFactory
+ */
+ void setHttpUriRequestFactory(HttpUriRequestFactory factory);
+
+ /**
+ * Gets whether <tt>PUT</tt>, <tt>MERGE</tt>, <tt>PATCH</tt>, <tt>DELETE</tt> HTTP methods need to be translated to
+ * <tt>POST</tt> with additional <tt>X-HTTTP-Method</tt> header.
+ *
+ * @return whether <tt>X-HTTTP-Method</tt> header is to be used
+ */
+ boolean isUseXHTTPMethod();
+
+ /**
+ * Sets whether <tt>PUT</tt>, <tt>MERGE</tt>, <tt>PATCH</tt>, <tt>DELETE</tt> HTTP methods need to be translated to
+ * <tt>POST</tt> with additional <tt>X-HTTTP-Method</tt> header.
+ *
+ * @param value 'TRUE' to use tunneling.
+ */
+ void setUseXHTTPMethod(boolean value);
+
+ /**
+ * Checks whether Gzip compression (e.g. support for <tt>Accept-Encoding: gzip</tt> and
+ * <tt>Content-Encoding: gzip</tt> HTTP headers) is enabled.
+ *
+ * @return whether HTTP Gzip compression is enabled
+ */
+ boolean isGzipCompression();
+
+ /**
+ * Sets Gzip compression (e.g. support for <tt>Accept-Encoding: gzip</tt> and
+ * <tt>Content-Encoding: gzip</tt> HTTP headers) enabled or disabled.
+ *
+ * @param value whether to use Gzip compression.
+ */
+ void setGzipCompression(boolean value);
+
+ /**
+ * Checks whether chunk HTTP encoding is being used.
+ *
+ * @return whether chunk HTTP encoding is being used
+ */
+ boolean isUseChuncked();
+
+ /**
+ * Sets chunk HTTP encoding enabled or disabled.
+ *
+ * @param value whether to use chunk HTTP encoding.
+ */
+ void setUseChuncked(boolean value);
+
+ /**
+ * Retrieves request executor service.
+ *
+ * @return request executor service.
+ */
+ ExecutorService getExecutor();
+
+ /**
+ * Sets request executor service.
+ *
+ * @param executorService new executor services.
+ */
+ void setExecutor(ExecutorService executorService);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/Constants.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/Constants.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/Constants.java
new file mode 100644
index 0000000..fd0570b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/Constants.java
@@ -0,0 +1,217 @@
+/*
+ * 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.api;
+
+import javax.xml.XMLConstants;
+
+/**
+ * Constant values related to the OData protocol.
+ */
+public class Constants {
+
+ // Other stuff
+ public final static String UTF8 = "UTF-8";
+
+ public final static String NAME = "name";
+
+ public final static String PROPERTIES = "properties";
+
+ // XML namespaces and prefixes
+ public final static String NS_ATOM = "http://www.w3.org/2005/Atom";
+
+ public static final String NS_GEORSS = "http://www.georss.org/georss";
+
+ public static final String NS_GML = "http://www.opengis.net/gml";
+
+ public static final String XMLNS_DATASERVICES = XMLConstants.XMLNS_ATTRIBUTE + ":d";
+
+ public static final String PREFIX_DATASERVICES = "d:";
+
+ public static final String XMLNS_METADATA = XMLConstants.XMLNS_ATTRIBUTE + ":m";
+
+ public static final String PREFIX_METADATA = "m:";
+
+ public static final String XMLNS_GEORSS = XMLConstants.XMLNS_ATTRIBUTE + ":georss";
+
+ public static final String PREFIX_GEORSS = "georss:";
+
+ public static final String XMLNS_GML = XMLConstants.XMLNS_ATTRIBUTE + ":gml";
+
+ public static final String PREFIX_GML = "gml:";
+
+ /**
+ * Edit link rel value.
+ */
+ public static final String EDIT_LINK_REL = "edit";
+
+ /**
+ * Self link rel value.
+ */
+ public static final String SELF_LINK_REL = "self";
+
+ public static final String NEXT_LINK_REL = "next";
+
+ // XML elements and attributes
+ public static final String ELEM_PROPERTIES = PREFIX_METADATA + PROPERTIES;
+
+ public static final String ELEM_ELEMENT = "element";
+
+ public final static String ATTR_TYPE = "type";
+
+ public static final String ATTR_M_TYPE = PREFIX_METADATA + ATTR_TYPE;
+
+ public static final String ATTR_NULL = PREFIX_METADATA + "null";
+
+ public static final String ATTR_XMLBASE = "xml:base";
+
+ public static final String ATTR_REL = "rel";
+
+ public static final String ATTR_HREF = "href";
+
+ public static final String ATTR_METADATA = "metadata";
+
+ public static final String ATTR_TITLE = "title";
+
+ public static final String ATTR_TARGET = "target";
+
+ public static final String ELEM_COLLECTION = "collection";
+
+ public static final String ATTR_SRSNAME = PREFIX_GML + "srsName";
+
+ public static final String ELEM_POINT = PREFIX_GML + "Point";
+
+ public static final String ELEM_MULTIPOINT = PREFIX_GML + "MultiPoint";
+
+ public static final String ELEM_POINTMEMBERS = PREFIX_GML + "pointMembers";
+
+ public static final String ELEM_LINESTRING = PREFIX_GML + "LineString";
+
+ public static final String ELEM_MULTILINESTRING = PREFIX_GML + "MultiCurve";
+
+ public static final String ELEM_LINESTRINGMEMBERS = PREFIX_GML + "curveMembers";
+
+ public static final String ELEM_POLYGON = PREFIX_GML + "Polygon";
+
+ public static final String ELEM_POLYGON_EXTERIOR = PREFIX_GML + "exterior";
+
+ public static final String ELEM_POLYGON_INTERIOR = PREFIX_GML + "interior";
+
+ public static final String ELEM_POLYGON_LINEARRING = PREFIX_GML + "LinearRing";
+
+ public static final String ELEM_MULTIPOLYGON = PREFIX_GML + "MultiSurface";
+
+ public static final String ELEM_SURFACEMEMBERS = PREFIX_GML + "surfaceMembers";
+
+ public static final String ELEM_GEOCOLLECTION = PREFIX_GML + "MultiGeometry";
+
+ public static final String ELEM_GEOMEMBERS = PREFIX_GML + "geometryMembers";
+
+ public static final String ELEM_POS = PREFIX_GML + "pos";
+
+ public static final String ELEM_POSLIST = PREFIX_GML + "posList";
+
+ public static final String ELEM_PROPERTY = "property";
+
+ public static final String ELEM_URI = "uri";
+
+ // JSON stuff
+ public final static String JSON_METADATA = "odata.metadata";
+
+ public final static String JSON_TYPE = "odata.type";
+
+ public final static String JSON_ETAG = "odata.etag";
+
+ public final static String JSON_MEDIA_ETAG = "odata.mediaETag";
+
+ public final static String JSON_ID = "odata.id";
+
+ public final static String JSON_READ_LINK = "odata.readLink";
+
+ public final static String JSON_EDIT_LINK = "odata.editLink";
+
+ public final static String JSON_MEDIAREAD_LINK = "odata.mediaReadLink";
+
+ public final static String JSON_MEDIAEDIT_LINK = "odata.mediaEditLink";
+
+ public final static String JSON_MEDIA_CONTENT_TYPE = "odata.mediaContentType";
+
+ public final static String JSON_NAVIGATION_LINK_SUFFIX = "@odata.navigationLinkUrl";
+
+ public final static String JSON_BIND_LINK_SUFFIX = "@odata.bind";
+
+ public final static String JSON_ASSOCIATION_LINK_SUFFIX = "@odata.associationLinkUrl";
+
+ public final static String JSON_MEDIAEDIT_LINK_SUFFIX = "@odata.mediaEditLink";
+
+ public final static String JSON_VALUE = "value";
+
+ public final static String JSON_URL = "url";
+
+ public final static String JSON_COORDINATES = "coordinates";
+
+ public final static String JSON_GEOMETRIES = "geometries";
+
+ public final static String JSON_CRS = "crs";
+
+ public final static String JSON_GIS_URLPREFIX = "http://www.opengis.net/def/crs/EPSG/0/";
+
+ // Atom stuff
+ public final static String ATOM_ELEM_ENTRY = "entry";
+
+ public final static String ATOM_ELEM_FEED = "feed";
+
+ public final static String ATOM_ELEM_CATEGORY = "category";
+
+ public final static String ATOM_ELEM_ID = "id";
+
+ public final static String ATOM_ELEM_LINK = "link";
+
+ public final static String ATOM_ELEM_CONTENT = "content";
+
+ public static final String ATOM_ELEM_TITLE = "title";
+
+ public static final String ATOM_ELEM_SUMMARY = "summary";
+
+ public static final String ATOM_ELEM_UPDATED = "updated";
+
+ public static final String ATOM_ELEM_AUTHOR = "author";
+
+ public static final String ATOM_ELEM_AUTHOR_NAME = "name";
+
+ public static final String ATOM_ELEM_AUTHOR_URI = "uri";
+
+ public static final String ATOM_ELEM_AUTHOR_EMAIL = "email";
+
+ public static final String ATOM_ELEM_ACTION = PREFIX_METADATA + "action";
+
+ public static final String ATOM_ELEM_INLINE = PREFIX_METADATA + "inline";
+
+ public static final String ATOM_ATTR_TITLE = "atom:title";
+
+ public static final String ATOM_ATTR_TERM = "term";
+
+ public static final String ATOM_ATTR_SCHEME = "scheme";
+
+ public static final String ATOM_ATTR_SRC = "src";
+
+ public static final String ATOM_ATTR_ETAG = PREFIX_METADATA + "etag";
+
+ public static final String ATOM_ATTR_COUNT = PREFIX_METADATA + "count";
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java
new file mode 100644
index 0000000..a63967d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataClient.java
@@ -0,0 +1,55 @@
+/*
+ * 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.api;
+
+import org.apache.olingo.client.api.op.ODataBinder;
+import org.apache.olingo.client.api.op.ODataDeserializer;
+import org.apache.olingo.client.api.op.ODataReader;
+import org.apache.olingo.client.api.op.ODataSerializer;
+import org.apache.olingo.client.api.uri.URIBuilder;
+import org.apache.olingo.client.api.uri.filter.FilterFactory;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public interface ODataClient {
+
+ ODataServiceVersion getServiceVersion();
+
+ //ODataHeaders getVersionHeaders();
+ Configuration getConfiguration();
+
+ URIBuilder<?> getURIBuilder(String serviceRoot);
+
+ FilterFactory getFilterFactory();
+
+ ODataSerializer getSerializer();
+
+ ODataDeserializer getDeserializer();
+
+ ODataReader getReader();
+
+// ODataWriter getWriter();
+ ODataBinder getBinder();
+
+// ODataObjectFactory getObjectFactory();
+// RetrieveRequestFactory getRetrieveRequestFactory();
+// CUDRequestFactory getCUDRequestFactory();
+// StreamedRequestFactory getStreamedRequestFactory();
+// InvokeRequestFactory<?, ?, ?, ?, ?, ?, ?, ?> getInvokeRequestFactory();
+// BatchRequestFactory getBatchRequestFactory();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataConstants.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataConstants.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataConstants.java
new file mode 100644
index 0000000..84109d4
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataConstants.java
@@ -0,0 +1,219 @@
+/*
+ * 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.api;
+
+import javax.xml.XMLConstants;
+
+/**
+ * Constant values related to the OData protocol.
+ */
+public class ODataConstants {
+
+ // Other stuff
+ public final static String UTF8 = "UTF-8";
+
+ public final static String NAME = "name";
+
+ public final static String PROPERTIES = "properties";
+
+ // XML namespaces and prefixes
+ public final static String NS_ATOM = "http://www.w3.org/2005/Atom";
+
+ public static final String NS_GEORSS = "http://www.georss.org/georss";
+
+ public static final String NS_GML = "http://www.opengis.net/gml";
+
+ public static final String XMLNS_DATASERVICES = XMLConstants.XMLNS_ATTRIBUTE + ":d";
+
+ public static final String PREFIX_DATASERVICES = "d:";
+
+ public static final String XMLNS_METADATA = XMLConstants.XMLNS_ATTRIBUTE + ":m";
+
+ public static final String PREFIX_METADATA = "m:";
+
+ public static final String XMLNS_GEORSS = XMLConstants.XMLNS_ATTRIBUTE + ":georss";
+
+ public static final String PREFIX_GEORSS = "georss:";
+
+ public static final String XMLNS_GML = XMLConstants.XMLNS_ATTRIBUTE + ":gml";
+
+ public static final String PREFIX_GML = "gml:";
+
+ /**
+ * Edit link rel value.
+ */
+ public static final String EDIT_LINK_REL = "edit";
+
+ /**
+ * Self link rel value.
+ */
+ public static final String SELF_LINK_REL = "self";
+
+ public static final String NEXT_LINK_REL = "next";
+
+ // XML elements and attributes
+ public static final String ELEM_PROPERTIES = PREFIX_METADATA + PROPERTIES;
+
+ public static final String ELEM_ELEMENT = "element";
+
+ public final static String ATTR_TYPE = "type";
+
+ public static final String ATTR_M_TYPE = PREFIX_METADATA + ATTR_TYPE;
+
+ public static final String ATTR_NULL = PREFIX_METADATA + "null";
+
+ public static final String ATTR_XMLBASE = "xml:base";
+
+ public static final String ATTR_REL = "rel";
+
+ public static final String ATTR_HREF = "href";
+
+ public static final String ATTR_METADATA = "metadata";
+
+ public static final String ATTR_TITLE = "title";
+
+ public static final String ATTR_TARGET = "target";
+
+ public static final String ELEM_COLLECTION = "collection";
+
+ public static final String ATTR_SRSNAME = PREFIX_GML + "srsName";
+
+ public static final String ELEM_POINT = PREFIX_GML + "Point";
+
+ public static final String ELEM_MULTIPOINT = PREFIX_GML + "MultiPoint";
+
+ public static final String ELEM_POINTMEMBERS = PREFIX_GML + "pointMembers";
+
+ public static final String ELEM_LINESTRING = PREFIX_GML + "LineString";
+
+ public static final String ELEM_MULTILINESTRING = PREFIX_GML + "MultiCurve";
+
+ public static final String ELEM_LINESTRINGMEMBERS = PREFIX_GML + "curveMembers";
+
+ public static final String ELEM_POLYGON = PREFIX_GML + "Polygon";
+
+ public static final String ELEM_POLYGON_EXTERIOR = PREFIX_GML + "exterior";
+
+ public static final String ELEM_POLYGON_INTERIOR = PREFIX_GML + "interior";
+
+ public static final String ELEM_POLYGON_LINEARRING = PREFIX_GML + "LinearRing";
+
+ public static final String ELEM_MULTIPOLYGON = PREFIX_GML + "MultiSurface";
+
+ public static final String ELEM_SURFACEMEMBERS = PREFIX_GML + "surfaceMembers";
+
+ public static final String ELEM_GEOCOLLECTION = PREFIX_GML + "MultiGeometry";
+
+ public static final String ELEM_GEOMEMBERS = PREFIX_GML + "geometryMembers";
+
+ public static final String ELEM_POS = PREFIX_GML + "pos";
+
+ public static final String ELEM_POSLIST = PREFIX_GML + "posList";
+
+ public static final String ELEM_PROPERTY = "property";
+
+ public static final String ELEM_URI = "uri";
+
+ // JSON stuff
+ public final static String JSON_CONTEXT = "@odata.context";
+
+ public final static String JSON_METADATA = "odata.metadata";
+
+ public final static String JSON_TYPE = "odata.type";
+
+ public final static String JSON_ETAG = "odata.etag";
+
+ public final static String JSON_MEDIA_ETAG = "odata.mediaETag";
+
+ public final static String JSON_ID = "odata.id";
+
+ public final static String JSON_READ_LINK = "odata.readLink";
+
+ public final static String JSON_EDIT_LINK = "odata.editLink";
+
+ public final static String JSON_MEDIAREAD_LINK = "odata.mediaReadLink";
+
+ public final static String JSON_MEDIAEDIT_LINK = "odata.mediaEditLink";
+
+ public final static String JSON_MEDIA_CONTENT_TYPE = "odata.mediaContentType";
+
+ public final static String JSON_NAVIGATION_LINK_SUFFIX = "@odata.navigationLinkUrl";
+
+ public final static String JSON_BIND_LINK_SUFFIX = "@odata.bind";
+
+ public final static String JSON_ASSOCIATION_LINK_SUFFIX = "@odata.associationLinkUrl";
+
+ public final static String JSON_MEDIAEDIT_LINK_SUFFIX = "@odata.mediaEditLink";
+
+ public final static String JSON_VALUE = "value";
+
+ public final static String JSON_URL = "url";
+
+ public final static String JSON_COORDINATES = "coordinates";
+
+ public final static String JSON_GEOMETRIES = "geometries";
+
+ public final static String JSON_CRS = "crs";
+
+ public final static String JSON_GIS_URLPREFIX = "http://www.opengis.net/def/crs/EPSG/0/";
+
+ // Atom stuff
+ public final static String ATOM_ELEM_ENTRY = "entry";
+
+ public final static String ATOM_ELEM_FEED = "feed";
+
+ public final static String ATOM_ELEM_CATEGORY = "category";
+
+ public final static String ATOM_ELEM_ID = "id";
+
+ public final static String ATOM_ELEM_LINK = "link";
+
+ public final static String ATOM_ELEM_CONTENT = "content";
+
+ public static final String ATOM_ELEM_TITLE = "title";
+
+ public static final String ATOM_ELEM_SUMMARY = "summary";
+
+ public static final String ATOM_ELEM_UPDATED = "updated";
+
+ public static final String ATOM_ELEM_AUTHOR = "author";
+
+ public static final String ATOM_ELEM_AUTHOR_NAME = "name";
+
+ public static final String ATOM_ELEM_AUTHOR_URI = "uri";
+
+ public static final String ATOM_ELEM_AUTHOR_EMAIL = "email";
+
+ public static final String ATOM_ELEM_ACTION = PREFIX_METADATA + "action";
+
+ public static final String ATOM_ELEM_INLINE = PREFIX_METADATA + "inline";
+
+ public static final String ATOM_ATTR_TITLE = "atom:title";
+
+ public static final String ATOM_ATTR_TERM = "term";
+
+ public static final String ATOM_ATTR_SCHEME = "scheme";
+
+ public static final String ATOM_ATTR_SRC = "src";
+
+ public static final String ATOM_ATTR_ETAG = PREFIX_METADATA + "etag";
+
+ public static final String ATOM_ATTR_COUNT = PREFIX_METADATA + "count";
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataError.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataError.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataError.java
new file mode 100644
index 0000000..ad0bd1f
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataError.java
@@ -0,0 +1,67 @@
+/*
+ * 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.api;
+
+/**
+ * OData error.
+ */
+public interface ODataError {
+
+ /**
+ * Gets error code.
+ *
+ * @return error code.
+ */
+ String getCode();
+
+ /**
+ * Gets error message language.
+ *
+ * @return error message language.
+ */
+ String getMessageLang();
+
+ /**
+ * Gets error message.
+ *
+ * @return error message.
+ */
+ String getMessageValue();
+
+ /**
+ * Gets inner error message.
+ *
+ * @return inner error message.
+ */
+ String getInnerErrorMessage();
+
+ /**
+ * Gets inner error type.
+ *
+ * @return inner error type.
+ */
+ String getInnerErrorType();
+
+ /**
+ * Gets inner error stack-trace.
+ *
+ * @return inner error stack-trace
+ */
+ String getInnerErrorStacktrace();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataV3Client.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataV3Client.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataV3Client.java
new file mode 100644
index 0000000..daaf6a4
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataV3Client.java
@@ -0,0 +1,39 @@
+/*
+ * 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.api;
+
+import org.apache.olingo.client.api.op.ODataV3Deserializer;
+import org.apache.olingo.client.api.uri.V3URIBuilder;
+import org.apache.olingo.client.api.uri.filter.V3FilterFactory;
+
+public interface ODataV3Client extends ODataClient {
+
+ @Override
+ V3Configuration getConfiguration();
+
+ @Override
+ V3URIBuilder getURIBuilder(String serviceRoot);
+
+ @Override
+ V3FilterFactory getFilterFactory();
+
+ @Override
+ ODataV3Deserializer getDeserializer();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataV4Client.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataV4Client.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataV4Client.java
new file mode 100644
index 0000000..b427cb3
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/ODataV4Client.java
@@ -0,0 +1,39 @@
+/*
+ * 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.api;
+
+import org.apache.olingo.client.api.op.ODataV4Deserializer;
+import org.apache.olingo.client.api.uri.V4URIBuilder;
+import org.apache.olingo.client.api.uri.filter.V4FilterFactory;
+
+public interface ODataV4Client extends ODataClient {
+
+ @Override
+ V4Configuration getConfiguration();
+
+ @Override
+ V4URIBuilder getURIBuilder(String serviceRoot);
+
+ @Override
+ V4FilterFactory getFilterFactory();
+
+ @Override
+ ODataV4Deserializer getDeserializer();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/UnsupportedInV3Exception.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/UnsupportedInV3Exception.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/UnsupportedInV3Exception.java
new file mode 100644
index 0000000..8c29c2d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/UnsupportedInV3Exception.java
@@ -0,0 +1,31 @@
+/*
+ * 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.api;
+
+import org.apache.olingo.commons.api.edm.EdmException;
+
+public class UnsupportedInV3Exception extends EdmException {
+
+ private static final long serialVersionUID = 4773734640262424651L;
+
+ public UnsupportedInV3Exception() {
+ super("Not supported in OData 3.0");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/V3Configuration.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/V3Configuration.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/V3Configuration.java
new file mode 100644
index 0000000..b7f1065
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/V3Configuration.java
@@ -0,0 +1,44 @@
+/*
+ * 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.api;
+
+public interface V3Configuration extends Configuration {
+
+ /**
+ * Checks whether URIs contain entity key between parentheses (standard) or instead as additional segment.
+ * <br/>
+ * 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.
+ */
+ boolean isKeyAsSegment();
+
+ /**
+ * Sets whether URIs shall be built with entity key between parentheses (standard) or instead as additional segment.
+ * <br/>
+ * 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.
+ */
+ void setKeyAsSegment(boolean value);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/V4Configuration.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/V4Configuration.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/V4Configuration.java
new file mode 100644
index 0000000..ef6d4ab
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/V4Configuration.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api;
+
+public interface V4Configuration extends Configuration {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/data/ServiceDocument.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/data/ServiceDocument.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/data/ServiceDocument.java
new file mode 100644
index 0000000..d545567
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/data/ServiceDocument.java
@@ -0,0 +1,138 @@
+/*
+ * 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.api.data;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * REST resource for an <tt>ODataServiceDocument</tt>.
+ *
+ * @see org.apache.olingo.client.api.domain.ODataServiceDocument
+ */
+public interface ServiceDocument {
+
+ String getTitle();
+
+ /**
+ * Gets base URI.
+ *
+ * @return base URI.
+ */
+ URI getBaseURI();
+
+ /**
+ * Returns metadata context.
+ *
+ * @return metadata context
+ */
+ String getMetadataContext();
+
+ /**
+ * Returns metadata ETag.
+ *
+ * @return metadata ETag
+ */
+ String getMetadataETag();
+
+ /**
+ * Gets top level entity sets.
+ *
+ * @return top level entity sets.
+ */
+ List<ServiceDocumentItem> getEntitySets();
+
+ /**
+ * Gets top level entity set with given name.
+ *
+ * @param name entity set name
+ * @return entity set with given name if found, otherwise null
+ */
+ ServiceDocumentItem getEntitySetByName(String name);
+
+ /**
+ * Gets top level entity set with given title.
+ *
+ * @param title entity set title
+ * @return entity set with given title if found, otherwise null
+ */
+ ServiceDocumentItem getEntitySetByTitle(String title);
+
+ /**
+ * Gets top level function imports.
+ *
+ * @return top level function imports.
+ */
+ List<ServiceDocumentItem> getFunctionImports();
+
+ /**
+ * Gets top level function import set with given name.
+ *
+ * @param name function import name
+ * @return function import with given name if found, otherwise null
+ */
+ ServiceDocumentItem getFunctionImportByName(String name);
+
+ /**
+ * Gets top level function import with given title.
+ *
+ * @param title function import title
+ * @return function import with given title if found, otherwise null
+ */
+ ServiceDocumentItem getFunctionImportByTitle(String title);
+
+ /**
+ * Gets top level singletons.
+ *
+ * @return top level singletons.
+ */
+ List<ServiceDocumentItem> getSingletons();
+
+ /**
+ * Gets top level singleton with given name.
+ *
+ * @param name singleton name
+ * @return singleton with given name if found, otherwise null
+ */
+ ServiceDocumentItem getSingletonByName(String name);
+
+ /**
+ * Gets top level singleton with given title.
+ *
+ * @param title singleton title
+ * @return singleton with given title if found, otherwise null
+ */
+ ServiceDocumentItem getSingletonByTitle(String title);
+
+ /**
+ * Gets related service documents.
+ *
+ * @return related service documents.
+ */
+ List<ServiceDocumentItem> getRelatedServiceDocuments();
+
+ /**
+ * Gets related service document with given title.
+ *
+ * @param title related service document title
+ * @return related service document with given title if found, otherwise null
+ */
+ ServiceDocumentItem getRelatedServiceDocumentByTitle(String title);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/data/ServiceDocumentItem.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/data/ServiceDocumentItem.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/data/ServiceDocumentItem.java
new file mode 100644
index 0000000..6847771
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/data/ServiceDocumentItem.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.data;
+
+public interface ServiceDocumentItem {
+
+ String getHref();
+
+ String getName();
+
+ String getTitle();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/AnnotationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/AnnotationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/AnnotationProperty.java
new file mode 100644
index 0000000..c9b9c86
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/AnnotationProperty.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.deserializer;
+
+public interface AnnotationProperty extends Property {
+
+ String getValue();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/ClientException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/ClientException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/ClientException.java
new file mode 100644
index 0000000..94b74a3
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/ClientException.java
@@ -0,0 +1,36 @@
+/*
+ * 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.api.deserializer;
+
+public class ClientException extends Exception {
+
+ private static final long serialVersionUID = 5148670827051750921L;
+
+ public ClientException() {
+ super();
+ }
+
+ public ClientException(final String message) {
+ super(message);
+ }
+
+ public ClientException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/ComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/ComplexValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/ComplexValue.java
new file mode 100644
index 0000000..a72e4da
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/ComplexValue.java
@@ -0,0 +1,35 @@
+/*
+ * 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.api.deserializer;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ComplexValue extends Value {
+
+ Value getValue(String name);
+
+ List<Property> getProperties();
+
+ Map<String, NavigationProperty> getNavigationProperties();
+
+ Map<String, AnnotationProperty> getAnnotationProperties();
+
+ Map<String, StructuralProperty> getStructuralProperties();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Entity.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Entity.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Entity.java
new file mode 100644
index 0000000..6e040f9
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Entity.java
@@ -0,0 +1,59 @@
+/*
+ * 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.api.deserializer;
+
+import java.util.List;
+import java.util.Map;
+
+public interface Entity {
+
+ String getODataContext();
+
+ String getODataMetaDataEtag();
+
+ String getODataType();
+
+ Long getODataCount();
+
+ String getODataNextLink();
+
+ String getODataDeltaLink();
+
+ String getODataId();
+
+ String getODataETag();
+
+ String getODataEditLink();
+
+ String getODataReadLink();
+
+ List<Property> getProperties();
+
+ Map<String, NavigationProperty> getNavigationProperties();
+
+ Map<String, AnnotationProperty> getAnnotationProperties();
+
+ Map<String, StructuralProperty> getStructuralProperties();
+
+ Property getProperty(String name);
+
+ <T extends Property> T getProperty(String name, Class<T> clazz);
+
+ Object getPropertyContent(String name);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/EntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/EntitySet.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/EntitySet.java
new file mode 100644
index 0000000..2422e30
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/EntitySet.java
@@ -0,0 +1,34 @@
+/*
+ * 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.api.deserializer;
+
+import java.util.List;
+
+public interface EntitySet extends Iterable<Entity> {
+
+ String getODataContext();
+
+ Long getODataCount();
+
+ String getODataNextLink();
+
+ String getODataDeltaLink();
+
+ List<Entity> getEntities();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/NavigationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/NavigationProperty.java
new file mode 100644
index 0000000..8fc240e
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/NavigationProperty.java
@@ -0,0 +1,27 @@
+/*
+ * 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.api.deserializer;
+
+public interface NavigationProperty extends Property {
+
+ public abstract String getAssociationLink();
+
+ public abstract String getNavigationLink();
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Property.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Property.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Property.java
new file mode 100644
index 0000000..eeb429f
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Property.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.deserializer;
+
+public interface Property {
+
+ String getName();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Reader.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Reader.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Reader.java
new file mode 100644
index 0000000..01b2378
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Reader.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.deserializer;
+
+import java.io.InputStream;
+
+public interface Reader {
+
+ EntitySet readEntitySet(InputStream in) throws ClientException;
+
+ Entity readEntity(InputStream in) throws ClientException;
+
+ Property readProperty(InputStream in) throws ClientException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/StructuralProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/StructuralProperty.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/StructuralProperty.java
new file mode 100644
index 0000000..e9470ac
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/StructuralProperty.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.deserializer;
+
+import java.util.List;
+
+public interface StructuralProperty extends Property {
+
+ boolean containsCollection();
+
+ Value getValue();
+
+ List<Value> getValues();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Value.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Value.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Value.java
new file mode 100644
index 0000000..1a11ae4
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/deserializer/Value.java
@@ -0,0 +1,28 @@
+/*
+ * 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.api.deserializer;
+
+public interface Value {
+
+ boolean isComplex();
+
+ Object getContent();
+
+ <T> T getContentAs(T type);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/EdmSimpleType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/EdmSimpleType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/EdmSimpleType.java
new file mode 100644
index 0000000..92692a0
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/EdmSimpleType.java
@@ -0,0 +1,289 @@
+/*
+ * 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.api.domain;
+
+import java.math.BigDecimal;
+import java.net.URI;
+import java.util.UUID;
+
+import org.apache.olingo.client.api.domain.geospatial.Geospatial;
+import org.apache.olingo.client.api.domain.geospatial.GeospatialCollection;
+import org.apache.olingo.client.api.domain.geospatial.LineString;
+import org.apache.olingo.client.api.domain.geospatial.MultiLineString;
+import org.apache.olingo.client.api.domain.geospatial.MultiPoint;
+import org.apache.olingo.client.api.domain.geospatial.MultiPolygon;
+import org.apache.olingo.client.api.domain.geospatial.Point;
+import org.apache.olingo.client.api.domain.geospatial.Polygon;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+/**
+ * Represent the primitive types of the Entity Data Model (EDM).
+ *
+ * @see http://dl.windowsazure.com/javadoc/com/microsoft/windowsazure/services/table/models/EdmType.html
+ * <p>
+ * For an overview of the available EDM primitive data types and names, see the <a
+ * href="http://www.odata.org/developers/protocols/overview#AbstractTypeSystem">Primitive Data Types</a> section of the
+ * <a href="http://www.odata.org/developers/protocols/overview">OData Protocol Overview</a>.
+ * </p>
+ * <p>
+ * The Abstract Type System used to define the primitive types supported by OData is defined in detail in <a
+ * href="http://msdn.microsoft.com/en-us/library/dd541474.aspx">[MC-CSDL] (section 2.2.1).</a>
+ * </p>
+ */
+public enum EdmSimpleType {
+
+ /**
+ * The absence of a value.
+ */
+ Null(Void.class),
+ /**
+ * An array of bytes.
+ */
+ Binary(byte[].class),
+ /**
+ * A Boolean value.
+ */
+ Boolean(Boolean.class),
+ /**
+ * Unsigned 8-bit integer value.
+ */
+ Byte(Integer.class),
+ /**
+ * A signed 8-bit integer value.
+ */
+ SByte(Byte.class),
+ /**
+ * A 64-bit value expressed as Coordinated Universal Time (UTC).
+ */
+ DateTime(new ODataServiceVersion[]{ODataServiceVersion.V30}, ODataTimestamp.class, "yyyy-MM-dd'T'HH:mm:ss"),
+ /**
+ * Date without a time-zone offset.
+ */
+ Date(new ODataServiceVersion[]{ODataServiceVersion.V40}, ODataTimestamp.class, "yyyy-MM-dd"),
+ /**
+ * Date and time as an Offset in minutes from GMT.
+ */
+ DateTimeOffset(ODataTimestamp.class, "yyyy-MM-dd'T'HH:mm:ss"),
+ /**
+ * The time of day with values ranging from 0:00:00.x to 23:59:59.y, where x and y depend upon the precision.
+ */
+ Time(new ODataServiceVersion[]{ODataServiceVersion.V30}, ODataDuration.class),
+ /**
+ * The time of day with values ranging from 0:00:00.x to 23:59:59.y, where x and y depend upon the precision.
+ */
+ TimeOfDay(new ODataServiceVersion[]{ODataServiceVersion.V40}, ODataDuration.class),
+ /**
+ * Signed duration in days, hours, minutes, and (sub)seconds.
+ */
+ Duration(new ODataServiceVersion[]{ODataServiceVersion.V40}, ODataDuration.class),
+ /**
+ * Numeric values with fixed precision and scale.
+ */
+ Decimal(BigDecimal.class, "#.#######################"),
+ /**
+ * A floating point number with 7 digits precision.
+ */
+ Single(Float.class, "#.#######E0"),
+ /**
+ * A 64-bit double-precision floating point value.
+ */
+ Double(Double.class, "#.#######################E0"),
+ // --- Geospatial ---
+ Geography(Geospatial.class),
+ GeographyPoint(Point.class),
+ GeographyLineString(LineString.class),
+ GeographyPolygon(Polygon.class),
+ GeographyMultiPoint(MultiPoint.class),
+ GeographyMultiLineString(MultiLineString.class),
+ GeographyMultiPolygon(MultiPolygon.class),
+ GeographyCollection(GeospatialCollection.class),
+ Geometry(Geospatial.class),
+ GeometryPoint(Point.class),
+ GeometryLineString(LineString.class),
+ GeometryPolygon(Polygon.class),
+ GeometryMultiPoint(MultiPoint.class),
+ GeometryMultiLineString(MultiLineString.class),
+ GeometryMultiPolygon(MultiPolygon.class),
+ GeometryCollection(GeospatialCollection.class),
+ /**
+ * A 128-bit globally unique identifier.
+ */
+ Guid(UUID.class),
+ /**
+ * A 16-bit integer value.
+ */
+ Int16(Short.class),
+ /**
+ * A 32-bit integer value.
+ */
+ Int32(Integer.class),
+ /**
+ * A 64-bit integer value.
+ */
+ Int64(Long.class),
+ /**
+ * A UTF-16-encoded value. String values may be up to 64 KB in size.
+ */
+ String(String.class),
+ /**
+ * Resource stream (for media entities).
+ */
+ Stream(URI.class);
+
+ private final Class<?> clazz;
+
+ private final String pattern;
+
+ private final ODataServiceVersion[] versions;
+
+ /**
+ * Constructor (all OData versions).
+ *
+ * @param clazz type.
+ */
+ EdmSimpleType(final Class<?> clazz) {
+ this(ODataServiceVersion.values(), clazz, null);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param versions supported OData versions.
+ * @param clazz type.
+ */
+ EdmSimpleType(final ODataServiceVersion[] versions, final Class<?> clazz) {
+ this(versions, clazz, null);
+ }
+
+ /**
+ * Constructor (all OData versions).
+ *
+ * @param clazz type.
+ * @param pattern pattern.
+ */
+ EdmSimpleType(final Class<?> clazz, final String pattern) {
+ this(ODataServiceVersion.values(), clazz, pattern);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param versions supported OData versions.
+ * @param clazz type.
+ * @param pattern pattern.
+ */
+ EdmSimpleType(final ODataServiceVersion[] versions, final Class<?> clazz, final String pattern) {
+ this.clazz = clazz;
+ this.pattern = pattern;
+ this.versions = versions.clone();
+ }
+
+ /**
+ * Gets pattern.
+ *
+ * @return pattern.
+ */
+ public String pattern() {
+ return pattern;
+ }
+
+ /**
+ * Gets corresponding java type.
+ *
+ * @return java type.
+ */
+ public Class<?> javaType() {
+ return this.clazz;
+ }
+
+ /**
+ * {@inheritDoc }
+ */
+ @Override
+ public String toString() {
+ return namespace() + "." + name();
+ }
+
+ /**
+ * Checks if is a geospatial type.
+ *
+ * @return <tt>true</tt> if is geospatial type; <tt>false</tt> otherwise.
+ */
+ public boolean isGeospatial() {
+ return name().startsWith("Geo");
+ }
+
+ /**
+ * Checks if the given type is a geospatial type.
+ *
+ * @param type type.
+ * @return <tt>true</tt> if is geospatial type; <tt>false</tt> otherwise.
+ */
+ public static boolean isGeospatial(final String type) {
+ return type != null && type.startsWith(namespace() + ".Geo");
+ }
+
+ /**
+ * Gets <tt>EdmSimpleType</tt> from string.
+ *
+ * @param value string value type.
+ * @return <tt>EdmSimpleType</tt> object.
+ */
+ public static EdmSimpleType fromValue(final String value) {
+ final String noNsValue = value.substring(4);
+ for (EdmSimpleType edmSimpleType : EdmSimpleType.values()) {
+ if (edmSimpleType.name().equals(noNsValue)) {
+ return edmSimpleType;
+ }
+ }
+ throw new IllegalArgumentException(value);
+ }
+
+ /**
+ * Gets <tt>EdmSimpleType</tt> from object instance.
+ *
+ * @param workingVersion OData version.
+ * @param obj object.
+ * @return <tt>EdmSimpleType</tt> object.
+ */
+ public static EdmSimpleType fromObject(final ODataServiceVersion workingVersion, final Object obj) {
+ for (EdmSimpleType edmSimpleType : EdmSimpleType.values()) {
+ if (edmSimpleType.javaType().equals(obj.getClass())) {
+ return edmSimpleType == DateTimeOffset || edmSimpleType == DateTime || edmSimpleType == Date
+ ? ((ODataTimestamp) obj).isOffset()
+ ? DateTimeOffset : workingVersion == ODataServiceVersion.V30 ? DateTime : Date
+ : edmSimpleType;
+ }
+ }
+ throw new IllegalArgumentException(obj.getClass().getSimpleName() + " is not a simple type");
+ }
+
+ /**
+ * Gets namespace.
+ *
+ * @return namespace.
+ */
+ public static String namespace() {
+ return "Edm";
+ }
+
+ public ODataServiceVersion[] getSupportedVersions() {
+ return versions.clone();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataCollectionValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataCollectionValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataCollectionValue.java
new file mode 100644
index 0000000..afe46b7
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataCollectionValue.java
@@ -0,0 +1,98 @@
+/*
+ * 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.api.domain;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * OData collection property value.
+ */
+public class ODataCollectionValue extends ODataValue implements Iterable<ODataValue> {
+
+ private static final long serialVersionUID = -3665659846001987187L;
+
+ /**
+ * Type name;
+ */
+ private final String typeName;
+
+ /**
+ * Values.
+ */
+ private final List<ODataValue> values = new ArrayList<ODataValue>();
+
+ /**
+ * Constructor.
+ *
+ * @param typeName type name.
+ */
+ public ODataCollectionValue(final String typeName) {
+ this.typeName = typeName;
+ }
+
+ /**
+ * Adds a value to the collection.
+ *
+ * @param value value to be added.
+ */
+ public void add(final ODataValue value) {
+ if (value.isPrimitive() || value.isComplex()) {
+ values.add(value);
+ }
+ }
+
+ /**
+ * Value iterator.
+ *
+ * @return value iterator.
+ */
+ @Override
+ public Iterator<ODataValue> iterator() {
+ return values.iterator();
+ }
+
+ /**
+ * Gets value type name.
+ *
+ * @return value type name.
+ */
+ public String getTypeName() {
+ return typeName;
+ }
+
+ /**
+ * Gets collection size.
+ *
+ * @return collection size.
+ */
+ public int size() {
+ return values.size();
+ }
+
+ /**
+ * Checks if collection is empty.
+ *
+ * @return 'TRUE' if empty; 'FALSE' otherwise.
+ */
+ public boolean isEmpty() {
+ return values.isEmpty();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataComplexValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataComplexValue.java
new file mode 100644
index 0000000..2e15c8b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataComplexValue.java
@@ -0,0 +1,97 @@
+/*
+ * 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.api.domain;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * OData complex property value.
+ */
+public class ODataComplexValue extends ODataValue implements Iterable<ODataProperty> {
+
+ private static final long serialVersionUID = -1878555027714020431L;
+
+ /**
+ * Type name.
+ */
+ private final String typeName;
+
+ /**
+ * Complex type fields.
+ */
+ private final Map<String, ODataProperty> fields = new LinkedHashMap<String, ODataProperty>();
+
+ /**
+ * Constructor.
+ *
+ * @param typeName type name.
+ */
+ public ODataComplexValue(final String typeName) {
+ this.typeName = typeName;
+ }
+
+ /**
+ * Adds field to the complex type.
+ *
+ * @param field field to be added.
+ */
+ public void add(final ODataProperty field) {
+ fields.put(field.getName(), field);
+ }
+
+ /**
+ * Gets field.
+ *
+ * @param name name of the field to be retrieved.
+ * @return requested field.
+ */
+ public ODataProperty get(final String name) {
+ return fields.get(name);
+ }
+
+ /**
+ * Complex property fields iterator.
+ *
+ * @return fields iterator.
+ */
+ @Override
+ public Iterator<ODataProperty> iterator() {
+ return fields.values().iterator();
+ }
+
+ /**
+ * Gest value type name.
+ *
+ * @return value type name.
+ */
+ public String getTypeName() {
+ return typeName;
+ }
+
+ /**
+ * Gets number of fields.
+ *
+ * @return number of fields.
+ */
+ public int size() {
+ return fields.size();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataDuration.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataDuration.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataDuration.java
new file mode 100644
index 0000000..2d3b1b2
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataDuration.java
@@ -0,0 +1,79 @@
+/*
+ * 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.api.domain;
+
+import java.io.Serializable;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * Helper class for handling time (as duration) primitive values.
+ *
+ * @see Duration
+ */
+public final class ODataDuration implements Serializable {
+
+ private static final long serialVersionUID = 778404231943967899L;
+
+ private final Duration duration;
+
+ public ODataDuration(final String input) {
+ try {
+ final DatatypeFactory dtFactory = DatatypeFactory.newInstance();
+ this.duration = dtFactory.newDuration(input);
+ } catch (DatatypeConfigurationException e) {
+ throw new IllegalArgumentException("Could not parse '" + input + "' as Duration", e);
+ }
+ }
+
+ public ODataDuration(final Duration duration) {
+ this.duration = duration;
+ }
+
+ public Duration getDuration() {
+ return duration;
+ }
+
+ /**
+ * {@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 this.duration.toString();
+ }
+}
[11/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmString.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmString.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmString.java
deleted file mode 100644
index 8edbc1c..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmString.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 org.apache.olingo.odata4.commons.core.edm.primitivetype;
-
-import java.util.regex.Pattern;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type String.
- */
-public final class EdmString extends SingletonPrimitiveType {
-
- private static final Pattern PATTERN_ASCII = Pattern.compile("\\p{ASCII}*");
-
- private static final EdmString INSTANCE = new EdmString();
-
- {
- uriPrefix = "'";
- uriSuffix = "'";
- }
-
- public static EdmString getInstance() {
- return INSTANCE;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return String.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- if (isUnicode != null && !isUnicode && !PATTERN_ASCII.matcher(value).matches()
- || maxLength != null && maxLength < value.length()) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
-
- if (returnType.isAssignableFrom(String.class)) {
- return returnType.cast(value);
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- final String result = value instanceof String ? (String) value : String.valueOf(value);
-
- if (isUnicode != null && !isUnicode && !PATTERN_ASCII.matcher(result).matches()
- || maxLength != null && maxLength < result.length()) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
-
- return result;
- }
-
- @Override
- public String toUriLiteral(final String literal) {
- if (literal == null) {
- return null;
- }
-
- final int length = literal.length();
-
- final StringBuilder uriLiteral = new StringBuilder(length + 2);
- uriLiteral.append(uriPrefix);
- for (int i = 0; i < length; i++) {
- final char c = literal.charAt(i);
- if (c == '\'') {
- uriLiteral.append(c);
- }
- uriLiteral.append(c);
- }
- uriLiteral.append(uriSuffix);
- return uriLiteral.toString();
- }
-
- @Override
- public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
- return literal == null ? null : super.fromUriLiteral(literal).replace("''", "'");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmTimeOfDay.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmTimeOfDay.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmTimeOfDay.java
deleted file mode 100644
index 9605fa0..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmTimeOfDay.java
+++ /dev/null
@@ -1,107 +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.commons.core.edm.primitivetype;
-
-import java.util.Calendar;
-import java.util.TimeZone;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-public final class EdmTimeOfDay extends SingletonPrimitiveType {
-
- private static final Pattern PATTERN = Pattern.compile(
- "(\\p{Digit}{2}):(\\p{Digit}{2})(?::(\\p{Digit}{2})(\\.(\\p{Digit}{0,3}?)0*)?)?");
-
- private static final EdmTimeOfDay INSTANCE = new EdmTimeOfDay();
-
- public static EdmTimeOfDay getInstance() {
- return INSTANCE;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Calendar.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- final Matcher matcher = PATTERN.matcher(value);
- if (!matcher.matches()) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
-
- final Calendar dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
- dateTimeValue.clear();
- dateTimeValue.set(Calendar.HOUR_OF_DAY, Byte.parseByte(matcher.group(1)));
- dateTimeValue.set(Calendar.MINUTE, Byte.parseByte(matcher.group(2)));
- dateTimeValue.set(Calendar.SECOND, matcher.group(3) == null ? 0 : Byte.parseByte(matcher.group(3)));
-
- if (matcher.group(4) != null) {
- if (matcher.group(4).length() == 1 || matcher.group(4).length() > 13) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
- final String decimals = matcher.group(5);
- if (decimals.length() > (precision == null ? 0 : precision)) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
- final String milliSeconds = decimals + "000".substring(decimals.length());
- dateTimeValue.set(Calendar.MILLISECOND, Short.parseShort(milliSeconds));
- }
-
- try {
- return EdmDateTimeOffset.convertDateTime(dateTimeValue, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- final Calendar dateTimeValue = EdmDateTimeOffset.createDateTime(value);
-
- final StringBuilder result = new StringBuilder(8); // Eight characters are enough for "normal" times.
- EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.HOUR_OF_DAY));
- result.append(':');
- EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.MINUTE));
- result.append(':');
- EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.SECOND));
-
- try {
- EdmDateTimeOffset.appendMilliseconds(result, dateTimeValue.get(Calendar.MILLISECOND), precision);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets), e");
- }
-
- return result.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/SingletonPrimitiveType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/SingletonPrimitiveType.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/SingletonPrimitiveType.java
deleted file mode 100644
index af36e4c..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/SingletonPrimitiveType.java
+++ /dev/null
@@ -1,52 +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.commons.core.edm.primitivetype;
-
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-/**
- * Abstract singleton implementation of the EDM primitive-type interface.
- */
-public abstract class SingletonPrimitiveType extends AbstractPrimitiveType {
-
- @Override
- public boolean equals(final Object obj) {
- return this == obj || obj != null && getClass() == obj.getClass();
- }
-
- @Override
- public int hashCode() {
- return getClass().hashCode();
- }
-
- @Override
- public String getNamespace() {
- return EDM_NAMESPACE;
- }
-
- @Override
- public String getName() {
- return getClass().getSimpleName().substring(3);
- }
-
- @Override
- public EdmTypeKind getKind() {
- return EdmTypeKind.PRIMITIVE;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/Uint7.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/Uint7.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/Uint7.java
deleted file mode 100644
index 3f18965..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/Uint7.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.commons.core.edm.primitivetype;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the internal primitive type "unsigned 7-bit integer".
- */
-public final class Uint7 extends SingletonPrimitiveType {
-
- private static final Uint7 INSTANCE = new Uint7();
-
- public static Uint7 getInstance() {
- return INSTANCE;
- }
-
- @Override
- public String getNamespace() {
- return SYSTEM_NAMESPACE;
- }
-
- @Override
- public String getName() {
- return getClass().getSimpleName();
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Byte.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- return EdmSByte.getInstance().internalValueOfString(
- value, isNullable, maxLength, precision, scale, isUnicode, returnType);
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- return EdmSByte.getInstance().internalValueToString(
- value, isNullable, maxLength, precision, scale, isUnicode);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/ActionMapKeyTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/ActionMapKeyTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/ActionMapKeyTest.java
new file mode 100644
index 0000000..b4956f2
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/ActionMapKeyTest.java
@@ -0,0 +1,102 @@
+/*
+ * 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.commons.core.edm;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.fail;
+
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.ActionMapKey;
+import org.junit.Test;
+
+public class ActionMapKeyTest {
+
+ private final FullQualifiedName fqn = new FullQualifiedName("namespace", "name");
+
+ private final FullQualifiedName fqnType = new FullQualifiedName("namespace2", "name2");
+
+ @Test
+ public void invalidParametersTest() {
+ createAndCheckForEdmException(null, null, null);
+ createAndCheckForEdmException(fqn, null, null);
+ createAndCheckForEdmException(fqn, fqnType, null);
+ createAndCheckForEdmException(fqn, null, true);
+ createAndCheckForEdmException(null, fqnType, true);
+ createAndCheckForEdmException(null, fqnType, null);
+ createAndCheckForEdmException(null, null, true);
+
+ }
+
+ private void createAndCheckForEdmException(final FullQualifiedName fqn, final FullQualifiedName typeName,
+ final Boolean collection) {
+ try {
+ new ActionMapKey(fqn, typeName, collection);
+ } catch (EdmException e) {
+ return;
+ }
+ fail("EdmException expected for parameters: " + fqn + " " + typeName + " " + collection);
+ }
+
+ @Test
+ public void testEqualsMethod() {
+ ActionMapKey key;
+ ActionMapKey someKey;
+
+ key = new ActionMapKey(fqn, fqnType, false);
+ someKey = new ActionMapKey(fqn, fqnType, false);
+ assertEquals(key, someKey);
+
+ key = new ActionMapKey(fqn, fqnType, new Boolean(false));
+ someKey = new ActionMapKey(fqn, fqnType, false);
+ assertEquals(key, someKey);
+
+ key = new ActionMapKey(fqn, fqnType, true);
+ someKey = new ActionMapKey(fqn, fqnType, false);
+ assertNotSame(key, someKey);
+
+ key = new ActionMapKey(fqn, fqnType, true);
+ someKey = new ActionMapKey(fqn, fqnType, new Boolean(false));
+ assertNotSame(key, someKey);
+ }
+
+ @Test
+ public void testHashMethod() {
+ ActionMapKey key;
+ ActionMapKey someKey;
+
+ key = new ActionMapKey(fqn, fqnType, false);
+ someKey = new ActionMapKey(fqn, fqnType, false);
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ key = new ActionMapKey(fqn, fqnType, new Boolean(false));
+ someKey = new ActionMapKey(fqn, fqnType, false);
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ key = new ActionMapKey(fqn, fqnType, true);
+ someKey = new ActionMapKey(fqn, fqnType, false);
+ assertNotSame(key.hashCode(), someKey.hashCode());
+
+ key = new ActionMapKey(fqn, fqnType, true);
+ someKey = new ActionMapKey(fqn, fqnType, new Boolean(false));
+ assertNotSame(key.hashCode(), someKey.hashCode());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java
new file mode 100644
index 0000000..00c8259
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCachingTest.java
@@ -0,0 +1,389 @@
+/*
+ * 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.commons.core.edm;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmServiceMetadata;
+import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmImpl;
+import org.junit.Before;
+import org.junit.Test;
+
+public class EdmImplCachingTest {
+
+ private final FullQualifiedName NAME1 = new FullQualifiedName("testNamespace1", "testName1");
+
+ private final FullQualifiedName NAME2 = new FullQualifiedName("testNamespace2", "testName2");
+
+ private Edm edm;
+
+ @Test
+ public void cacheEntityContainer() {
+ EdmEntityContainer entityContainer = edm.getEntityContainer(null);
+ assertNotNull(entityContainer);
+
+ EdmEntityContainer cachedContainer = edm.getEntityContainer(NAME1);
+ assertNotNull(entityContainer);
+
+ assertTrue(entityContainer == cachedContainer);
+ assertEquals(entityContainer, cachedContainer);
+
+ cachedContainer = edm.getEntityContainer(NAME1);
+ assertNotNull(cachedContainer);
+
+ assertTrue(entityContainer == cachedContainer);
+ assertEquals(entityContainer, cachedContainer);
+
+ EdmEntityContainer entityContainer2 = edm.getEntityContainer(NAME2);
+ assertNotNull(entityContainer2);
+
+ assertNotSame(entityContainer, entityContainer2);
+ }
+
+ @Test
+ public void cacheEnumType() {
+ EdmEnumType enumType = edm.getEnumType(NAME1);
+ assertNotNull(enumType);
+
+ EdmEnumType cachedType = edm.getEnumType(NAME1);
+ assertNotNull(cachedType);
+
+ assertTrue(enumType == cachedType);
+ assertEquals(enumType, cachedType);
+
+ EdmEnumType enumType2 = edm.getEnumType(NAME2);
+ assertNotNull(enumType2);
+
+ assertNotSame(enumType, enumType2);
+ }
+
+ @Test
+ public void cacheTypeDefinition() {
+ EdmTypeDefinition typeDefinition = edm.getTypeDefinition(NAME1);
+ assertNotNull(typeDefinition);
+
+ EdmTypeDefinition cachedDefinition = edm.getTypeDefinition(NAME1);
+ assertNotNull(cachedDefinition);
+
+ assertTrue(typeDefinition == cachedDefinition);
+ assertEquals(typeDefinition, cachedDefinition);
+
+ EdmTypeDefinition typeDefinition2 = edm.getTypeDefinition(NAME2);
+ assertNotNull(typeDefinition2);
+
+ assertNotSame(typeDefinition, typeDefinition2);
+ }
+
+ @Test
+ public void cacheEntityType() {
+ EdmEntityType entityType = edm.getEntityType(NAME1);
+ assertNotNull(entityType);
+
+ EdmEntityType cachedType = edm.getEntityType(NAME1);
+ assertNotNull(cachedType);
+
+ assertTrue(entityType == cachedType);
+ assertEquals(entityType, cachedType);
+
+ EdmEntityType entityType2 = edm.getEntityType(NAME2);
+ assertNotNull(entityType2);
+
+ assertNotSame(entityType, entityType2);
+ }
+
+ @Test
+ public void cacheComplexType() {
+ EdmComplexType complexType = edm.getComplexType(NAME1);
+ assertNotNull(complexType);
+
+ EdmComplexType cachedType = edm.getComplexType(NAME1);
+ assertNotNull(cachedType);
+
+ assertTrue(complexType == cachedType);
+ assertEquals(complexType, cachedType);
+
+ EdmComplexType complexType2 = edm.getComplexType(NAME2);
+ assertNotNull(complexType2);
+
+ assertNotSame(complexType, complexType2);
+ }
+
+ @Test
+ public void cacheUnboundAction() {
+ EdmAction action = edm.getAction(NAME1, null, null);
+ assertNotNull(action);
+
+ EdmAction cachedAction = edm.getAction(NAME1, null, null);
+ assertNotNull(cachedAction);
+
+ assertTrue(action == cachedAction);
+ assertEquals(action, cachedAction);
+
+ EdmAction action2 = edm.getAction(NAME2, null, false);
+ assertNotNull(action2);
+ assertNotSame(action, action2);
+ }
+
+ @Test
+ public void cacheBoundAction() {
+ EdmAction action = edm.getAction(NAME1, NAME2, true);
+ assertNotNull(action);
+
+ EdmAction cachedAction = edm.getAction(NAME1, NAME2, true);
+ assertNotNull(cachedAction);
+
+ assertTrue(action == cachedAction);
+ assertEquals(action, cachedAction);
+
+ EdmAction action2 = edm.getAction(NAME2, NAME2, true);
+ assertNotNull(action2);
+ assertNotSame(action, action2);
+
+ }
+
+ @Test
+ public void cacheUnboundFunctionNoParameters() {
+ EdmFunction function = edm.getFunction(NAME1, null, null, null);
+ assertNotNull(function);
+
+ EdmFunction cachedfunction = edm.getFunction(NAME1, null, null, null);
+ assertNotNull(cachedfunction);
+
+ assertTrue(function == cachedfunction);
+ assertEquals(function, cachedfunction);
+
+ EdmFunction function2 = edm.getFunction(NAME2, null, false, null);
+ assertNotNull(function2);
+
+ assertNotSame(function, function2);
+ }
+
+ @Test
+ public void cacheBoundFunction() {
+ EdmFunction function = edm.getFunction(NAME1, NAME2, true, new ArrayList<String>());
+ assertNotNull(function);
+
+ EdmFunction cachedfunction = edm.getFunction(NAME1, NAME2, true, new ArrayList<String>());
+ assertNotNull(cachedfunction);
+
+ assertTrue(function == cachedfunction);
+ assertEquals(function, cachedfunction);
+
+ EdmFunction function2 = edm.getFunction(NAME2, NAME2, true, new ArrayList<String>());
+ assertNotNull(function2);
+
+ assertNotSame(function, function2);
+ }
+
+ @Test
+ public void cacheUnboundFunctionWithParameters() {
+ ArrayList<String> parameters1 = new ArrayList<String>();
+ parameters1.add("A");
+ parameters1.add("B");
+ EdmFunction function = edm.getFunction(NAME1, NAME2, true, parameters1);
+ assertNotNull(function);
+
+ ArrayList<String> parameters2 = new ArrayList<String>();
+ parameters2.add("B");
+ parameters2.add("A");
+ EdmFunction cachedfunction = edm.getFunction(NAME1, NAME2, true, parameters2);
+ assertNotNull(cachedfunction);
+
+ assertTrue(function == cachedfunction);
+ assertEquals(function, cachedfunction);
+
+ EdmFunction function2 = edm.getFunction(NAME2, NAME2, true, new ArrayList<String>());
+ assertNotNull(function2);
+
+ assertNotSame(function, function2);
+ }
+
+ @Test
+ public void cacheServiceMetadata() {
+ EdmServiceMetadata serviceMetadata = edm.getServiceMetadata();
+ EdmServiceMetadata cachedMetadata = edm.getServiceMetadata();
+
+ assertTrue(serviceMetadata == cachedMetadata);
+ assertEquals(serviceMetadata, cachedMetadata);
+ }
+
+ @Before
+ public void setup() {
+ edm = new LocalEdm();
+ }
+
+ private class LocalEdm extends AbstractEdmImpl {
+
+ @Override
+ public EdmEntityContainer createEntityContainer(final FullQualifiedName fqn) {
+ if (NAME1.equals(fqn) || fqn == null) {
+ EdmEntityContainer container = mock(EdmEntityContainer.class);
+ when(container.getNamespace()).thenReturn(NAME1.getNamespace());
+ when(container.getName()).thenReturn(NAME1.getName());
+ return container;
+ } else if (NAME2.equals(fqn)) {
+ EdmEntityContainer container = mock(EdmEntityContainer.class);
+ when(container.getNamespace()).thenReturn(fqn.getNamespace());
+ when(container.getName()).thenReturn(fqn.getName());
+ return container;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmEnumType createEnumType(final FullQualifiedName fqn) {
+ if (NAME1.equals(fqn) || NAME2.equals(fqn)) {
+ EdmEnumType enumType = mock(EdmEnumType.class);
+ when(enumType.getNamespace()).thenReturn(fqn.getNamespace());
+ when(enumType.getName()).thenReturn(fqn.getName());
+ return enumType;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmTypeDefinition createTypeDefinition(final FullQualifiedName fqn) {
+ if (NAME1.equals(fqn) || NAME2.equals(fqn)) {
+ EdmTypeDefinition typeDefinition = mock(EdmTypeDefinition.class);
+ when(typeDefinition.getNamespace()).thenReturn(fqn.getNamespace());
+ when(typeDefinition.getName()).thenReturn(fqn.getName());
+ return typeDefinition;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmEntityType createEntityType(final FullQualifiedName fqn) {
+ if (NAME1.equals(fqn) || NAME2.equals(fqn)) {
+ EdmEntityType entityType = mock(EdmEntityType.class);
+ when(entityType.getNamespace()).thenReturn(fqn.getNamespace());
+ when(entityType.getName()).thenReturn(fqn.getName());
+ return entityType;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmComplexType createComplexType(final FullQualifiedName fqn) {
+ if (NAME1.equals(fqn) || NAME2.equals(fqn)) {
+ EdmComplexType complexType = mock(EdmComplexType.class);
+ when(complexType.getNamespace()).thenReturn(fqn.getNamespace());
+ when(complexType.getName()).thenReturn(fqn.getName());
+ return complexType;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmAction createBoundAction(final FullQualifiedName fqn, final FullQualifiedName bindingParameterTypeName,
+ final Boolean isBindingParameterCollection) {
+ if (NAME1.equals(fqn)) {
+ EdmAction action = mock(EdmAction.class);
+ when(action.getNamespace()).thenReturn(fqn.getNamespace());
+ when(action.getName()).thenReturn(fqn.getName());
+ return action;
+ } else if (NAME2.equals(fqn)) {
+ EdmAction action = mock(EdmAction.class);
+ when(action.getNamespace()).thenReturn(fqn.getNamespace());
+ when(action.getName()).thenReturn(fqn.getName());
+ return action;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmFunction createBoundFunction(final FullQualifiedName fqn,
+ final FullQualifiedName bindingParameterTypeName,
+ final Boolean isBindingParameterCollection, final List<String> bindingParameterNames) {
+ if (NAME1.equals(fqn)) {
+ EdmFunction function = mock(EdmFunction.class);
+ when(function.getNamespace()).thenReturn(fqn.getNamespace());
+ when(function.getName()).thenReturn(fqn.getName());
+ return function;
+ } else if (NAME2.equals(fqn)) {
+ EdmFunction function = mock(EdmFunction.class);
+ when(function.getNamespace()).thenReturn(fqn.getNamespace());
+ when(function.getName()).thenReturn(fqn.getName());
+ return function;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmServiceMetadata createServiceMetadata() {
+ return mock(EdmServiceMetadata.class);
+ }
+
+ @Override
+ protected Map<String, String> createAliasToNamespaceInfo() {
+ return new HashMap<String, String>();
+ }
+
+ @Override
+ protected EdmAction createUnboundAction(final FullQualifiedName fqn) {
+ if (NAME1.equals(fqn)) {
+ EdmAction action = mock(EdmAction.class);
+ when(action.getNamespace()).thenReturn(fqn.getNamespace());
+ when(action.getName()).thenReturn(fqn.getName());
+ return action;
+ } else if (NAME2.equals(fqn)) {
+ EdmAction action = mock(EdmAction.class);
+ when(action.getNamespace()).thenReturn(fqn.getNamespace());
+ when(action.getName()).thenReturn(fqn.getName());
+ return action;
+ }
+ return null;
+ }
+
+ @Override
+ protected EdmFunction createUnboundFunction(final FullQualifiedName fqn, final List<String> parameterNames) {
+ if (NAME1.equals(fqn)) {
+ EdmFunction function = mock(EdmFunction.class);
+ when(function.getNamespace()).thenReturn(fqn.getNamespace());
+ when(function.getName()).thenReturn(fqn.getName());
+ return function;
+ } else if (NAME2.equals(fqn)) {
+ EdmFunction function = mock(EdmFunction.class);
+ when(function.getNamespace()).thenReturn(fqn.getNamespace());
+ when(function.getName()).thenReturn(fqn.getName());
+ return function;
+ }
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCallCreateTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCallCreateTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCallCreateTest.java
new file mode 100644
index 0000000..c908419
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/EdmImplCallCreateTest.java
@@ -0,0 +1,268 @@
+/*
+ * 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.commons.core.edm;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmServiceMetadata;
+import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmImpl;
+import org.junit.Before;
+import org.junit.Test;
+
+public class EdmImplCallCreateTest {
+
+ private final FullQualifiedName FQN = new FullQualifiedName("testNamespace", "testName");
+
+ private final FullQualifiedName WRONG_FQN = new FullQualifiedName("wrong", "wrong");
+
+ private Edm edm;
+
+ @Test
+ public void callCreateEntityContainer() {
+ EdmEntityContainer entityContainer = edm.getEntityContainer(FQN);
+ assertNotNull(entityContainer);
+ assertEquals(FQN.getNamespace(), entityContainer.getNamespace());
+ assertEquals(FQN.getName(), entityContainer.getName());
+
+ entityContainer = edm.getEntityContainer(null);
+ assertNotNull(entityContainer);
+ assertEquals(FQN.getNamespace(), entityContainer.getNamespace());
+ assertEquals(FQN.getName(), entityContainer.getName());
+
+ assertNull(edm.getEntityContainer(WRONG_FQN));
+ }
+
+ @Test
+ public void callCreateEnumType() {
+ EdmEnumType enumType = edm.getEnumType(FQN);
+ assertNotNull(enumType);
+ assertEquals(FQN.getNamespace(), enumType.getNamespace());
+ assertEquals(FQN.getName(), enumType.getName());
+
+ assertNull(edm.getEnumType(WRONG_FQN));
+ }
+
+ @Test
+ public void callCreateTypeDefinition() {
+ EdmTypeDefinition typeDefinition = edm.getTypeDefinition(FQN);
+ assertNotNull(typeDefinition);
+ assertEquals(FQN.getNamespace(), typeDefinition.getNamespace());
+ assertEquals(FQN.getName(), typeDefinition.getName());
+
+ assertNull(edm.getTypeDefinition(WRONG_FQN));
+ }
+
+ @Test
+ public void callCreateEntityType() {
+ EdmEntityType entityType = edm.getEntityType(FQN);
+ assertNotNull(entityType);
+ assertEquals(FQN.getNamespace(), entityType.getNamespace());
+ assertEquals(FQN.getName(), entityType.getName());
+
+ assertNull(edm.getEntityType(WRONG_FQN));
+ }
+
+ @Test
+ public void callCreateComplexType() {
+ EdmComplexType complexType = edm.getComplexType(FQN);
+ assertNotNull(complexType);
+ assertEquals(FQN.getNamespace(), complexType.getNamespace());
+ assertEquals(FQN.getName(), complexType.getName());
+
+ assertNull(edm.getComplexType(WRONG_FQN));
+ }
+
+ @Test
+ public void callCreateAction() {
+ EdmAction action = edm.getAction(FQN, null, null);
+ assertNotNull(action);
+ assertEquals(FQN.getNamespace(), action.getNamespace());
+ assertEquals(FQN.getName(), action.getName());
+
+ EdmAction action2 = edm.getAction(FQN, FQN, true);
+ assertNotNull(action2);
+ assertEquals(FQN.getNamespace(), action2.getNamespace());
+ assertEquals(FQN.getName(), action2.getName());
+
+ assertNotSame(action, action2);
+
+ assertNull(edm.getAction(WRONG_FQN, null, null));
+ }
+
+ @Test
+ public void callCreateFunction() {
+ EdmFunction function = edm.getFunction(FQN, null, null, null);
+ assertNotNull(function);
+ assertEquals(FQN.getNamespace(), function.getNamespace());
+ assertEquals(FQN.getName(), function.getName());
+
+ EdmFunction function2 = edm.getFunction(FQN, FQN, true, new ArrayList<String>());
+ assertNotNull(function2);
+ assertEquals(FQN.getNamespace(), function2.getNamespace());
+ assertEquals(FQN.getName(), function2.getName());
+
+ assertNotSame(function, function2);
+
+ assertNull(edm.getFunction(WRONG_FQN, null, null, null));
+ }
+
+ @Test
+ public void callCreateServiceMetadata() {
+ assertNotNull(edm.getServiceMetadata());
+ }
+
+ @Before
+ public void setup() {
+ edm = new LocalEdm();
+ }
+
+ private class LocalEdm extends AbstractEdmImpl {
+
+ @Override
+ public EdmEntityContainer createEntityContainer(final FullQualifiedName fqn) {
+ if (fqn == null || FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
+ EdmEntityContainer container = mock(EdmEntityContainer.class);
+ when(container.getNamespace()).thenReturn(FQN.getNamespace());
+ when(container.getName()).thenReturn(FQN.getName());
+ return container;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmEnumType createEnumType(final FullQualifiedName fqn) {
+ if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
+ EdmEnumType enumType = mock(EdmEnumType.class);
+ when(enumType.getNamespace()).thenReturn(fqn.getNamespace());
+ when(enumType.getName()).thenReturn(fqn.getName());
+ return enumType;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmTypeDefinition createTypeDefinition(final FullQualifiedName fqn) {
+ if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
+ EdmTypeDefinition typeDefinition = mock(EdmTypeDefinition.class);
+ when(typeDefinition.getNamespace()).thenReturn(fqn.getNamespace());
+ when(typeDefinition.getName()).thenReturn(fqn.getName());
+ return typeDefinition;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmEntityType createEntityType(final FullQualifiedName fqn) {
+ if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
+ EdmEntityType entityType = mock(EdmEntityType.class);
+ when(entityType.getNamespace()).thenReturn(fqn.getNamespace());
+ when(entityType.getName()).thenReturn(fqn.getName());
+ return entityType;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmComplexType createComplexType(final FullQualifiedName fqn) {
+ if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
+ EdmComplexType complexType = mock(EdmComplexType.class);
+ when(complexType.getNamespace()).thenReturn(fqn.getNamespace());
+ when(complexType.getName()).thenReturn(fqn.getName());
+ return complexType;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmAction createBoundAction(final FullQualifiedName fqn, final FullQualifiedName bindingParameterTypeName,
+ final Boolean isBindingParameterCollection) {
+ if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
+ EdmAction action = mock(EdmAction.class);
+ when(action.getNamespace()).thenReturn(fqn.getNamespace());
+ when(action.getName()).thenReturn(fqn.getName());
+ return action;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmFunction createBoundFunction(final FullQualifiedName fqn,
+ final FullQualifiedName bindingParameterTypeName,
+ final Boolean isBindingParameterCollection, final List<String> bindingParameterNames) {
+ if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
+ EdmFunction function = mock(EdmFunction.class);
+ when(function.getNamespace()).thenReturn(fqn.getNamespace());
+ when(function.getName()).thenReturn(fqn.getName());
+ return function;
+ }
+ return null;
+ }
+
+ @Override
+ public EdmServiceMetadata createServiceMetadata() {
+ return mock(EdmServiceMetadata.class);
+ }
+
+ @Override
+ protected Map<String, String> createAliasToNamespaceInfo() {
+ return new HashMap<String, String>();
+ }
+
+ @Override
+ protected EdmAction createUnboundAction(final FullQualifiedName fqn) {
+ if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
+ EdmAction action = mock(EdmAction.class);
+ when(action.getNamespace()).thenReturn(fqn.getNamespace());
+ when(action.getName()).thenReturn(fqn.getName());
+ return action;
+ }
+ return null;
+ }
+
+ @Override
+ protected EdmFunction createUnboundFunction(final FullQualifiedName fqn, final List<String> parameterNames) {
+ if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
+ EdmFunction function = mock(EdmFunction.class);
+ when(function.getNamespace()).thenReturn(fqn.getNamespace());
+ when(function.getName()).thenReturn(fqn.getName());
+ return function;
+ }
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/FunctionMapKeyTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/FunctionMapKeyTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/FunctionMapKeyTest.java
new file mode 100644
index 0000000..7fe61cc
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/FunctionMapKeyTest.java
@@ -0,0 +1,252 @@
+/*
+ * 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.commons.core.edm;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.FunctionMapKey;
+import org.junit.Test;
+
+public class FunctionMapKeyTest {
+
+ private final FullQualifiedName fqn = new FullQualifiedName("namespace", "name");
+
+ private final FullQualifiedName fqnType = new FullQualifiedName("namespace2", "name2");
+
+ @Test
+ public void testEqualsPositive() {
+ FunctionMapKey key = new FunctionMapKey(fqn, null, null, null);
+ FunctionMapKey someKey = new FunctionMapKey(fqn, null, null, null);
+ assertEquals(key, someKey);
+
+ key = new FunctionMapKey(fqn, null, true, null);
+ someKey = new FunctionMapKey(fqn, null, true, null);
+ assertEquals(key, someKey);
+
+ key = new FunctionMapKey(fqn, fqnType, true, null);
+ someKey = new FunctionMapKey(fqn, fqnType, true, null);
+ assertEquals(key, someKey);
+
+ key = new FunctionMapKey(fqn, fqnType, false, null);
+ someKey = new FunctionMapKey(fqn, fqnType, false, null);
+ assertEquals(key, someKey);
+
+ key = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
+ someKey = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
+ assertEquals(key, someKey);
+
+ List<String> keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ List<String> someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee");
+ key = new FunctionMapKey(fqn, fqnType, false, keyList);
+ someKey = new FunctionMapKey(fqn, fqnType, false, someKeyList);
+ assertEquals(key, someKey);
+
+ key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ someKey = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ assertEquals(key, someKey);
+
+ keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee");
+ key = new FunctionMapKey(fqn, null, null, keyList);
+ someKey = new FunctionMapKey(fqn, null, null, someKeyList);
+ assertEquals(key, someKey);
+ }
+
+ @Test
+ public void testEqualsNegative() {
+ FunctionMapKey key = new FunctionMapKey(fqn, null, null, null);
+ FunctionMapKey someKey = new FunctionMapKey(fqn, null, true, null);
+ assertNotSame(key, someKey);
+
+ key = new FunctionMapKey(fqn, null, true, null);
+ someKey = new FunctionMapKey(fqn, null, false, null);
+ assertNotSame(key, someKey);
+
+ key = new FunctionMapKey(fqn, fqnType, true, null);
+ someKey = new FunctionMapKey(fqn, null, true, null);
+ assertNotSame(key, someKey);
+
+ key = new FunctionMapKey(fqn, null, false, null);
+ someKey = new FunctionMapKey(fqn, fqnType, true, null);
+ assertNotSame(key, someKey);
+
+ key = new FunctionMapKey(fqn, fqnType, false, null);
+ someKey = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
+ assertNotSame(key, someKey);
+
+ List<String> keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ List<String> someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee2");
+ key = new FunctionMapKey(fqn, fqnType, false, keyList);
+ someKey = new FunctionMapKey(fqn, fqnType, false, someKeyList);
+ assertNotSame(key, someKey);
+
+ key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ someKey = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ assertNotSame(key, someKey);
+
+ keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee2");
+ key = new FunctionMapKey(fqn, null, null, keyList);
+ someKey = new FunctionMapKey(fqn, null, null, someKeyList);
+ assertNotSame(key, someKey);
+
+ key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ someKey = new FunctionMapKey(fqn, null, null, null);
+ assertNotSame(key, someKey);
+
+ keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ someKeyList = new ArrayList<String>();
+ key = new FunctionMapKey(fqn, null, null, keyList);
+ someKey = new FunctionMapKey(fqn, null, null, someKeyList);
+ assertNotSame(key, someKey);
+
+ keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ someKeyList = new ArrayList<String>();
+ someKeyList.add("EmpLoYeE");
+ key = new FunctionMapKey(fqn, null, null, keyList);
+ someKey = new FunctionMapKey(fqn, null, null, someKeyList);
+ assertNotSame(key, someKey);
+ }
+
+ @Test
+ public void testHashCodePositive() {
+ FunctionMapKey key = new FunctionMapKey(fqn, null, null, null);
+ FunctionMapKey someKey = new FunctionMapKey(fqn, null, null, null);
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, null, true, null);
+ someKey = new FunctionMapKey(fqn, null, true, null);
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, fqnType, true, null);
+ someKey = new FunctionMapKey(fqn, fqnType, true, null);
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, fqnType, false, null);
+ someKey = new FunctionMapKey(fqn, fqnType, false, null);
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
+ someKey = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ List<String> keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ List<String> someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee");
+ key = new FunctionMapKey(fqn, fqnType, false, keyList);
+ someKey = new FunctionMapKey(fqn, fqnType, false, someKeyList);
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ someKey = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee");
+ key = new FunctionMapKey(fqn, null, null, keyList);
+ someKey = new FunctionMapKey(fqn, null, null, someKeyList);
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ keyList.add("employee");
+ someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee");
+ someKeyList.add("employee");
+ key = new FunctionMapKey(fqn, null, null, keyList);
+ someKey = new FunctionMapKey(fqn, null, null, someKeyList);
+ assertEquals(key.hashCode(), someKey.hashCode());
+
+ keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ keyList.add("Employee2");
+ someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee2");
+ someKeyList.add("Employee");
+ key = new FunctionMapKey(fqn, null, null, keyList);
+ someKey = new FunctionMapKey(fqn, null, null, someKeyList);
+ assertEquals(key.hashCode(), someKey.hashCode());
+ }
+
+ @Test
+ public void testHashCodeNegative() {
+ FunctionMapKey key = new FunctionMapKey(fqn, null, null, null);
+ FunctionMapKey someKey = new FunctionMapKey(fqn, null, true, null);
+ assertNotSame(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, null, true, null);
+ someKey = new FunctionMapKey(fqn, null, false, null);
+ assertNotSame(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, fqnType, true, null);
+ someKey = new FunctionMapKey(fqn, null, true, null);
+ assertNotSame(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, null, false, null);
+ someKey = new FunctionMapKey(fqn, fqnType, true, null);
+ assertNotSame(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, fqnType, false, null);
+ someKey = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
+ assertNotSame(key.hashCode(), someKey.hashCode());
+
+ List<String> keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ List<String> someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee2");
+ key = new FunctionMapKey(fqn, fqnType, false, keyList);
+ someKey = new FunctionMapKey(fqn, fqnType, false, someKeyList);
+ assertNotSame(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ someKey = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ assertNotSame(key.hashCode(), someKey.hashCode());
+
+ keyList = new ArrayList<String>();
+ keyList.add("Employee");
+ someKeyList = new ArrayList<String>();
+ someKeyList.add("Employee2");
+ key = new FunctionMapKey(fqn, null, null, keyList);
+ someKey = new FunctionMapKey(fqn, null, null, someKeyList);
+ assertNotSame(key.hashCode(), someKey.hashCode());
+
+ key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
+ someKey = new FunctionMapKey(fqn, null, null, null);
+ assertNotSame(key.hashCode(), someKey.hashCode());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/CommonPrimitiveTypeTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/CommonPrimitiveTypeTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/CommonPrimitiveTypeTest.java
new file mode 100644
index 0000000..18b0dc6
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/CommonPrimitiveTypeTest.java
@@ -0,0 +1,175 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.UUID;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmNull;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class CommonPrimitiveTypeTest extends PrimitiveTypeBaseTest {
+
+ @Test
+ public void nameSpace() throws Exception {
+ assertEquals(EdmPrimitiveType.SYSTEM_NAMESPACE, Uint7.getInstance().getNamespace());
+
+ assertEquals(EdmPrimitiveType.EDM_NAMESPACE, EdmNull.getInstance().getNamespace());
+ for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
+ final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
+ assertEquals(EdmPrimitiveType.EDM_NAMESPACE, instance.getNamespace());
+ }
+ }
+
+ @Test
+ public void names() throws Exception {
+ assertEquals("Uint7", Uint7.getInstance().getName());
+
+ assertEquals("Null", EdmNull.getInstance().getName());
+ assertEquals("Binary", EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Boolean", EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Byte", EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Date", EdmPrimitiveTypeKind.Date.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("DateTimeOffset", EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Decimal", EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Double", EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Duration", EdmPrimitiveTypeKind.Duration.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Guid", EdmPrimitiveTypeKind.Guid.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Int16", EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Int32", EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Int64", EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("SByte", EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("Single", EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("String", EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance().getName());
+ assertEquals("TimeOfDay", EdmPrimitiveTypeKind.TimeOfDay.getEdmPrimitiveTypeInstance().getName());
+ }
+
+ @Test
+ public void kind() throws Exception {
+ for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
+ assertEquals(EdmTypeKind.PRIMITIVE, kind.getEdmPrimitiveTypeInstance().getKind());
+ }
+ }
+
+ @Test
+ public void toStringAll() throws Exception {
+ assertEquals("System.Uint7", Uint7.getInstance().toString());
+
+ assertEquals("Edm.Null", EdmNull.getInstance().toString());
+ assertEquals("Edm.Binary", EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Boolean", EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Byte", EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Date", EdmPrimitiveTypeKind.Date.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.DateTimeOffset", EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Decimal", EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Double", EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Duration", EdmPrimitiveTypeKind.Duration.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Guid", EdmPrimitiveTypeKind.Guid.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Int16", EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Int32", EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Int64", EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.SByte", EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.Single", EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.String", EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance().toString());
+ assertEquals("Edm.TimeOfDay", EdmPrimitiveTypeKind.TimeOfDay.getEdmPrimitiveTypeInstance().toString());
+
+ for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
+ final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
+ assertEquals(instance.toString(), kind.getFullQualifiedName().toString());
+ }
+ }
+
+ @Test
+ public void compatibility() {
+ for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
+ final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
+ assertTrue(instance.isCompatible(instance));
+ assertFalse(instance.isCompatible(
+ (kind == EdmPrimitiveTypeKind.String ? EdmPrimitiveTypeKind.Binary : EdmPrimitiveTypeKind.String)
+ .getEdmPrimitiveTypeInstance()));
+ }
+ }
+
+ @Test
+ public void defaultType() throws Exception {
+ assertEquals(Byte.class, Uint7.getInstance().getDefaultType());
+ assertNull(EdmNull.getInstance().getDefaultType());
+
+ assertEquals(byte[].class, EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Boolean.class, EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Short.class, EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Calendar.class, EdmPrimitiveTypeKind.Date.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Calendar.class, EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(BigDecimal.class, EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Double.class, EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(BigDecimal.class, EdmPrimitiveTypeKind.Duration.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(UUID.class, EdmPrimitiveTypeKind.Guid.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Short.class, EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Integer.class, EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Long.class, EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Byte.class, EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Float.class, EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(String.class, EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance().getDefaultType());
+ assertEquals(Calendar.class, EdmPrimitiveTypeKind.TimeOfDay.getEdmPrimitiveTypeInstance().getDefaultType());
+ }
+
+ @Test
+ public void validate() throws Exception {
+ for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
+ final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
+ assertTrue(instance.validate(null, null, null, null, null, null));
+ assertTrue(instance.validate(null, true, null, null, null, null));
+ assertFalse(instance.validate(null, false, null, null, null, null));
+ assertFalse(instance.validate("ä", null, null, null, null, false));
+ if (kind != EdmPrimitiveTypeKind.String && kind != EdmPrimitiveTypeKind.Binary) {
+ assertFalse(instance.validate("", null, null, null, null, null));
+ }
+ if (kind != EdmPrimitiveTypeKind.String) {
+ assertFalse(instance.validate("ä", null, null, null, null, null));
+ }
+ }
+
+ assertTrue(EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().validate("abcd", null, 3, null, null, null));
+ assertFalse(EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().validate("abcd", null, 2, null, null, null));
+
+ assertTrue(EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().validate("1", null, null, null, null,
+ null));
+ assertFalse(EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().validate("1.2", null, null, null, 0, null));
+ }
+
+ @Test
+ public void uriLiteral() throws Exception {
+ for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
+ final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
+ assertEquals("test", instance.fromUriLiteral(instance.toUriLiteral("test")));
+ assertNull(instance.toUriLiteral(null));
+ assertNull(instance.fromUriLiteral(null));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinaryTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinaryTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinaryTest.java
new file mode 100644
index 0000000..39fd38c
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinaryTest.java
@@ -0,0 +1,106 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class EdmBinaryTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void validate() throws Exception {
+ assertTrue(instance.validate(null, null, null, null, null, null));
+ assertTrue(instance.validate(null, true, null, null, null, null));
+ assertFalse(instance.validate(null, false, null, null, null, null));
+ assertTrue(instance.validate("", null, null, null, null, null));
+ assertFalse(instance.validate("????", null, null, null, null, null));
+
+ assertTrue(instance.validate("qrvM3e7_", null, null, null, null, null));
+ assertTrue(instance.validate("qrvM3e7_", null, 6, null, null, null));
+ assertFalse(instance.validate("qrvM3e7_", null, 5, null, null, null));
+ }
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("binary'+hKqoQ=='", instance.toUriLiteral("+hKqoQ=="));
+ assertEquals("binary''", instance.toUriLiteral(""));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("+hKqoQ==", instance.fromUriLiteral("binary'+hKqoQ=='"));
+ assertEquals("", instance.fromUriLiteral("binary''"));
+
+ expectErrorInFromUriLiteral(instance, "");
+ expectErrorInFromUriLiteral(instance, "binary'\"");
+ expectErrorInFromUriLiteral(instance, "X''");
+ expectErrorInFromUriLiteral(instance, "Xinary''");
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ final byte[] binary = new byte[] { (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF };
+
+ assertEquals("qrvM3e7_", instance.valueToString(binary, null, null, null, null, null));
+
+ assertEquals("qrvM3e7_", instance.valueToString(binary, null, 6, null, null, null));
+ assertEquals("qrvM3e7_", instance.valueToString(binary, null, Integer.MAX_VALUE, null, null, null));
+
+ assertEquals("qg", instance.valueToString(new Byte[] { new Byte((byte) 170) }, null, null, null, null, null));
+
+ expectFacetsErrorInValueToString(instance, binary, null, 3, null, null, null);
+
+ expectTypeErrorInValueToString(instance, 0);
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ final byte[] binary = new byte[] { (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF };
+
+ assertTrue(Arrays.equals(binary, instance.valueOfString("qrvM3e7_", null, null, null, null, null, byte[].class)));
+ assertTrue(Arrays.equals(new Byte[] { binary[0], binary[1], binary[2] }, instance.valueOfString("qrvM", null, null,
+ null, null, null, Byte[].class)));
+
+ assertTrue(Arrays.equals(binary, instance.valueOfString("qrvM3e7_", null, 6, null, null, null, byte[].class)));
+ assertTrue(Arrays.equals(new byte[] { 42 }, instance.valueOfString("Kg==", null, 1, null, null, null,
+ byte[].class)));
+ assertTrue(Arrays.equals(new byte[] { 42 }, instance.valueOfString("Kg", null, 1, null, null, null,
+ byte[].class)));
+ assertTrue(Arrays.equals(new byte[] { 1, 2 }, instance.valueOfString("AQI=", null, 2, null, null, null,
+ byte[].class)));
+ assertTrue(Arrays.equals(binary, instance.valueOfString("qrvM3e7_", null, 6, null, null, null,
+ byte[].class)));
+ assertTrue(Arrays.equals(binary, instance.valueOfString("qrvM3e7_", null, Integer.MAX_VALUE, null, null, null,
+ byte[].class)));
+
+ expectFacetsErrorInValueOfString(instance, "qrvM3e7_", null, 3, null, null, null);
+ expectContentErrorInValueOfString(instance, "@");
+
+ expectTypeErrorInValueOfString(instance, "qrvM3e7_");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBooleanTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBooleanTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBooleanTest.java
new file mode 100644
index 0000000..1abca66
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBooleanTest.java
@@ -0,0 +1,64 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class EdmBooleanTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("true", instance.toUriLiteral("true"));
+ assertEquals("false", instance.toUriLiteral("false"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("true", instance.fromUriLiteral("true"));
+ assertEquals("false", instance.fromUriLiteral("false"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("true", instance.valueToString(true, null, null, null, null, null));
+ assertEquals("false", instance.valueToString(Boolean.FALSE, null, null, null, null, null));
+
+ expectTypeErrorInValueToString(instance, 0);
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(true, instance.valueOfString("true", null, null, null, null, null, Boolean.class));
+ assertEquals(false, instance.valueOfString("false", null, null, null, null, null, Boolean.class));
+
+ expectContentErrorInValueOfString(instance, "True");
+ expectContentErrorInValueOfString(instance, "1");
+ expectContentErrorInValueOfString(instance, "0");
+ expectContentErrorInValueOfString(instance, "-1");
+ expectContentErrorInValueOfString(instance, "FALSE");
+
+ expectTypeErrorInValueOfString(instance, "true");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByteTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByteTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByteTest.java
new file mode 100644
index 0000000..ddf819f
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByteTest.java
@@ -0,0 +1,86 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class EdmByteTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void compatibility() {
+ assertTrue(instance.isCompatible(Uint7.getInstance()));
+ }
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("127", instance.toUriLiteral("127"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("127", instance.fromUriLiteral("127"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("0", instance.valueToString(0, null, null, null, null, null));
+ assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
+ assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
+ assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
+ assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
+ assertEquals("255", instance.valueToString(BigInteger.valueOf(255), null, null, null, null, null));
+
+ expectContentErrorInValueToString(instance, -1);
+ expectContentErrorInValueToString(instance, 256);
+ expectContentErrorInValueToString(instance, BigInteger.valueOf(-1));
+ expectContentErrorInValueToString(instance, BigInteger.valueOf(256));
+
+ expectTypeErrorInValueToString(instance, 'A');
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(Short.valueOf((short) 1), instance.valueOfString("1", null, null, null, null, null, Short.class));
+ assertEquals(Integer.valueOf(2), instance.valueOfString("2", null, null, null, null, null, Integer.class));
+ assertEquals(Byte.valueOf((byte) 127), instance.valueOfString("127", null, null, null, null, null, Byte.class));
+ assertEquals(Short.valueOf((short) 255), instance.valueOfString("255", null, null, null, null, null, Short.class));
+ assertEquals(Long.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Long.class));
+ assertEquals(BigInteger.TEN, instance.valueOfString("10", null, null, null, null, null, BigInteger.class));
+
+ expectContentErrorInValueOfString(instance, "0x42");
+ expectContentErrorInValueOfString(instance, "abc");
+ expectContentErrorInValueOfString(instance, "256");
+ expectContentErrorInValueOfString(instance, "-1");
+ expectContentErrorInValueOfString(instance, "1.0");
+
+ expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
+
+ expectTypeErrorInValueOfString(instance, "1");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTest.java
new file mode 100644
index 0000000..3d966bc
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTest.java
@@ -0,0 +1,93 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class EdmDateTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Date.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("2009-12-26", instance.toUriLiteral("2009-12-26"));
+ assertEquals("-2009-12-26", instance.toUriLiteral("-2009-12-26"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("2009-12-26", instance.fromUriLiteral("2009-12-26"));
+ assertEquals("-2009-12-26", instance.fromUriLiteral("-2009-12-26"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ Calendar dateTime = Calendar.getInstance();
+ dateTime.clear();
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT-11:30"));
+ dateTime.set(2012, 1, 29, 13, 0, 0);
+ assertEquals("2012-02-29", instance.valueToString(dateTime, null, null, null, null, null));
+
+ final Long millis = 1330558323007L;
+ assertEquals("2012-02-29", instance.valueToString(millis, null, null, null, null, null));
+
+ assertEquals("1969-12-31", instance.valueToString(new Date(-43200000), null, null, null, null, null));
+
+ dateTime.set(Calendar.YEAR, 12344);
+ assertEquals("12344-02-29", instance.valueToString(dateTime, null, null, null, null, null));
+
+ expectTypeErrorInValueToString(instance, 0);
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ Calendar dateTime = Calendar.getInstance();
+ dateTime.clear();
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
+ dateTime.set(2012, 1, 29);
+ assertEquals(dateTime, instance.valueOfString("2012-02-29", null, null, null, null, null, Calendar.class));
+ assertEquals(Long.valueOf(dateTime.getTimeInMillis()), instance.valueOfString("2012-02-29", null, null, null, null,
+ null, Long.class));
+ assertEquals(dateTime.getTime(), instance.valueOfString("2012-02-29", null, null, null, null, null, Date.class));
+
+ dateTime.set(Calendar.YEAR, 12344);
+ assertEquals(dateTime, instance.valueOfString("12344-02-29", null, null, null, null, null, Calendar.class));
+
+ // TODO: Clarify whether negative years are really needed.
+ // dateTime.set(-1, 1, 28);
+ // assertEquals(dateTime, instance.valueOfString("-0001-02-28", null, Calendar.class));
+
+ expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02");
+ expectContentErrorInValueOfString(instance, "2012-02-30");
+ expectContentErrorInValueOfString(instance, "20120229");
+ expectContentErrorInValueOfString(instance, "2012-02-1");
+ expectContentErrorInValueOfString(instance, "2012-2-12");
+ expectContentErrorInValueOfString(instance, "123-02-03");
+
+ expectTypeErrorInValueOfString(instance, "2012-02-29");
+ }
+}
[27/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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/edm/xml/v4/annotation/CollectionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CollectionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
deleted file mode 100644
index 20b0f56..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
+++ /dev/null
@@ -1,50 +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.edm.xml.v4.annotation;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class CollectionDeserializer extends AbstractEdmDeserializer<Collection> {
-
- @Override
- protected Collection doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final Collection collection = new Collection();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if (isAnnotationConstExprConstruct(jp)) {
- collection.getItems().add(parseAnnotationConstExprConstruct(jp));
- } else {
- collection.getItems().add(jp.readValueAs( DynExprConstructImpl.class));
- }
- }
- }
-
- return collection;
- }
-
-}
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/edm/xml/v4/annotation/ConstExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java
deleted file mode 100644
index d701d06..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ConstExprConstruct;
-
-public class ConstExprConstructImpl extends ExprConstructImpl implements ConstExprConstruct {
-
- private static final long serialVersionUID = 2250072064504668969L;
-
- private Type type;
-
- private String value;
-
- @Override
- public Type getType() {
- return type;
- }
-
- @Override
- public void setType(final Type type) {
- this.type = type;
- }
-
- @Override
- public String getValue() {
- return value;
- }
-
- @Override
- public void setValue(final String value) {
- this.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/edm/xml/v4/annotation/DynExprConstructDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
deleted file mode 100644
index e881c39..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.core.JsonLocation;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.ClassUtils;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class DynExprConstructDeserializer extends AbstractEdmDeserializer<DynExprConstructImpl> {
-
- private static final String[] EL_OR_ATTR = { AnnotationPath.class.getSimpleName(), Path.class.getSimpleName() };
-
- private static final String APPLY = Apply.class.getSimpleName();
-
- private static final String CAST = Cast.class.getSimpleName();
-
- private static final String COLLECTION = Collection.class.getSimpleName();
-
- private static final String IF = If.class.getSimpleName();
-
- private static final String IS_OF = IsOf.class.getSimpleName();
-
- private static final String LABELED_ELEMENT = LabeledElement.class.getSimpleName();
-
- private static final String NULL = Null.class.getSimpleName();
-
- private static final String RECORD = Record.class.getSimpleName();
-
- private static final String URL_REF = UrlRef.class.getSimpleName();
-
- private AbstractElOrAttrConstruct getElOrAttrInstance(final String simpleClassName) throws JsonParseException {
- try {
- @SuppressWarnings("unchecked")
- Class<? extends AbstractElOrAttrConstruct> elOrAttrClass =
- (Class<? extends AbstractElOrAttrConstruct>) ClassUtils.getClass(
- getClass().getPackage().getName() + "." + simpleClassName);
- return elOrAttrClass.newInstance();
- } catch (Exception e) {
- throw new JsonParseException("Could not instantiate " + simpleClassName, JsonLocation.NA, e);
- }
- }
-
- private ExprConstructImpl parseConstOrEnumExprConstruct(final JsonParser jp) throws IOException {
- ExprConstructImpl result;
- if (isAnnotationConstExprConstruct(jp)) {
- result = parseAnnotationConstExprConstruct(jp);
- } else {
- result = jp.readValueAs( DynExprConstructImpl.class);
- }
- jp.nextToken();
-
- return result;
- }
-
- @Override
- protected DynExprConstructImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- DynExprConstructImpl construct = null;
-
- if (DynExprSingleParamOp.Type.fromString(jp.getCurrentName()) != null) {
- final DynExprSingleParamOp dynExprSingleParamOp = new DynExprSingleParamOp();
- dynExprSingleParamOp.setType(DynExprSingleParamOp.Type.fromString(jp.getCurrentName()));
-
- jp.nextToken();
- jp.nextToken();
- dynExprSingleParamOp.setExpression(jp.readValueAs( DynExprConstructImpl.class));
-
- construct = dynExprSingleParamOp;
- } else if (DynExprDoubleParamOp.Type.fromString(jp.getCurrentName()) != null) {
- final DynExprDoubleParamOp dynExprDoubleParamOp = new DynExprDoubleParamOp();
- dynExprDoubleParamOp.setType(DynExprDoubleParamOp.Type.fromString(jp.getCurrentName()));
-
- jp.nextToken();
- jp.nextToken();
- dynExprDoubleParamOp.setLeft(jp.readValueAs( DynExprConstructImpl.class));
- dynExprDoubleParamOp.setRight(jp.readValueAs( DynExprConstructImpl.class));
-
- construct = dynExprDoubleParamOp;
- } else if (ArrayUtils.contains(EL_OR_ATTR, jp.getCurrentName())) {
- final AbstractElOrAttrConstruct elOrAttr = getElOrAttrInstance(jp.getCurrentName());
- elOrAttr.setValue(jp.nextTextValue());
-
- construct = elOrAttr;
- } else if (APPLY.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Apply.class);
- } else if (CAST.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Cast.class);
- } else if (COLLECTION.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Collection.class);
- } else if (IF.equals(jp.getCurrentName())) {
- jp.nextToken();
- jp.nextToken();
-
- final If _if = new If();
- _if.setGuard(parseConstOrEnumExprConstruct(jp));
- _if.setThen(parseConstOrEnumExprConstruct(jp));
- _if.setElse(parseConstOrEnumExprConstruct(jp));
-
- construct = _if;
- } else if (IS_OF.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( IsOf.class);
- } else if (LABELED_ELEMENT.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( LabeledElement.class);
- } else if (NULL.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Null.class);
- } else if (RECORD.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Record.class);
- } else if (URL_REF.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( UrlRef.class);
- }
-
- return construct;
- }
-}
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/edm/xml/v4/annotation/DynExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java
deleted file mode 100644
index 862b322..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java
+++ /dev/null
@@ -1,29 +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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-@JsonDeserialize(using = DynExprConstructDeserializer.class)
-public abstract class DynExprConstructImpl extends ExprConstructImpl implements DynExprConstruct {
-
- private static final long serialVersionUID = -642012862023177349L;
-
-}
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/edm/xml/v4/annotation/DynExprDoubleParamOp.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java
deleted file mode 100644
index 6fd83d3..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java
+++ /dev/null
@@ -1,73 +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.edm.xml.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-public class DynExprDoubleParamOp extends DynExprConstructImpl {
-
- private static final long serialVersionUID = -7974475975925167731L;
-
- public static enum Type {
-
- And,
- Or;
-
- public static Type fromString(final String value) {
- Type result = null;
- for (Type type : values()) {
- if (value.equals(type.name())) {
- result = type;
- }
- }
- return result;
- }
- }
-
- private Type type;
-
- private DynExprConstruct left;
-
- private DynExprConstruct right;
-
- public Type getType() {
- return type;
- }
-
- public void setType(final Type type) {
- this.type = type;
- }
-
- public DynExprConstruct getLeft() {
- return left;
- }
-
- public void setLeft(final DynExprConstruct left) {
- this.left = left;
- }
-
- public DynExprConstruct getRight() {
- return right;
- }
-
- public void setRight(final DynExprConstruct right) {
- this.right = right;
- }
-
-}
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/edm/xml/v4/annotation/DynExprSingleParamOp.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java
deleted file mode 100644
index 7fc34e2..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java
+++ /dev/null
@@ -1,69 +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.edm.xml.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-public class DynExprSingleParamOp extends DynExprConstructImpl {
-
- private static final long serialVersionUID = -7974475975925167731L;
-
- public static enum Type {
-
- Not,
- Eq,
- Ne,
- Gt,
- Ge,
- Lt,
- Le;
-
- public static Type fromString(final String value) {
- Type result = null;
- for (Type type : values()) {
- if (value.equals(type.name())) {
- result = type;
- }
- }
- return result;
- }
-
- }
-
- private Type type;
-
- private DynExprConstruct expression;
-
- public Type getType() {
- return type;
- }
-
- public void setType(final Type type) {
- this.type = type;
- }
-
- public DynExprConstruct getExpression() {
- return expression;
- }
-
- public void setExpression(final DynExprConstruct expression) {
- this.expression = expression;
- }
-
-}
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/edm/xml/v4/annotation/ExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ExprConstructImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ExprConstructImpl.java
deleted file mode 100644
index 960c730..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ExprConstructImpl.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.edm.xml.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public abstract class ExprConstructImpl extends AbstractEdmItem implements ExprConstruct {
-
- private static final long serialVersionUID = 7108626008005050492L;
-
-}
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/edm/xml/v4/annotation/If.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/If.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/If.java
deleted file mode 100644
index e6ea91d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/If.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.edm.xml.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-
-public class If extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = 6752952406406218936L;
-
- private ExprConstruct guard;
-
- private ExprConstruct _then;
-
- private ExprConstruct _else;
-
- public ExprConstruct getGuard() {
- return guard;
- }
-
- public void setGuard(final ExprConstruct guard) {
- this.guard = guard;
- }
-
- public ExprConstruct getThen() {
- return _then;
- }
-
- public void setThen(final ExprConstruct _then) {
- this._then = _then;
- }
-
- public ExprConstruct getElse() {
- return _else;
- }
-
- public void setElse(final ExprConstruct _else) {
- this._else = _else;
- }
-
-}
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/edm/xml/v4/annotation/IsOf.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOf.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOf.java
deleted file mode 100644
index d327964..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOf.java
+++ /dev/null
@@ -1,90 +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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.math.BigInteger;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-@JsonDeserialize(using = IsOfDeserializer.class)
-public class IsOf extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = 6958304670385303776L;
-
- private String type;
-
- private String maxLength;
-
- private BigInteger precision;
-
- private BigInteger scale;
-
- private String srid;
-
- private DynExprConstruct value;
-
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- public String getMaxLength() {
- return maxLength;
- }
-
- public void setMaxLength(final String maxLength) {
- this.maxLength = maxLength;
- }
-
- public BigInteger getPrecision() {
- return precision;
- }
-
- public void setPrecision(final BigInteger precision) {
- this.precision = precision;
- }
-
- public BigInteger getScale() {
- return scale;
- }
-
- public void setScale(final BigInteger scale) {
- this.scale = scale;
- }
-
- public String getSrid() {
- return srid;
- }
-
- public void setSrid(final String srid) {
- this.srid = srid;
- }
-
- public DynExprConstruct getValue() {
- return value;
- }
-
- public void setValue(final DynExprConstruct value) {
- this.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/edm/xml/v4/annotation/IsOfDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOfDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
deleted file mode 100644
index 283997e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
+++ /dev/null
@@ -1,62 +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.edm.xml.v4.annotation;
-
-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 java.io.IOException;
-import java.math.BigInteger;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class IsOfDeserializer extends AbstractEdmDeserializer<IsOf> {
-
- @Override
- protected IsOf doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final IsOf isof = new IsOf();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Type".equals(jp.getCurrentName())) {
- isof.setType(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- isof.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- isof.setMaxLength(jp.nextTextValue());
- } else if ("Precision".equals(jp.getCurrentName())) {
- isof.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L)));
- } else if ("Scale".equals(jp.getCurrentName())) {
- isof.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
- } else if ("SRID".equals(jp.getCurrentName())) {
- isof.setSrid(jp.nextTextValue());
- } else {
- isof.setValue(jp.readValueAs(DynExprConstructImpl.class));
- }
- }
- }
-
- return isof;
- }
-
-}
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/edm/xml/v4/annotation/LabeledElement.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElement.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElement.java
deleted file mode 100644
index 15321d2..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElement.java
+++ /dev/null
@@ -1,49 +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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-@JsonDeserialize(using = LabeledElementDeserializer.class)
-public class LabeledElement extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = 6938971787086282939L;
-
- private String name;
-
- private DynExprConstruct value;
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public DynExprConstruct getValue() {
- return value;
- }
-
- public void setValue(final DynExprConstruct value) {
- this.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/edm/xml/v4/annotation/LabeledElementDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
deleted file mode 100644
index 440b08b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.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.edm.xml.v4.annotation;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class LabeledElementDeserializer extends AbstractEdmDeserializer<LabeledElement> {
-
- @Override
- protected LabeledElement doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final LabeledElement element = new LabeledElement();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- element.setName(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- element.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else {
- element.setValue(jp.readValueAs(DynExprConstructImpl.class));
- }
- }
- }
-
- return element;
- }
-
-}
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/edm/xml/v4/annotation/LabeledElementReference.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementReference.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementReference.java
deleted file mode 100644
index e24a04e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementReference.java
+++ /dev/null
@@ -1,25 +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.edm.xml.v4.annotation;
-
-public class LabeledElementReference extends AbstractElOrAttrConstruct {
-
- private static final long serialVersionUID = 3649068436729494270L;
-
-}
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/edm/xml/v4/annotation/NavigationPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/NavigationPropertyPath.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/NavigationPropertyPath.java
deleted file mode 100644
index c3685f4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/NavigationPropertyPath.java
+++ /dev/null
@@ -1,25 +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.edm.xml.v4.annotation;
-
-public class NavigationPropertyPath extends AbstractElOrAttrConstruct {
-
- private static final long serialVersionUID = -8066400142504963043L;
-
-}
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/edm/xml/v4/annotation/Null.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Null.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Null.java
deleted file mode 100644
index 419413b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Null.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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = NullDeserializer.class)
-public class Null extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = -3611384710172781951L;
-
-}
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/edm/xml/v4/annotation/NullDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/NullDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/NullDeserializer.java
deleted file mode 100644
index dc78b6a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/NullDeserializer.java
+++ /dev/null
@@ -1,49 +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.edm.xml.v4.annotation;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class NullDeserializer extends AbstractEdmDeserializer<Null> {
-
- @Override
- protected Null doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final Null _null = new Null();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Annotation".equals(jp.getCurrentName())) {
- _null.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return _null;
- }
-
-}
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/edm/xml/v4/annotation/Path.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Path.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Path.java
deleted file mode 100644
index a5e4f9f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Path.java
+++ /dev/null
@@ -1,25 +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.edm.xml.v4.annotation;
-
-public class Path extends AbstractElOrAttrConstruct {
-
- private static final long serialVersionUID = -2551058493469292082L;
-
-}
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/edm/xml/v4/annotation/PropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/PropertyPath.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/PropertyPath.java
deleted file mode 100644
index df924fe..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/PropertyPath.java
+++ /dev/null
@@ -1,25 +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.edm.xml.v4.annotation;
-
-public class PropertyPath extends AbstractElOrAttrConstruct {
-
- private static final long serialVersionUID = 2328584735437885159L;
-
-}
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/edm/xml/v4/annotation/PropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/PropertyValue.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/PropertyValue.java
deleted file mode 100644
index 6afb0d4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/PropertyValue.java
+++ /dev/null
@@ -1,49 +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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-
-@JsonDeserialize(using = PropertyValueDeserializer.class)
-public class PropertyValue extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = 3081968466425707461L;
-
- private String property;
-
- private ExprConstruct value;
-
- public String getProperty() {
- return property;
- }
-
- public void setProperty(final String property) {
- this.property = property;
- }
-
- public ExprConstruct getValue() {
- return value;
- }
-
- public void setValue(final ExprConstruct value) {
- this.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/edm/xml/v4/annotation/PropertyValueDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java
deleted file mode 100644
index 0871e55..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java
+++ /dev/null
@@ -1,55 +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.edm.xml.v4.annotation;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class PropertyValueDeserializer extends AbstractEdmDeserializer<PropertyValue> {
-
- @Override
- protected PropertyValue doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final PropertyValue propValue = new PropertyValue();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Property".equals(jp.getCurrentName())) {
- propValue.setProperty(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- propValue.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else if (isAnnotationConstExprConstruct(jp)) {
- propValue.setValue(parseAnnotationConstExprConstruct(jp));
- } else {
- propValue.setValue(jp.readValueAs(DynExprConstructImpl.class));
- }
- }
- }
-
- return propValue;
- }
-
-}
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/edm/xml/v4/annotation/Record.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Record.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Record.java
deleted file mode 100644
index ee7d332..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Record.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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-
-@JsonDeserialize(using = RecordDeserializer.class)
-public class Record extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = -2886526224721870304L;
-
- private String type;
-
- private final List<PropertyValue> propertyValues = new ArrayList<PropertyValue>();
-
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- public List<PropertyValue> getPropertyValues() {
- return propertyValues;
- }
-
-}
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/edm/xml/v4/annotation/RecordDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/RecordDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/RecordDeserializer.java
deleted file mode 100644
index f4a6cf1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/RecordDeserializer.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.edm.xml.v4.annotation;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class RecordDeserializer extends AbstractEdmDeserializer<Record> {
-
- @Override
- protected Record doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final Record record = new Record();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Tyoe".equals(jp.getCurrentName())) {
- record.setType(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- record.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else {
- record.getPropertyValues().add(jp.readValueAs(PropertyValue.class));
- }
- }
- }
-
- return record;
- }
-
-}
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/edm/xml/v4/annotation/UrlRef.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/UrlRef.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/UrlRef.java
deleted file mode 100644
index f710fa4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/UrlRef.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-
-@JsonDeserialize(using = UrlRefDeserializer.class)
-public class UrlRef extends DynExprConstructImpl {
-
- private static final long serialVersionUID = 3755101394647430897L;
-
- private ExprConstruct value;
-
- public ExprConstruct getValue() {
- return value;
- }
-
- public void setValue(final ExprConstruct value) {
- this.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/edm/xml/v4/annotation/UrlRefDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java
deleted file mode 100644
index e3d9f61..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java
+++ /dev/null
@@ -1,50 +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.edm.xml.v4.annotation;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class UrlRefDeserializer extends AbstractEdmDeserializer<UrlRef> {
-
- @Override
- protected UrlRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final UrlRef urlref = new UrlRef();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if (isAnnotationConstExprConstruct(jp)) {
- urlref.setValue(parseAnnotationConstExprConstruct(jp));
- } else {
- urlref.setValue(jp.readValueAs( DynExprConstructImpl.class));
- }
- }
- }
-
- return urlref;
- }
-
-}
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/http/AbstractBasicAuthHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractBasicAuthHttpClientFactory.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractBasicAuthHttpClientFactory.java
deleted file mode 100644
index 1c3d8fd..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractBasicAuthHttpClientFactory.java
+++ /dev/null
@@ -1,50 +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.http;
-
-import java.net.URI;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.HttpClient;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.olingo.odata4.client.api.http.HttpMethod;
-
-/**
- * Base implementation for working with Basic Authentication: needs to be subclassed in order to provide actual username
- * and password.
- */
-public abstract class AbstractBasicAuthHttpClientFactory extends DefaultHttpClientFactory {
-
- private static final long serialVersionUID = 7985626503125490244L;
-
- protected abstract String getUsername();
-
- protected abstract String getPassword();
-
- @Override
- public HttpClient createHttpClient(final HttpMethod method, final URI uri) {
- final DefaultHttpClient httpclient = (DefaultHttpClient) super.createHttpClient(method, uri);
-
- httpclient.getCredentialsProvider().setCredentials(
- new AuthScope(uri.getHost(), uri.getPort()),
- new UsernamePasswordCredentials(getUsername(), getPassword()));
-
- return httpclient;
- }
-}
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/http/AbstractNTLMAuthHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractNTLMAuthHttpClientFactory.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractNTLMAuthHttpClientFactory.java
deleted file mode 100644
index 579032b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/AbstractNTLMAuthHttpClientFactory.java
+++ /dev/null
@@ -1,62 +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.http;
-
-import java.net.URI;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.NTCredentials;
-import org.apache.http.client.CredentialsProvider;
-import org.apache.http.client.HttpClient;
-import org.apache.http.impl.client.BasicCredentialsProvider;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.olingo.odata4.client.api.http.HttpMethod;
-
-/**
- * Base implementation for working with NTLM Authentication via embedded HttpClient features: needs to be subclassed in
- * order to provide all needed login information.
- * <br/>
- * External NTLM engine such as <a href="http://jcifs.samba.org/">JCIFS</a> library developed by the
- * <a href="http://www.samba.org/">Samba</a> project as a part of their Windows interoperability suite of programs.
- *
- * @see NTCredentials
- * @see http://hc.apache.org/httpcomponents-client-ga/ntlm.html#Using_Samba_JCIFS_as_an_alternative_NTLM_engine
- */
-public abstract class AbstractNTLMAuthHttpClientFactory extends DefaultHttpClientFactory {
-
- protected abstract String getUsername();
-
- protected abstract String getPassword();
-
- protected abstract String getWorkstation();
-
- protected abstract String getDomain();
-
- @Override
- public HttpClient createHttpClient(final HttpMethod method, final URI uri) {
- final DefaultHttpClient httpclient = (DefaultHttpClient) super.createHttpClient(method, uri);
-
- final CredentialsProvider credsProvider = new BasicCredentialsProvider();
- credsProvider.setCredentials(AuthScope.ANY,
- new NTCredentials(getUsername(), getPassword(), getWorkstation(), getDomain()));
-
- httpclient.setCredentialsProvider(credsProvider);
-
- return httpclient;
- }
-}
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/http/DefaultHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpClientFactory.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpClientFactory.java
deleted file mode 100644
index f008ff5..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpClientFactory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.http;
-
-import java.io.Serializable;
-import java.net.URI;
-import org.apache.http.client.HttpClient;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.olingo.odata4.client.api.http.HttpClientFactory;
-import org.apache.olingo.odata4.client.api.http.HttpMethod;
-
-/**
- * Default implementation returning HttpClients with default parameters.
- */
-public class DefaultHttpClientFactory implements HttpClientFactory, Serializable {
-
- private static final long serialVersionUID = -2461355444507227332L;
-
- @Override
- public HttpClient createHttpClient(final HttpMethod method, final URI uri) {
- return new DefaultHttpClient();
- }
-}
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/http/DefaultHttpUriRequestFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpUriRequestFactory.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpUriRequestFactory.java
deleted file mode 100644
index 10b2e85..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/DefaultHttpUriRequestFactory.java
+++ /dev/null
@@ -1,68 +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.http;
-
-import java.net.URI;
-import org.apache.http.client.methods.HttpDelete;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.methods.HttpPut;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.olingo.odata4.client.api.http.HttpMethod;
-import org.apache.olingo.odata4.client.api.http.HttpUriRequestFactory;
-
-/**
- * Default implementation returning default HttpUriRequest implementations.
- */
-public class DefaultHttpUriRequestFactory implements HttpUriRequestFactory {
-
- @Override
- public HttpUriRequest createHttpUriRequest(final HttpMethod method, final URI uri) {
- HttpUriRequest result;
-
- switch (method) {
- case POST:
- result = new HttpPost(uri);
- break;
-
- case PUT:
- result = new HttpPut(uri);
- break;
-
- case PATCH:
- result = new HttpPatch(uri);
- break;
-
- case MERGE:
- result = new HttpMerge(uri);
- break;
-
- case DELETE:
- result = new HttpDelete(uri);
- break;
-
- case GET:
- default:
- result = new HttpGet(uri);
- break;
- }
-
- return result;
- }
-}
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/http/HttpMerge.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpMerge.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpMerge.java
deleted file mode 100644
index ffe20a9..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpMerge.java
+++ /dev/null
@@ -1,70 +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.http;
-
-import java.net.URI;
-import org.apache.http.annotation.NotThreadSafe;
-import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
-
-/**
- * Class identifying MERGE HTTP method.
- */
-@NotThreadSafe
-public class HttpMerge extends HttpEntityEnclosingRequestBase {
-
- public final static String METHOD_NAME = "MERGE";
-
- /**
- * Constructor.
- */
- public HttpMerge() {
- super();
- }
-
- /**
- * Constructor.
- *
- * @param uri request URI.
- */
- public HttpMerge(final URI uri) {
- super();
- setURI(uri);
- }
-
- /**
- * Constructor.
- *
- * @param uri request URI.
- * @throws IllegalArgumentException if the uri is invalid.
- */
- public HttpMerge(final String uri) {
- super();
- setURI(URI.create(uri));
- }
-
- /**
- * Gets HTTP method name.
- *
- * @return HTTP method name.
- */
- @Override
- public String getMethod() {
- return METHOD_NAME;
- }
-}
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/http/HttpPatch.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpPatch.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpPatch.java
deleted file mode 100644
index 244bdc1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/http/HttpPatch.java
+++ /dev/null
@@ -1,70 +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.http;
-
-import java.net.URI;
-import org.apache.http.annotation.NotThreadSafe;
-import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
-
-/**
- * Class identifying PATCH HTTP method.
- */
-@NotThreadSafe
-public class HttpPatch extends HttpEntityEnclosingRequestBase {
-
- public final static String METHOD_NAME = "PATCH";
-
- /**
- * Constructor.
- */
- public HttpPatch() {
- super();
- }
-
- /**
- * Constructor.
- *
- * @param uri request URI.
- */
- public HttpPatch(final URI uri) {
- super();
- setURI(uri);
- }
-
- /**
- * Constructor.
- *
- * @param uri request URI.
- * @throws IllegalArgumentException if the uri is invalid.
- */
- public HttpPatch(final String uri) {
- super();
- setURI(URI.create(uri));
- }
-
- /**
- * Gets HTTP method name.
- *
- * @return HTTP method name.
- */
- @Override
- public String getMethod() {
- return METHOD_NAME;
- }
-}
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/op/impl/AbstractEdmDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractEdmDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractEdmDeserializer.java
deleted file mode 100644
index 2a3aa80..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractEdmDeserializer.java
+++ /dev/null
@@ -1,69 +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.op.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser;
-import java.io.IOException;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.ReturnTypeImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.annotation.ConstExprConstructImpl;
-
-public abstract class AbstractEdmDeserializer<T> extends JsonDeserializer<T> {
-
- protected ODataClient client;
-
- protected boolean isAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
- return ConstExprConstructImpl.Type.fromString(jp.getCurrentName()) != null;
- }
-
- protected ConstExprConstructImpl parseAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
- final ConstExprConstructImpl constExpr = new ConstExprConstructImpl();
- constExpr.setType(ConstExprConstructImpl.Type.fromString(jp.getCurrentName()));
- constExpr.setValue(jp.nextTextValue());
- return constExpr;
- }
-
- protected ReturnTypeImpl parseReturnType(final JsonParser jp, final String elementName) throws IOException {
- ReturnTypeImpl returnType;
- if (elementName.equals(((FromXmlParser) jp).getStaxReader().getLocalName())) {
- returnType = new ReturnTypeImpl();
- returnType.setType(jp.nextTextValue());
- } else {
- jp.nextToken();
- returnType = jp.readValueAs( ReturnTypeImpl.class);
- }
- return returnType;
- }
-
- 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/op/impl/AbstractJacksonTool.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractJacksonTool.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractJacksonTool.java
deleted file mode 100644
index 8536849..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractJacksonTool.java
+++ /dev/null
@@ -1,83 +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.op.impl;
-
-import com.fasterxml.aalto.stax.InputFactoryImpl;
-import com.fasterxml.aalto.stax.OutputFactoryImpl;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.InjectableValues;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.deser.DeserializationProblemHandler;
-import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
-import com.fasterxml.jackson.dataformat.xml.XmlFactory;
-import com.fasterxml.jackson.dataformat.xml.XmlMapper;
-import java.io.IOException;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-abstract class AbstractJacksonTool {
-
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractJacksonTool.class);
-
- protected final ODataClient client;
-
- protected AbstractJacksonTool(final ODataClient client) {
- this.client = client;
- }
-
- protected ObjectMapper getObjectMapper() {
- final ObjectMapper mapper = new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);
-
- mapper.setInjectableValues(new InjectableValues.Std().addValue(ODataClient.class, client));
-
- mapper.setSerializerProvider(new InjectableSerializerProvider(mapper.getSerializerProvider(),
- mapper.getSerializationConfig().withAttribute(ODataClient.class, client),
- mapper.getSerializerFactory()));
-
- return mapper;
- }
-
- protected XmlMapper getXmlMapper() {
- final XmlMapper xmlMapper = new XmlMapper(
- new XmlFactory(new InputFactoryImpl(), new OutputFactoryImpl()), new JacksonXmlModule());
-
- xmlMapper.setInjectableValues(new InjectableValues.Std().addValue(ODataClient.class, client));
-
- xmlMapper.addHandler(new DeserializationProblemHandler() {
-
- @Override
- public boolean handleUnknownProperty(final DeserializationContext ctxt, final JsonParser jp,
- final JsonDeserializer<?> deserializer, final Object beanOrClass, final String propertyName)
- throws IOException, JsonProcessingException {
-
- // skip any unknown property
- LOG.warn("Skipping unknown property {}", propertyName);
- ctxt.getParser().skipChildren();
- return true;
- }
- });
- return xmlMapper;
- }
-
-}
[49/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataGeospatialValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataGeospatialValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataGeospatialValue.java
new file mode 100644
index 0000000..b25a213
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataGeospatialValue.java
@@ -0,0 +1,488 @@
+/*
+ * 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.api.domain;
+
+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.apache.olingo.client.api.Constants;
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.domain.geospatial.Geospatial;
+import org.apache.olingo.client.api.domain.geospatial.GeospatialCollection;
+import org.apache.olingo.client.api.domain.geospatial.LineString;
+import org.apache.olingo.client.api.domain.geospatial.MultiLineString;
+import org.apache.olingo.client.api.domain.geospatial.MultiPoint;
+import org.apache.olingo.client.api.domain.geospatial.MultiPolygon;
+import org.apache.olingo.client.api.domain.geospatial.Point;
+import org.apache.olingo.client.api.domain.geospatial.Polygon;
+import org.apache.olingo.client.api.utils.XMLUtils;
+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(Constants.ELEM_POS)));
+ }
+
+ private Polygon parsePolygon(final Element element) {
+ List<Point> extPoints = null;
+ final Element exterior
+ = (Element) element.getElementsByTagName(Constants.ELEM_POLYGON_EXTERIOR).item(0);
+ if (exterior != null) {
+ extPoints = parsePoints(
+ ((Element) exterior.getElementsByTagName(Constants.ELEM_POLYGON_LINEARRING).item(0)).
+ getElementsByTagName(Constants.ELEM_POS));
+ }
+ List<Point> intPoints = null;
+ final Element interior
+ = (Element) element.getElementsByTagName(Constants.ELEM_POLYGON_INTERIOR).item(0);
+ if (interior != null) {
+ intPoints = parsePoints(
+ ((Element) interior.getElementsByTagName(Constants.ELEM_POLYGON_LINEARRING).item(0)).
+ getElementsByTagName(Constants.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(Constants.ELEM_POS)).get(0);
+ break;
+
+ case GeographyMultiPoint:
+ case GeometryMultiPoint:
+ final Element pMembs
+ = (Element) tree.getElementsByTagName(Constants.ELEM_POINTMEMBERS).item(0);
+ final List<Point> points = pMembs == null
+ ? Collections.<Point>emptyList()
+ : parsePoints(pMembs.getElementsByTagName(Constants.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(Constants.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(Constants.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(Constants.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(Constants.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(Constants.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(Constants.NS_GML, Constants.ELEM_POS);
+ pos.appendChild(parent.getOwnerDocument().createTextNode(
+ Double.toString(point.getX()) + " " + point.getY()));
+
+ final Element appendable;
+ if (wrap) {
+ final Element epoint = parent.getOwnerDocument().
+ createElementNS(Constants.NS_GML, Constants.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(Constants.NS_GML, Constants.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(
+ Constants.NS_GML, Constants.ELEM_POLYGON);
+ parent.appendChild(ePolygon);
+ appendable = ePolygon;
+ } else {
+ appendable = parent;
+ }
+
+ if (!polygon.getExterior().isEmpty()) {
+ final Element exterior = parent.getOwnerDocument().createElementNS(
+ Constants.NS_GML, Constants.ELEM_POLYGON_EXTERIOR);
+ appendable.appendChild(exterior);
+ final Element linearRing = parent.getOwnerDocument().createElementNS(
+ Constants.NS_GML, Constants.ELEM_POLYGON_LINEARRING);
+ exterior.appendChild(linearRing);
+
+ parsePoints(linearRing, polygon.getExterior().iterator(), false);
+ }
+ if (!polygon.getInterior().isEmpty()) {
+ final Element interior = parent.getOwnerDocument().createElementNS(
+ Constants.NS_GML, Constants.ELEM_POLYGON_INTERIOR);
+ appendable.appendChild(interior);
+ final Element linearRing = parent.getOwnerDocument().createElementNS(
+ Constants.NS_GML, Constants.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(Constants.NS_GML, Constants.ELEM_POINT);
+
+ parsePoints(tree, Collections.singleton((Point) value).iterator(), false);
+ break;
+
+ case GeometryMultiPoint:
+ case GeographyMultiPoint:
+ tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_MULTIPOINT);
+
+ final Element pMembs = doc.createElementNS(Constants.NS_GML, Constants.ELEM_POINTMEMBERS);
+ tree.appendChild(pMembs);
+
+ parsePoints(pMembs, ((MultiPoint) value).iterator(), true);
+ break;
+
+ case GeometryLineString:
+ case GeographyLineString:
+ tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_LINESTRING);
+
+ parseLineStrings(tree, Collections.singleton((LineString) value).iterator(), false);
+ break;
+
+ case GeometryMultiLineString:
+ case GeographyMultiLineString:
+ tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_MULTILINESTRING);
+
+ final Element mlMembs
+ = doc.createElementNS(Constants.NS_GML, Constants.ELEM_LINESTRINGMEMBERS);
+ tree.appendChild(mlMembs);
+
+ parseLineStrings(mlMembs, ((MultiLineString) value).iterator(), true);
+ break;
+
+ case GeographyPolygon:
+ case GeometryPolygon:
+ tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_POLYGON);
+ parsePolygons(tree, Collections.singleton(((Polygon) value)).iterator(), false);
+ break;
+
+ case GeographyMultiPolygon:
+ case GeometryMultiPolygon:
+ tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_MULTIPOLYGON);
+
+ final Element mpMembs
+ = doc.createElementNS(Constants.NS_GML, Constants.ELEM_SURFACEMEMBERS);
+ tree.appendChild(mpMembs);
+
+ parsePolygons(mpMembs, ((MultiPolygon) value).iterator(), true);
+ break;
+
+ case GeographyCollection:
+ case GeometryCollection:
+ tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_GEOCOLLECTION);
+
+ final Element gMembs
+ = doc.createElementNS(Constants.NS_GML, Constants.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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataInvokeResult.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataInvokeResult.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataInvokeResult.java
new file mode 100644
index 0000000..c55dfe6
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataInvokeResult.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.domain;
+
+/**
+ * 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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataPrimitiveValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataPrimitiveValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataPrimitiveValue.java
new file mode 100644
index 0000000..8a4b05d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataPrimitiveValue.java
@@ -0,0 +1,378 @@
+/*
+ * 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.api.domain;
+
+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;
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+import org.apache.olingo.client.api.domain.ODataDuration;
+import org.apache.olingo.client.api.domain.ODataTimestamp;
+import org.apache.olingo.client.api.domain.ODataValue;
+
+/**
+ * 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.getServiceVersion())) {
+ 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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataProperty.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataProperty.java
new file mode 100644
index 0000000..940b15c
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataProperty.java
@@ -0,0 +1,192 @@
+/*
+ * 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.api.domain;
+
+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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataServiceDocument.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataServiceDocument.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataServiceDocument.java
new file mode 100644
index 0000000..d0f495d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataServiceDocument.java
@@ -0,0 +1,183 @@
+/*
+ * 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.api.domain;
+
+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);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataTimestamp.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataTimestamp.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataTimestamp.java
new file mode 100644
index 0000000..90edda7
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataTimestamp.java
@@ -0,0 +1,138 @@
+/*
+ * 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.api.domain;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * Helper class for handling datetime and datetime-offset primitive values.
+ */
+public final class ODataTimestamp implements Serializable {
+
+ private static final long serialVersionUID = 4053990618660356004L;
+
+ private final SimpleDateFormat sdf;
+
+ private final Timestamp timestamp;
+
+ private String timezone;
+
+ private final boolean offset;
+
+ public static ODataTimestamp getInstance(final EdmSimpleType type, final Timestamp timestamp) {
+ return new ODataTimestamp(new SimpleDateFormat(type.pattern()),
+ new Date(timestamp.getTime()), timestamp.getNanos(), type == EdmSimpleType.DateTimeOffset);
+ }
+
+ public static ODataTimestamp parse(final EdmSimpleType type, final String input) {
+ final ODataTimestamp instance;
+
+ final String[] dateParts = input.split("\\.");
+ final SimpleDateFormat sdf = new SimpleDateFormat(type.pattern());
+ final boolean isOffset = type == EdmSimpleType.DateTimeOffset;
+
+ try {
+ final Date date = sdf.parse(dateParts[0]);
+ if (dateParts.length > 1) {
+ int idx = dateParts[1].indexOf('+');
+ if (idx == -1) {
+ idx = dateParts[1].indexOf('-');
+ }
+ if (idx == -1) {
+ instance = new ODataTimestamp(sdf, date, Integer.parseInt(dateParts[1]), isOffset);
+ } else {
+ instance = new ODataTimestamp(sdf, date,
+ Integer.parseInt(dateParts[1].substring(0, idx)), dateParts[1].substring(idx), isOffset);
+ }
+ } else {
+ instance = new ODataTimestamp(sdf, date, isOffset);
+ }
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Cannot parse " + type.pattern(), e);
+ }
+
+ return instance;
+ }
+
+ private ODataTimestamp(final SimpleDateFormat sdf, final Date date, final boolean offset) {
+ this.sdf = sdf;
+ this.timestamp = new Timestamp(date.getTime());
+ this.offset = offset;
+ }
+
+ private ODataTimestamp(final SimpleDateFormat sdf, final Date date, final int nanos, final boolean offset) {
+ this(sdf, date, offset);
+ this.timestamp.setNanos(nanos);
+ }
+
+ private ODataTimestamp(
+ final SimpleDateFormat sdf, final Date date, final int nanos, final String timezone, final boolean offset) {
+ this(sdf, date, nanos, offset);
+ this.timezone = timezone;
+ }
+
+ public Timestamp getTimestamp() {
+ return timestamp;
+ }
+
+ public String getTimezone() {
+ return timezone;
+ }
+
+ public boolean isOffset() {
+ return offset;
+ }
+
+ /**
+ * {@inheritDoc }
+ */
+ @Override
+ public boolean equals(final Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj, "sdf");
+ }
+
+ /**
+ * {@inheritDoc }
+ */
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this, "sdf");
+ }
+
+ /**
+ * {@inheritDoc }
+ */
+ @Override
+ public String toString() {
+ final StringBuilder formatted = new StringBuilder().append(sdf.format(timestamp));
+ if (timestamp.getNanos() > 0) {
+ formatted.append('.').append(String.valueOf(timestamp.getNanos()));
+ }
+ if (StringUtils.isNotBlank(timezone)) {
+ formatted.append(timezone);
+ }
+ return formatted.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataValue.java
new file mode 100644
index 0000000..e6b5279
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ODataValue.java
@@ -0,0 +1,111 @@
+/*
+ * 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.api.domain;
+
+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;
+
+/**
+ * Abstract representation of an OData entity property value.
+ */
+public abstract class ODataValue implements Serializable {
+
+ private static final long serialVersionUID = 7445422004232581877L;
+
+ /**
+ * Check is is a primitive value.
+ *
+ * @return 'TRUE' if primitive; 'FALSE' otherwise.
+ */
+ public boolean isPrimitive() {
+ return (this instanceof ODataPrimitiveValue);
+ }
+
+ /**
+ * Casts to primitive value.
+ *
+ * @return primitive value.
+ */
+ public ODataPrimitiveValue asPrimitive() {
+ return isPrimitive() ? (ODataPrimitiveValue) this : null;
+ }
+
+ /**
+ * Check is is a complex value.
+ *
+ * @return 'TRUE' if complex; 'FALSE' otherwise.
+ */
+ public boolean isComplex() {
+ return (this instanceof ODataComplexValue);
+ }
+
+ /**
+ * Casts to complex value.
+ *
+ * @return complex value.
+ */
+ public ODataComplexValue asComplex() {
+ return isComplex() ? (ODataComplexValue) this : null;
+ }
+
+ /**
+ * Check is is a collection value.
+ *
+ * @return 'TRUE' if collection; 'FALSE' otherwise.
+ */
+ public boolean isCollection() {
+ return (this instanceof ODataCollectionValue);
+ }
+
+ /**
+ * Casts to collection value.
+ *
+ * @return collection value.
+ */
+ public ODataCollectionValue asCollection() {
+ return isCollection() ? (ODataCollectionValue) this : 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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/ComposedGeospatial.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/ComposedGeospatial.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/ComposedGeospatial.java
new file mode 100644
index 0000000..40b50ec
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/ComposedGeospatial.java
@@ -0,0 +1,75 @@
+/*
+ * 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.api.domain.geospatial;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Abstract base class for all Geometries that are composed out of other geospatial elements.
+ */
+public abstract class ComposedGeospatial<T extends Geospatial> extends Geospatial implements Iterable<T> {
+
+ private static final long serialVersionUID = 8796254901098541307L;
+
+ protected final List<T> geospatials;
+
+ /**
+ * Constructor.
+ *
+ * @param dimension dimension.
+ * @param type type.
+ * @param geospatials geospatials info.
+ */
+ protected ComposedGeospatial(final Dimension dimension, final Type type, final List<T> geospatials) {
+ super(dimension, type);
+ this.geospatials = new ArrayList<T>();
+ if (geospatials != null) {
+ this.geospatials.addAll(geospatials);
+ }
+ }
+
+ /**
+ * {@inheritDoc }
+ */
+ @Override
+ public Iterator<T> iterator() {
+ return this.geospatials.iterator();
+ }
+
+ /**
+ * Checks if is empty.
+ *
+ * @return 'TRUE' if is empty; 'FALSE' otherwise.
+ */
+ public boolean isEmpty() {
+ return geospatials.isEmpty();
+ }
+
+ /**
+ * {@inheritDoc }
+ */
+ @Override
+ public void setSrid(final Integer srid) {
+ for (Geospatial geospatial : this.geospatials) {
+ geospatial.setSrid(srid);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Geospatial.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Geospatial.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Geospatial.java
new file mode 100644
index 0000000..4bec1b8
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Geospatial.java
@@ -0,0 +1,157 @@
+/*
+ * 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.api.domain.geospatial;
+
+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;
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+
+/**
+ * Base class for all geospatial info.
+ */
+public abstract class Geospatial implements Serializable {
+
+ public enum Dimension {
+
+ GEOMETRY,
+ GEOGRAPHY;
+
+ }
+
+ public enum Type {
+
+ /**
+ * The OGIS geometry type number for points.
+ */
+ POINT,
+ /**
+ * The OGIS geometry type number for lines.
+ */
+ LINESTRING,
+ /**
+ * The OGIS geometry type number for polygons.
+ */
+ POLYGON,
+ /**
+ * The OGIS geometry type number for aggregate points.
+ */
+ MULTIPOINT,
+ /**
+ * The OGIS geometry type number for aggregate lines.
+ */
+ MULTILINESTRING,
+ /**
+ * The OGIS geometry type number for aggregate polygons.
+ */
+ MULTIPOLYGON,
+ /**
+ * The OGIS geometry type number for feature collections.
+ */
+ GEOSPATIALCOLLECTION;
+
+ }
+
+ protected final Dimension dimension;
+
+ protected final Type type;
+
+ /**
+ * Null value means it is expected to vary per instance.
+ */
+ protected Integer srid;
+
+ /**
+ * Constructor.
+ *
+ * @param dimension dimension.
+ * @param type type.
+ */
+ protected Geospatial(final Dimension dimension, final Type type) {
+ this.dimension = dimension;
+ this.type = type;
+ }
+
+ /**
+ * Gets dimension.
+ *
+ * @return dimension.
+ * @see Dimension
+ */
+ public Dimension getDimension() {
+ return dimension;
+ }
+
+ /**
+ * Gets type.
+ *
+ * @return type.
+ * @see Type
+ */
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * Gets s-rid.
+ *
+ * @return s-rid.
+ */
+ public Integer getSrid() {
+ return srid;
+ }
+
+ /**
+ * Sets s-rid.
+ *
+ * @param srid s-rid.
+ */
+ public void setSrid(final Integer srid) {
+ this.srid = srid;
+ }
+
+ public abstract EdmSimpleType getEdmSimpleType();
+
+ /**
+ * {@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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/GeospatialCollection.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/GeospatialCollection.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/GeospatialCollection.java
new file mode 100644
index 0000000..3626dcc
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/GeospatialCollection.java
@@ -0,0 +1,48 @@
+/*
+ * 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.api.domain.geospatial;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+
+/**
+ * Wrapper for a collection of geospatials info.
+ */
+public class GeospatialCollection extends ComposedGeospatial<Geospatial> {
+
+ private static final long serialVersionUID = -9181547636133878977L;
+
+ /**
+ * Constructor.
+ *
+ * @param dimension dimension.
+ * @param geospatials geospatials info.
+ */
+ public GeospatialCollection(final Dimension dimension, final List<Geospatial> geospatials) {
+ super(dimension, Type.GEOSPATIALCOLLECTION, geospatials);
+ }
+
+ @Override
+ public EdmSimpleType getEdmSimpleType() {
+ return dimension == Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyCollection
+ : EdmSimpleType.GeometryCollection;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/LineString.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/LineString.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/LineString.java
new file mode 100644
index 0000000..926c605
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/LineString.java
@@ -0,0 +1,39 @@
+/*
+ * 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.api.domain.geospatial;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+
+public class LineString extends ComposedGeospatial<Point> {
+
+ private static final long serialVersionUID = 3207958185407535907L;
+
+ public LineString(final Dimension dimension, final List<Point> points) {
+ super(dimension, Type.LINESTRING, points);
+ }
+
+ @Override
+ public EdmSimpleType getEdmSimpleType() {
+ return dimension == Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyLineString
+ : EdmSimpleType.GeometryLineString;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiLineString.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiLineString.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiLineString.java
new file mode 100644
index 0000000..774f5f0
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiLineString.java
@@ -0,0 +1,39 @@
+/*
+ * 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.api.domain.geospatial;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+
+public class MultiLineString extends ComposedGeospatial<LineString> {
+
+ private static final long serialVersionUID = -5042414471218124125L;
+
+ public MultiLineString(final Dimension dimension, final List<LineString> lineStrings) {
+ super(dimension, Type.MULTILINESTRING, lineStrings);
+ }
+
+ @Override
+ public EdmSimpleType getEdmSimpleType() {
+ return dimension == Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyMultiLineString
+ : EdmSimpleType.GeometryMultiLineString;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiPoint.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiPoint.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiPoint.java
new file mode 100644
index 0000000..9acae5e
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiPoint.java
@@ -0,0 +1,39 @@
+/*
+ * 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.api.domain.geospatial;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+
+public class MultiPoint extends ComposedGeospatial<Point> {
+
+ private static final long serialVersionUID = 4951011255142116129L;
+
+ public MultiPoint(final Dimension dimension, final List<Point> points) {
+ super(dimension, Type.MULTIPOINT, points);
+ }
+
+ @Override
+ public EdmSimpleType getEdmSimpleType() {
+ return dimension == Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyMultiPoint
+ : EdmSimpleType.GeometryMultiPoint;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiPolygon.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiPolygon.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiPolygon.java
new file mode 100644
index 0000000..3513ec6
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/MultiPolygon.java
@@ -0,0 +1,39 @@
+/*
+ * 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.api.domain.geospatial;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+
+public class MultiPolygon extends ComposedGeospatial<Polygon> {
+
+ private static final long serialVersionUID = -160184788048512883L;
+
+ public MultiPolygon(final Dimension dimension, final List<Polygon> polygons) {
+ super(dimension, Type.MULTIPOLYGON, polygons);
+ }
+
+ @Override
+ public EdmSimpleType getEdmSimpleType() {
+ return dimension == Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyMultiPolygon
+ : EdmSimpleType.GeometryMultiPolygon;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Point.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Point.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Point.java
new file mode 100644
index 0000000..15f42a3
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Point.java
@@ -0,0 +1,77 @@
+/*
+ * 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.api.domain.geospatial;
+
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+
+public class Point extends Geospatial {
+
+ private static final long serialVersionUID = 4917380107331557828L;
+
+ /**
+ * The X coordinate of the point. In most long/lat systems, this is the longitude.
+ */
+ private double x;
+
+ /**
+ * The Y coordinate of the point. In most long/lat systems, this is the latitude.
+ */
+ private double y;
+
+ /**
+ * The Z coordinate of the point. In most long/lat systems, this is a radius from the center of the earth, or the
+ * height / elevation over the ground.
+ */
+ private double z;
+
+ public Point(final Dimension dimension) {
+ super(dimension, Type.POINT);
+ }
+
+ public double getX() {
+ return x;
+ }
+
+ public void setX(double x) {
+ this.x = x;
+ }
+
+ public double getY() {
+ return y;
+ }
+
+ public void setY(double y) {
+ this.y = y;
+ }
+
+ public double getZ() {
+ return z;
+ }
+
+ public void setZ(double z) {
+ this.z = z;
+ }
+
+ @Override
+ public EdmSimpleType getEdmSimpleType() {
+ return dimension == Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyPoint
+ : EdmSimpleType.GeometryPoint;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Polygon.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Polygon.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Polygon.java
new file mode 100644
index 0000000..2c0fcbd
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/geospatial/Polygon.java
@@ -0,0 +1,73 @@
+/*
+ * 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.api.domain.geospatial;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+
+/**
+ * Polygon.
+ */
+public class Polygon extends Geospatial {
+
+ private static final long serialVersionUID = 7797602503445391678L;
+
+ final ComposedGeospatial<Point> interior;
+
+ final ComposedGeospatial<Point> exterior;
+
+ /**
+ * Constructor.
+ *
+ * @param dimension dimension.
+ * @param interior interior points.
+ * @param exterior exterior points.
+ */
+ public Polygon(final Dimension dimension, final List<Point> interior, final List<Point> exterior) {
+ super(dimension, Type.POLYGON);
+ this.interior = new MultiPoint(dimension, interior);
+ this.exterior = new MultiPoint(dimension, exterior);
+ }
+
+ /**
+ * Gest interior points.
+ *
+ * @return interior points.
+ */
+ public ComposedGeospatial<Point> getInterior() {
+ return interior;
+ }
+
+ /**
+ * Gets exterior points.
+ *
+ * @return exterior points.I
+ */
+ public ComposedGeospatial<Point> getExterior() {
+ return exterior;
+ }
+
+ @Override
+ public EdmSimpleType getEdmSimpleType() {
+ return dimension == Dimension.GEOGRAPHY
+ ? EdmSimpleType.GeographyPolygon
+ : EdmSimpleType.GeometryPolygon;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonAnnotations.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonAnnotations.java
new file mode 100644
index 0000000..b79328f
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonAnnotations.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.edm.xml;
+
+public abstract interface CommonAnnotations {
+
+ String getTarget();
+
+ String getQualifier();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonFunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonFunctionImport.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonFunctionImport.java
new file mode 100644
index 0000000..c590387
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonFunctionImport.java
@@ -0,0 +1,22 @@
+/*
+ * 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.api.edm.xml;
+
+public interface CommonFunctionImport extends Named {
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonNavigationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonNavigationProperty.java
new file mode 100644
index 0000000..20eb9de
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonNavigationProperty.java
@@ -0,0 +1,22 @@
+/*
+ * 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.api.edm.xml;
+
+public interface CommonNavigationProperty extends Named {
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonParameter.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonParameter.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonParameter.java
new file mode 100644
index 0000000..ec96dc0
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonParameter.java
@@ -0,0 +1,33 @@
+/*
+ * 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.api.edm.xml;
+
+public interface CommonParameter extends Named {
+
+ String getType();
+
+ boolean isNullable();
+
+ Integer getMaxLength();
+
+ Integer getPrecision();
+
+ Integer getScale();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonProperty.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonProperty.java
new file mode 100644
index 0000000..28688ab
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/CommonProperty.java
@@ -0,0 +1,49 @@
+/*
+ * 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.api.edm.xml;
+
+import org.apache.olingo.commons.api.edm.constants.ConcurrencyMode;
+import org.apache.olingo.commons.api.edm.constants.StoreGeneratedPattern;
+
+public interface CommonProperty extends Named {
+
+ String getType();
+
+ boolean isNullable();
+
+ String getDefaultValue();
+
+ Integer getMaxLength();
+
+ boolean isFixedLength();
+
+ Integer getPrecision();
+
+ Integer getScale();
+
+ boolean isUnicode();
+
+ String getCollation();
+
+ String getSrid();
+
+ ConcurrencyMode getConcurrencyMode();
+
+ StoreGeneratedPattern getStoreGeneratedPattern();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ComplexType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ComplexType.java
new file mode 100644
index 0000000..9e85e22
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/ComplexType.java
@@ -0,0 +1,32 @@
+/*
+ * 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.api.edm.xml;
+
+import java.util.List;
+
+public interface ComplexType extends Named {
+
+ CommonProperty getProperty(String name);
+
+ List<? extends CommonProperty> getProperties();
+
+ CommonNavigationProperty getNavigationProperty(String name);
+
+ List<? extends CommonNavigationProperty> getNavigationProperties();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java
new file mode 100644
index 0000000..961f69c
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/DataServices.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.edm.xml;
+
+import java.util.List;
+
+public interface DataServices {
+
+ String getDataServiceVersion();
+
+ String getMaxDataServiceVersion();
+
+ List<? extends Schema> getSchemas();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Edmx.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Edmx.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Edmx.java
new file mode 100644
index 0000000..ee495c2
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Edmx.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.edm.xml;
+
+public interface Edmx {
+
+ String getVersion();
+
+ DataServices getDataServices();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityContainer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityContainer.java
new file mode 100644
index 0000000..b748c5f
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityContainer.java
@@ -0,0 +1,40 @@
+/*
+ * 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.api.edm.xml;
+
+import java.util.List;
+
+public interface EntityContainer extends Named {
+
+ String getExtends();
+
+ boolean isLazyLoadingEnabled();
+
+ boolean isDefaultEntityContainer();
+
+ EntitySet getEntitySet(String name);
+
+ List<? extends EntitySet> getEntitySets();
+
+ CommonFunctionImport getFunctionImport(String name);
+
+ List<? extends CommonFunctionImport> getFunctionImports(String name);
+
+ List<? extends CommonFunctionImport> getFunctionImports();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityKey.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityKey.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityKey.java
new file mode 100644
index 0000000..c1c43ec
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityKey.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.edm.xml;
+
+import java.util.List;
+
+public interface EntityKey {
+
+ List<PropertyRef> getPropertyRefs();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntitySet.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntitySet.java
new file mode 100644
index 0000000..3dea8b4
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntitySet.java
@@ -0,0 +1,25 @@
+/*
+ * 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.api.edm.xml;
+
+public interface EntitySet extends Named {
+
+ String getEntityType();
+
+}
[51/51] [abbrv] [partial] git commit: [OLINGO-192] rename java
packages
Posted by sk...@apache.org.
[OLINGO-192] rename java packages
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/commit/897db8ef
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/tree/897db8ef
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/diff/897db8ef
Branch: refs/heads/master
Commit: 897db8ef1198952f98f9ec1d94818904eba4999f
Parents: 1f25364
Author: Stephan Klevenz <st...@sap.com>
Authored: Mon Mar 10 09:58:41 2014 +0100
Committer: Stephan Klevenz <st...@sap.com>
Committed: Mon Mar 10 09:58:41 2014 +0100
----------------------------------------------------------------------
.../apache/olingo/client/api/Configuration.java | 184 +
.../org/apache/olingo/client/api/Constants.java | 217 +
.../apache/olingo/client/api/ODataClient.java | 55 +
.../olingo/client/api/ODataConstants.java | 219 +
.../apache/olingo/client/api/ODataError.java | 67 +
.../apache/olingo/client/api/ODataV3Client.java | 39 +
.../apache/olingo/client/api/ODataV4Client.java | 39 +
.../client/api/UnsupportedInV3Exception.java | 31 +
.../olingo/client/api/V3Configuration.java | 44 +
.../olingo/client/api/V4Configuration.java | 24 +
.../olingo/client/api/data/ServiceDocument.java | 138 +
.../client/api/data/ServiceDocumentItem.java | 30 +
.../api/deserializer/AnnotationProperty.java | 24 +
.../api/deserializer/ClientException.java | 36 +
.../client/api/deserializer/ComplexValue.java | 35 +
.../olingo/client/api/deserializer/Entity.java | 59 +
.../client/api/deserializer/EntitySet.java | 34 +
.../api/deserializer/NavigationProperty.java | 27 +
.../client/api/deserializer/Property.java | 24 +
.../olingo/client/api/deserializer/Reader.java | 30 +
.../api/deserializer/StructuralProperty.java | 30 +
.../olingo/client/api/deserializer/Value.java | 28 +
.../olingo/client/api/domain/EdmSimpleType.java | 289 +
.../client/api/domain/ODataCollectionValue.java | 98 +
.../client/api/domain/ODataComplexValue.java | 97 +
.../olingo/client/api/domain/ODataDuration.java | 79 +
.../client/api/domain/ODataGeospatialValue.java | 488 ++
.../client/api/domain/ODataInvokeResult.java | 30 +
.../client/api/domain/ODataPrimitiveValue.java | 378 ++
.../olingo/client/api/domain/ODataProperty.java | 192 +
.../client/api/domain/ODataServiceDocument.java | 183 +
.../client/api/domain/ODataTimestamp.java | 138 +
.../olingo/client/api/domain/ODataValue.java | 111 +
.../domain/geospatial/ComposedGeospatial.java | 75 +
.../api/domain/geospatial/Geospatial.java | 157 +
.../domain/geospatial/GeospatialCollection.java | 48 +
.../api/domain/geospatial/LineString.java | 39 +
.../api/domain/geospatial/MultiLineString.java | 39 +
.../api/domain/geospatial/MultiPoint.java | 39 +
.../api/domain/geospatial/MultiPolygon.java | 39 +
.../client/api/domain/geospatial/Point.java | 77 +
.../client/api/domain/geospatial/Polygon.java | 73 +
.../client/api/edm/xml/CommonAnnotations.java | 26 +
.../api/edm/xml/CommonFunctionImport.java | 22 +
.../api/edm/xml/CommonNavigationProperty.java | 22 +
.../client/api/edm/xml/CommonParameter.java | 33 +
.../client/api/edm/xml/CommonProperty.java | 49 +
.../olingo/client/api/edm/xml/ComplexType.java | 32 +
.../olingo/client/api/edm/xml/DataServices.java | 30 +
.../apache/olingo/client/api/edm/xml/Edmx.java | 26 +
.../client/api/edm/xml/EntityContainer.java | 40 +
.../olingo/client/api/edm/xml/EntityKey.java | 26 +
.../olingo/client/api/edm/xml/EntitySet.java | 25 +
.../olingo/client/api/edm/xml/EntityType.java | 32 +
.../olingo/client/api/edm/xml/EnumType.java | 34 +
.../olingo/client/api/edm/xml/Member.java | 26 +
.../apache/olingo/client/api/edm/xml/Named.java | 24 +
.../olingo/client/api/edm/xml/OnDelete.java | 24 +
.../client/api/edm/xml/OnDeleteAction.java | 28 +
.../olingo/client/api/edm/xml/PropertyRef.java | 25 +
.../olingo/client/api/edm/xml/Schema.java | 74 +
.../olingo/client/api/edm/xml/XMLMetadata.java | 59 +
.../client/api/edm/xml/v3/Annotations.java | 30 +
.../client/api/edm/xml/v3/Association.java | 31 +
.../client/api/edm/xml/v3/AssociationEnd.java | 32 +
.../client/api/edm/xml/v3/AssociationSet.java | 30 +
.../api/edm/xml/v3/AssociationSetEnd.java | 26 +
.../client/api/edm/xml/v3/FunctionImport.java | 43 +
.../api/edm/xml/v3/NavigationProperty.java | 29 +
.../olingo/client/api/edm/xml/v3/Parameter.java | 24 +
.../client/api/edm/xml/v3/ParameterMode.java | 27 +
.../olingo/client/api/edm/xml/v3/Property.java | 38 +
.../client/api/edm/xml/v3/PropertyValue.java | 43 +
.../api/edm/xml/v3/ReferentialConstraint.java | 26 +
.../edm/xml/v3/ReferentialConstraintRole.java | 31 +
.../client/api/edm/xml/v3/TypeAnnotation.java | 31 +
.../olingo/client/api/edm/xml/v3/Using.java | 27 +
.../client/api/edm/xml/v3/ValueAnnotation.java | 45 +
.../olingo/client/api/edm/xml/v3/ValueTerm.java | 26 +
.../olingo/client/api/edm/xml/v4/Action.java | 37 +
.../client/api/edm/xml/v4/ActionImport.java | 24 +
.../client/api/edm/xml/v4/AnnotatedEdmItem.java | 24 +
.../client/api/edm/xml/v4/Annotation.java | 33 +
.../client/api/edm/xml/v4/Annotations.java | 30 +
.../client/api/edm/xml/v4/BindingTarget.java | 28 +
.../client/api/edm/xml/v4/CSDLElement.java | 37 +
.../client/api/edm/xml/v4/ComplexType.java | 43 +
.../olingo/client/api/edm/xml/v4/Edmx.java | 26 +
.../client/api/edm/xml/v4/EntityContainer.java | 44 +
.../olingo/client/api/edm/xml/v4/EntitySet.java | 24 +
.../client/api/edm/xml/v4/EntityType.java | 23 +
.../olingo/client/api/edm/xml/v4/Function.java | 24 +
.../client/api/edm/xml/v4/FunctionImport.java | 28 +
.../olingo/client/api/edm/xml/v4/Include.java | 26 +
.../api/edm/xml/v4/IncludeAnnotations.java | 28 +
.../api/edm/xml/v4/NavigationProperty.java | 40 +
.../edm/xml/v4/NavigationPropertyBinding.java | 27 +
.../client/api/edm/xml/v4/OperationImport.java | 28 +
.../olingo/client/api/edm/xml/v4/Parameter.java | 24 +
.../olingo/client/api/edm/xml/v4/Property.java | 25 +
.../olingo/client/api/edm/xml/v4/Reference.java | 33 +
.../api/edm/xml/v4/ReferentialConstraint.java | 27 +
.../client/api/edm/xml/v4/ReturnType.java | 34 +
.../olingo/client/api/edm/xml/v4/Schema.java | 64 +
.../olingo/client/api/edm/xml/v4/Singleton.java | 25 +
.../olingo/client/api/edm/xml/v4/Term.java | 44 +
.../client/api/edm/xml/v4/TypeDefinition.java | 40 +
.../client/api/edm/xml/v4/XMLMetadata.java | 36 +
.../xml/v4/annotation/ConstExprConstruct.java | 56 +
.../edm/xml/v4/annotation/DynExprConstruct.java | 23 +
.../edm/xml/v4/annotation/ExprConstruct.java | 23 +
.../olingo/client/api/format/ODataFormat.java | 97 +
.../client/api/format/ODataMediaFormat.java | 71 +
.../client/api/format/ODataPubFormat.java | 97 +
.../client/api/format/ODataValueFormat.java | 76 +
.../client/api/http/HttpClientException.java | 68 +
.../client/api/http/HttpClientFactory.java | 30 +
.../olingo/client/api/http/HttpMethod.java | 33 +
.../client/api/http/HttpUriRequestFactory.java | 30 +
.../client/api/http/NoContentException.java | 36 +
.../olingo/client/api/op/ODataBinder.java | 122 +
.../olingo/client/api/op/ODataDeserializer.java | 94 +
.../olingo/client/api/op/ODataReader.java | 104 +
.../olingo/client/api/op/ODataSerializer.java | 118 +
.../client/api/op/ODataV3Deserializer.java | 23 +
.../client/api/op/ODataV4Deserializer.java | 30 +
.../olingo/client/api/uri/QueryOption.java | 95 +
.../olingo/client/api/uri/SegmentType.java | 66 +
.../olingo/client/api/uri/URIBuilder.java | 225 +
.../olingo/client/api/uri/V3URIBuilder.java | 47 +
.../olingo/client/api/uri/V4URIBuilder.java | 87 +
.../olingo/client/api/uri/filter/FilterArg.java | 30 +
.../client/api/uri/filter/FilterArgFactory.java | 83 +
.../client/api/uri/filter/FilterFactory.java | 61 +
.../olingo/client/api/uri/filter/URIFilter.java | 32 +
.../api/uri/filter/V3FilterArgFactory.java | 25 +
.../client/api/uri/filter/V3FilterFactory.java | 26 +
.../api/uri/filter/V4FilterArgFactory.java | 55 +
.../client/api/uri/filter/V4FilterFactory.java | 32 +
.../olingo/client/api/utils/EdmTypeInfo.java | 81 +
.../olingo/client/api/utils/XMLUtils.java | 178 +
.../olingo/odata4/client/api/Configuration.java | 183 -
.../olingo/odata4/client/api/Constants.java | 217 -
.../olingo/odata4/client/api/ODataClient.java | 55 -
.../odata4/client/api/ODataConstants.java | 219 -
.../olingo/odata4/client/api/ODataError.java | 67 -
.../olingo/odata4/client/api/ODataV3Client.java | 39 -
.../olingo/odata4/client/api/ODataV4Client.java | 39 -
.../client/api/UnsupportedInV3Exception.java | 31 -
.../odata4/client/api/V3Configuration.java | 44 -
.../odata4/client/api/V4Configuration.java | 24 -
.../odata4/client/api/data/ServiceDocument.java | 138 -
.../client/api/data/ServiceDocumentItem.java | 30 -
.../api/deserializer/AnnotationProperty.java | 24 -
.../api/deserializer/ClientException.java | 36 -
.../client/api/deserializer/ComplexValue.java | 35 -
.../odata4/client/api/deserializer/Entity.java | 59 -
.../client/api/deserializer/EntitySet.java | 34 -
.../api/deserializer/NavigationProperty.java | 27 -
.../client/api/deserializer/Property.java | 24 -
.../odata4/client/api/deserializer/Reader.java | 30 -
.../api/deserializer/StructuralProperty.java | 30 -
.../odata4/client/api/deserializer/Value.java | 28 -
.../odata4/client/api/domain/EdmSimpleType.java | 288 -
.../client/api/domain/ODataCollectionValue.java | 98 -
.../client/api/domain/ODataComplexValue.java | 97 -
.../odata4/client/api/domain/ODataDuration.java | 79 -
.../client/api/domain/ODataGeospatialValue.java | 486 --
.../client/api/domain/ODataInvokeResult.java | 30 -
.../client/api/domain/ODataPrimitiveValue.java | 376 --
.../odata4/client/api/domain/ODataProperty.java | 192 -
.../client/api/domain/ODataServiceDocument.java | 183 -
.../client/api/domain/ODataTimestamp.java | 138 -
.../odata4/client/api/domain/ODataValue.java | 111 -
.../domain/geospatial/ComposedGeospatial.java | 75 -
.../api/domain/geospatial/Geospatial.java | 156 -
.../domain/geospatial/GeospatialCollection.java | 47 -
.../api/domain/geospatial/LineString.java | 38 -
.../api/domain/geospatial/MultiLineString.java | 38 -
.../api/domain/geospatial/MultiPoint.java | 38 -
.../api/domain/geospatial/MultiPolygon.java | 38 -
.../client/api/domain/geospatial/Point.java | 77 -
.../client/api/domain/geospatial/Polygon.java | 72 -
.../client/api/edm/xml/CommonAnnotations.java | 26 -
.../api/edm/xml/CommonFunctionImport.java | 22 -
.../api/edm/xml/CommonNavigationProperty.java | 22 -
.../client/api/edm/xml/CommonParameter.java | 33 -
.../client/api/edm/xml/CommonProperty.java | 49 -
.../odata4/client/api/edm/xml/ComplexType.java | 32 -
.../odata4/client/api/edm/xml/DataServices.java | 30 -
.../olingo/odata4/client/api/edm/xml/Edmx.java | 26 -
.../client/api/edm/xml/EntityContainer.java | 40 -
.../odata4/client/api/edm/xml/EntityKey.java | 26 -
.../odata4/client/api/edm/xml/EntitySet.java | 25 -
.../odata4/client/api/edm/xml/EntityType.java | 32 -
.../odata4/client/api/edm/xml/EnumType.java | 34 -
.../odata4/client/api/edm/xml/Member.java | 26 -
.../olingo/odata4/client/api/edm/xml/Named.java | 24 -
.../odata4/client/api/edm/xml/OnDelete.java | 24 -
.../client/api/edm/xml/OnDeleteAction.java | 28 -
.../odata4/client/api/edm/xml/PropertyRef.java | 25 -
.../odata4/client/api/edm/xml/Schema.java | 74 -
.../odata4/client/api/edm/xml/XMLMetadata.java | 59 -
.../client/api/edm/xml/v3/Annotations.java | 29 -
.../client/api/edm/xml/v3/Association.java | 30 -
.../client/api/edm/xml/v3/AssociationEnd.java | 32 -
.../client/api/edm/xml/v3/AssociationSet.java | 29 -
.../api/edm/xml/v3/AssociationSetEnd.java | 26 -
.../client/api/edm/xml/v3/FunctionImport.java | 43 -
.../api/edm/xml/v3/NavigationProperty.java | 29 -
.../odata4/client/api/edm/xml/v3/Parameter.java | 24 -
.../client/api/edm/xml/v3/ParameterMode.java | 27 -
.../odata4/client/api/edm/xml/v3/Property.java | 38 -
.../client/api/edm/xml/v3/PropertyValue.java | 43 -
.../api/edm/xml/v3/ReferentialConstraint.java | 26 -
.../edm/xml/v3/ReferentialConstraintRole.java | 30 -
.../client/api/edm/xml/v3/TypeAnnotation.java | 31 -
.../odata4/client/api/edm/xml/v3/Using.java | 27 -
.../client/api/edm/xml/v3/ValueAnnotation.java | 45 -
.../odata4/client/api/edm/xml/v3/ValueTerm.java | 26 -
.../odata4/client/api/edm/xml/v4/Action.java | 36 -
.../client/api/edm/xml/v4/ActionImport.java | 24 -
.../client/api/edm/xml/v4/AnnotatedEdmItem.java | 24 -
.../client/api/edm/xml/v4/Annotation.java | 33 -
.../client/api/edm/xml/v4/Annotations.java | 29 -
.../client/api/edm/xml/v4/BindingTarget.java | 27 -
.../client/api/edm/xml/v4/CSDLElement.java | 37 -
.../client/api/edm/xml/v4/ComplexType.java | 43 -
.../odata4/client/api/edm/xml/v4/Edmx.java | 26 -
.../client/api/edm/xml/v4/EntityContainer.java | 44 -
.../odata4/client/api/edm/xml/v4/EntitySet.java | 24 -
.../client/api/edm/xml/v4/EntityType.java | 23 -
.../odata4/client/api/edm/xml/v4/Function.java | 24 -
.../client/api/edm/xml/v4/FunctionImport.java | 28 -
.../odata4/client/api/edm/xml/v4/Include.java | 26 -
.../api/edm/xml/v4/IncludeAnnotations.java | 28 -
.../api/edm/xml/v4/NavigationProperty.java | 39 -
.../edm/xml/v4/NavigationPropertyBinding.java | 27 -
.../client/api/edm/xml/v4/OperationImport.java | 28 -
.../odata4/client/api/edm/xml/v4/Parameter.java | 24 -
.../odata4/client/api/edm/xml/v4/Property.java | 25 -
.../odata4/client/api/edm/xml/v4/Reference.java | 33 -
.../api/edm/xml/v4/ReferentialConstraint.java | 27 -
.../client/api/edm/xml/v4/ReturnType.java | 34 -
.../odata4/client/api/edm/xml/v4/Schema.java | 64 -
.../odata4/client/api/edm/xml/v4/Singleton.java | 25 -
.../odata4/client/api/edm/xml/v4/Term.java | 43 -
.../client/api/edm/xml/v4/TypeDefinition.java | 39 -
.../client/api/edm/xml/v4/XMLMetadata.java | 36 -
.../xml/v4/annotation/ConstExprConstruct.java | 56 -
.../edm/xml/v4/annotation/DynExprConstruct.java | 23 -
.../edm/xml/v4/annotation/ExprConstruct.java | 23 -
.../odata4/client/api/format/ODataFormat.java | 97 -
.../client/api/format/ODataMediaFormat.java | 71 -
.../client/api/format/ODataPubFormat.java | 97 -
.../client/api/format/ODataValueFormat.java | 76 -
.../client/api/http/HttpClientException.java | 68 -
.../client/api/http/HttpClientFactory.java | 30 -
.../odata4/client/api/http/HttpMethod.java | 33 -
.../client/api/http/HttpUriRequestFactory.java | 30 -
.../client/api/http/NoContentException.java | 36 -
.../odata4/client/api/op/ODataBinder.java | 121 -
.../odata4/client/api/op/ODataDeserializer.java | 93 -
.../odata4/client/api/op/ODataReader.java | 103 -
.../odata4/client/api/op/ODataSerializer.java | 118 -
.../client/api/op/ODataV3Deserializer.java | 23 -
.../client/api/op/ODataV4Deserializer.java | 29 -
.../odata4/client/api/uri/QueryOption.java | 95 -
.../odata4/client/api/uri/SegmentType.java | 66 -
.../odata4/client/api/uri/URIBuilder.java | 224 -
.../odata4/client/api/uri/V3URIBuilder.java | 47 -
.../odata4/client/api/uri/V4URIBuilder.java | 87 -
.../odata4/client/api/uri/filter/FilterArg.java | 30 -
.../client/api/uri/filter/FilterArgFactory.java | 83 -
.../client/api/uri/filter/FilterFactory.java | 61 -
.../odata4/client/api/uri/filter/URIFilter.java | 32 -
.../api/uri/filter/V3FilterArgFactory.java | 25 -
.../client/api/uri/filter/V3FilterFactory.java | 26 -
.../api/uri/filter/V4FilterArgFactory.java | 55 -
.../client/api/uri/filter/V4FilterFactory.java | 32 -
.../odata4/client/api/utils/EdmTypeInfo.java | 81 -
.../odata4/client/api/utils/XMLUtils.java | 176 -
.../client/core/AbstractConfiguration.java | 198 +
.../olingo/client/core/AbstractODataClient.java | 37 +
.../olingo/client/core/ODataClientFactory.java | 37 +
.../olingo/client/core/ODataV3ClientImpl.java | 146 +
.../olingo/client/core/ODataV4ClientImpl.java | 146 +
.../olingo/client/core/V3ConfigurationImpl.java | 57 +
.../olingo/client/core/V4ConfigurationImpl.java | 31 +
.../core/data/AbstractServiceDocument.java | 146 +
.../data/JSONServiceDocumentDeserializer.java | 84 +
.../core/data/ODataJacksonDeserializer.java | 45 +
.../core/data/ODataJacksonSerializer.java | 45 +
.../core/data/ServiceDocumentItemImpl.java | 79 +
.../data/XMLServiceDocumentDeserializer.java | 120 +
.../core/data/v3/JSONServiceDocumentImpl.java | 67 +
.../core/data/v3/XMLServiceDocumentImpl.java | 48 +
.../core/data/v4/AbstractServiceDocument.java | 89 +
.../core/data/v4/JSONServiceDocumentImpl.java | 43 +
.../core/data/v4/XMLServiceDocumentImpl.java | 29 +
.../deserializer/AnnotationPropertyImpl.java | 53 +
.../core/deserializer/ComplexValueImpl.java | 82 +
.../client/core/deserializer/EntityImpl.java | 126 +
.../core/deserializer/EntitySetBuilder.java | 72 +
.../client/core/deserializer/EntitySetImpl.java | 120 +
.../client/core/deserializer/JsonReader.java | 89 +
.../deserializer/NavigationPropertyImpl.java | 89 +
.../core/deserializer/PrimitiveValue.java | 51 +
.../core/deserializer/PropertyCollection.java | 96 +
.../deserializer/PropertyCollectionBuilder.java | 221 +
.../deserializer/StructuralPropertyImpl.java | 83 +
.../edm/AbstractEdmServiceMetadataImpl.java | 99 +
.../olingo/client/core/edm/EdmActionImpl.java | 37 +
.../client/core/edm/EdmActionImportImpl.java | 45 +
.../client/core/edm/EdmBindingTargetImpl.java | 79 +
.../olingo/client/core/edm/EdmClientImpl.java | 371 ++
.../client/core/edm/EdmComplexTypeImpl.java | 68 +
.../client/core/edm/EdmEntityContainerImpl.java | 125 +
.../client/core/edm/EdmEntitySetImpl.java | 35 +
.../client/core/edm/EdmEntityTypeImpl.java | 80 +
.../olingo/client/core/edm/EdmEnumTypeImpl.java | 84 +
.../olingo/client/core/edm/EdmFunctionImpl.java | 44 +
.../client/core/edm/EdmFunctionImportImpl.java | 48 +
.../client/core/edm/EdmKeyPropertyRefImpl.java | 49 +
.../core/edm/EdmNavigationPropertyImpl.java | 75 +
.../client/core/edm/EdmOperationImpl.java | 61 +
.../client/core/edm/EdmOperationImportImpl.java | 34 +
.../client/core/edm/EdmParameterImpl.java | 74 +
.../olingo/client/core/edm/EdmPropertyImpl.java | 91 +
.../client/core/edm/EdmReturnTypeImpl.java | 68 +
.../client/core/edm/EdmSingletonImpl.java | 35 +
.../core/edm/EdmStructuredTypeHelperImpl.java | 72 +
.../client/core/edm/EdmTypeDefinitionImpl.java | 74 +
.../core/edm/v3/EdmActionImportProxy.java | 45 +
.../client/core/edm/v3/EdmActionProxy.java | 39 +
.../client/core/edm/v3/EdmEntitySetProxy.java | 102 +
.../core/edm/v3/EdmFunctionImportProxy.java | 48 +
.../client/core/edm/v3/EdmFunctionProxy.java | 43 +
.../client/core/edm/v3/EdmOperationProxy.java | 65 +
.../core/edm/v3/EdmServiceMetadataImpl.java | 98 +
.../client/core/edm/v3/ReturnTypeProxy.java | 62 +
.../core/edm/v3/V3FunctionImportUtils.java | 36 +
.../core/edm/v4/EdmServiceMetadataImpl.java | 105 +
.../core/edm/xml/AbstractAnnotations.java | 51 +
.../core/edm/xml/AbstractComplexType.java | 53 +
.../core/edm/xml/AbstractDataServices.java | 51 +
.../client/core/edm/xml/AbstractEdmItem.java | 62 +
.../client/core/edm/xml/AbstractEdmx.java | 52 +
.../core/edm/xml/AbstractEntityContainer.java | 105 +
.../client/core/edm/xml/AbstractEntitySet.java | 52 +
.../client/core/edm/xml/AbstractEntityType.java | 87 +
.../client/core/edm/xml/AbstractEnumType.java | 97 +
.../client/core/edm/xml/AbstractMember.java | 52 +
.../edm/xml/AbstractNavigationProperty.java | 40 +
.../client/core/edm/xml/AbstractParameter.java | 95 +
.../client/core/edm/xml/AbstractProperty.java | 174 +
.../client/core/edm/xml/AbstractSchema.java | 70 +
.../core/edm/xml/AbstractXMLMetadata.java | 96 +
.../core/edm/xml/DataServicesDeserializer.java | 66 +
.../client/core/edm/xml/EdmxDeserializer.java | 69 +
.../client/core/edm/xml/EntityKeyImpl.java | 41 +
.../client/core/edm/xml/OnDeleteImpl.java | 42 +
.../core/edm/xml/ParameterDeserializer.java | 71 +
.../core/edm/xml/PropertyDeserializer.java | 104 +
.../client/core/edm/xml/PropertyRefImpl.java | 53 +
.../edm/xml/v3/AnnotationsDeserializer.java | 57 +
.../client/core/edm/xml/v3/AnnotationsImpl.java | 50 +
.../edm/xml/v3/AssociationDeserializer.java | 55 +
.../core/edm/xml/v3/AssociationEndImpl.java | 78 +
.../client/core/edm/xml/v3/AssociationImpl.java | 64 +
.../edm/xml/v3/AssociationSetDeserializer.java | 54 +
.../core/edm/xml/v3/AssociationSetEndImpl.java | 53 +
.../core/edm/xml/v3/AssociationSetImpl.java | 63 +
.../client/core/edm/xml/v3/ComplexTypeImpl.java | 55 +
.../core/edm/xml/v3/DataServicesImpl.java | 38 +
.../olingo/client/core/edm/xml/v3/EdmxImpl.java | 32 +
.../core/edm/xml/v3/EntityContainerImpl.java | 69 +
.../client/core/edm/xml/v3/EntitySetImpl.java | 27 +
.../client/core/edm/xml/v3/EntityTypeImpl.java | 54 +
.../client/core/edm/xml/v3/EnumTypeImpl.java | 38 +
.../edm/xml/v3/FunctionImportDeserializer.java | 69 +
.../core/edm/xml/v3/FunctionImportImpl.java | 140 +
.../client/core/edm/xml/v3/MemberImpl.java | 27 +
.../core/edm/xml/v3/NavigationPropertyImpl.java | 66 +
.../client/core/edm/xml/v3/ParameterImpl.java | 40 +
.../client/core/edm/xml/v3/PropertyImpl.java | 95 +
.../core/edm/xml/v3/PropertyValueImpl.java | 129 +
.../edm/xml/v3/ReferentialConstraintImpl.java | 57 +
.../ReferentialConstraintRoleDeserializer.java | 53 +
.../xml/v3/ReferentialConstraintRoleImpl.java | 51 +
.../client/core/edm/xml/v3/SchemaImpl.java | 138 +
.../edm/xml/v3/TypeAnnotationDeserializer.java | 54 +
.../core/edm/xml/v3/TypeAnnotationImpl.java | 64 +
.../client/core/edm/xml/v3/UsingImpl.java | 53 +
.../core/edm/xml/v3/ValueAnnotationImpl.java | 141 +
.../client/core/edm/xml/v3/ValueTermImpl.java | 53 +
.../client/core/edm/xml/v3/XMLMetadataImpl.java | 31 +
.../edm/xml/v4/AbstractAnnotatedEdmItem.java | 45 +
.../core/edm/xml/v4/ActionDeserializer.java | 62 +
.../client/core/edm/xml/v4/ActionImpl.java | 91 +
.../core/edm/xml/v4/ActionImportImpl.java | 66 +
.../core/edm/xml/v4/AnnotationDeserializer.java | 59 +
.../client/core/edm/xml/v4/AnnotationImpl.java | 77 +
.../edm/xml/v4/AnnotationsDeserializer.java | 55 +
.../client/core/edm/xml/v4/AnnotationsImpl.java | 51 +
.../client/core/edm/xml/v4/ComplexTypeImpl.java | 102 +
.../core/edm/xml/v4/DataServicesImpl.java | 38 +
.../olingo/client/core/edm/xml/v4/EdmxImpl.java | 44 +
.../core/edm/xml/v4/EntityContainerImpl.java | 129 +
.../client/core/edm/xml/v4/EntitySetImpl.java | 62 +
.../client/core/edm/xml/v4/EntityTypeImpl.java | 69 +
.../client/core/edm/xml/v4/EnumTypeImpl.java | 40 +
.../core/edm/xml/v4/FunctionDeserializer.java | 64 +
.../client/core/edm/xml/v4/FunctionImpl.java | 41 +
.../core/edm/xml/v4/FunctionImportImpl.java | 93 +
.../core/edm/xml/v4/IncludeAnnotationsImpl.java | 66 +
.../client/core/edm/xml/v4/IncludeImpl.java | 54 +
.../client/core/edm/xml/v4/MemberImpl.java | 45 +
.../xml/v4/NavigationPropertyBindingImpl.java | 54 +
.../xml/v4/NavigationPropertyDeserializer.java | 70 +
.../core/edm/xml/v4/NavigationPropertyImpl.java | 110 +
.../client/core/edm/xml/v4/ParameterImpl.java | 39 +
.../client/core/edm/xml/v4/PropertyImpl.java | 42 +
.../core/edm/xml/v4/ReferenceDeserializer.java | 60 +
.../client/core/edm/xml/v4/ReferenceImpl.java | 70 +
.../edm/xml/v4/ReferentialConstraintImpl.java | 53 +
.../core/edm/xml/v4/ReturnTypeDeserializer.java | 62 +
.../client/core/edm/xml/v4/ReturnTypeImpl.java | 97 +
.../client/core/edm/xml/v4/SchemaImpl.java | 181 +
.../core/edm/xml/v4/SingletonDeserializer.java | 59 +
.../client/core/edm/xml/v4/SingletonImpl.java | 63 +
.../core/edm/xml/v4/TermDeserializer.java | 77 +
.../olingo/client/core/edm/xml/v4/TermImpl.java | 140 +
.../edm/xml/v4/TypeDefinitionDeserializer.java | 66 +
.../core/edm/xml/v4/TypeDefinitionImpl.java | 119 +
.../client/core/edm/xml/v4/XMLMetadataImpl.java | 56 +
.../annotation/AbstractElOrAttrConstruct.java | 37 +
.../annotation/AnnotatedDynExprConstruct.java | 38 +
.../edm/xml/v4/annotation/AnnotationPath.java | 25 +
.../core/edm/xml/v4/annotation/Apply.java | 55 +
.../xml/v4/annotation/ApplyDeserializer.java | 57 +
.../client/core/edm/xml/v4/annotation/Cast.java | 92 +
.../edm/xml/v4/annotation/CastDeserializer.java | 64 +
.../core/edm/xml/v4/annotation/Collection.java | 39 +
.../v4/annotation/CollectionDeserializer.java | 52 +
.../v4/annotation/ConstExprConstructImpl.java | 51 +
.../DynExprConstructDeserializer.java | 147 +
.../xml/v4/annotation/DynExprConstructImpl.java | 30 +
.../xml/v4/annotation/DynExprDoubleParamOp.java | 73 +
.../xml/v4/annotation/DynExprSingleParamOp.java | 69 +
.../xml/v4/annotation/ExprConstructImpl.java | 28 +
.../client/core/edm/xml/v4/annotation/If.java | 57 +
.../client/core/edm/xml/v4/annotation/IsOf.java | 92 +
.../edm/xml/v4/annotation/IsOfDeserializer.java | 64 +
.../edm/xml/v4/annotation/LabeledElement.java | 50 +
.../annotation/LabeledElementDeserializer.java | 55 +
.../v4/annotation/LabeledElementReference.java | 25 +
.../v4/annotation/NavigationPropertyPath.java | 25 +
.../client/core/edm/xml/v4/annotation/Null.java | 28 +
.../edm/xml/v4/annotation/NullDeserializer.java | 51 +
.../client/core/edm/xml/v4/annotation/Path.java | 25 +
.../edm/xml/v4/annotation/PropertyPath.java | 25 +
.../edm/xml/v4/annotation/PropertyValue.java | 50 +
.../annotation/PropertyValueDeserializer.java | 57 +
.../core/edm/xml/v4/annotation/Record.java | 46 +
.../xml/v4/annotation/RecordDeserializer.java | 55 +
.../core/edm/xml/v4/annotation/UrlRef.java | 40 +
.../xml/v4/annotation/UrlRefDeserializer.java | 52 +
.../AbstractBasicAuthHttpClientFactory.java | 51 +
.../http/AbstractNTLMAuthHttpClientFactory.java | 63 +
.../core/http/DefaultHttpClientFactory.java | 40 +
.../core/http/DefaultHttpUriRequestFactory.java | 69 +
.../olingo/client/core/http/HttpMerge.java | 70 +
.../olingo/client/core/http/HttpPatch.java | 70 +
.../core/op/impl/AbstractEdmDeserializer.java | 71 +
.../core/op/impl/AbstractJacksonTool.java | 85 +
.../core/op/impl/AbstractODataBinder.java | 582 ++
.../core/op/impl/AbstractODataDeserializer.java | 178 +
.../core/op/impl/AbstractODataReader.java | 138 +
.../core/op/impl/AbstractODataSerializer.java | 161 +
.../core/op/impl/ComplexTypeDeserializer.java | 83 +
.../op/impl/EntityContainerDeserializer.java | 102 +
.../core/op/impl/EntityKeyDeserializer.java | 50 +
.../core/op/impl/EntitySetDeserializer.java | 70 +
.../core/op/impl/EntityTypeDeserializer.java | 92 +
.../core/op/impl/EnumTypeDeserializer.java | 73 +
.../op/impl/InjectableSerializerProvider.java | 43 +
.../client/core/op/impl/ODataV3BinderImpl.java | 37 +
.../core/op/impl/ODataV3DeserializerImpl.java | 70 +
.../client/core/op/impl/ODataV3ReaderImpl.java | 48 +
.../core/op/impl/ODataV3SerializerImpl.java | 32 +
.../client/core/op/impl/ODataV4BinderImpl.java | 62 +
.../core/op/impl/ODataV4DeserializerImpl.java | 71 +
.../client/core/op/impl/ODataV4ReaderImpl.java | 48 +
.../core/op/impl/ODataV4SerializerImpl.java | 32 +
.../client/core/op/impl/SchemaDeserializer.java | 149 +
.../client/core/uri/AbstractURIBuilder.java | 274 +
.../apache/olingo/client/core/uri/URIUtils.java | 196 +
.../client/core/uri/V3URIBuilderImpl.java | 94 +
.../client/core/uri/V4URIBuilderImpl.java | 101 +
.../uri/filter/AbstractComparingFilter.java | 45 +
.../uri/filter/AbstractFilterArgFactory.java | 178 +
.../core/uri/filter/AbstractFilterFactory.java | 108 +
.../client/core/uri/filter/AndFilter.java | 42 +
.../olingo/client/core/uri/filter/EqFilter.java | 33 +
.../client/core/uri/filter/FilterConst.java | 41 +
.../client/core/uri/filter/FilterFunction.java | 48 +
.../client/core/uri/filter/FilterLambda.java | 46 +
.../client/core/uri/filter/FilterLiteral.java | 41 +
.../olingo/client/core/uri/filter/FilterOp.java | 45 +
.../client/core/uri/filter/FilterProperty.java | 40 +
.../olingo/client/core/uri/filter/GeFilter.java | 33 +
.../olingo/client/core/uri/filter/GtFilter.java | 33 +
.../client/core/uri/filter/HasFilter.java | 34 +
.../olingo/client/core/uri/filter/LeFilter.java | 33 +
.../olingo/client/core/uri/filter/LtFilter.java | 33 +
.../client/core/uri/filter/MatchFilter.java | 36 +
.../olingo/client/core/uri/filter/NeFilter.java | 33 +
.../client/core/uri/filter/NotFilter.java | 35 +
.../olingo/client/core/uri/filter/OrFilter.java | 42 +
.../core/uri/filter/V3FilterArgFactoryImpl.java | 31 +
.../core/uri/filter/V3FilterFactoryImpl.java | 33 +
.../core/uri/filter/V4FilterArgFactoryImpl.java | 107 +
.../core/uri/filter/V4FilterFactoryImpl.java | 46 +
.../client/core/xml/AbstractDOMParser.java | 46 +
.../client/core/xml/AndroidDOMParserImpl.java | 53 +
.../client/core/xml/DefaultDOMParserImpl.java | 78 +
.../olingo/client/core/xml/XMLParser.java | 37 +
.../client/core/AbstractConfiguration.java | 197 -
.../odata4/client/core/AbstractODataClient.java | 37 -
.../odata4/client/core/ODataClientFactory.java | 37 -
.../odata4/client/core/ODataV3ClientImpl.java | 146 -
.../odata4/client/core/ODataV4ClientImpl.java | 146 -
.../odata4/client/core/V3ConfigurationImpl.java | 57 -
.../odata4/client/core/V4ConfigurationImpl.java | 31 -
.../core/data/AbstractServiceDocument.java | 145 -
.../data/JSONServiceDocumentDeserializer.java | 82 -
.../core/data/ODataJacksonDeserializer.java | 43 -
.../core/data/ODataJacksonSerializer.java | 43 -
.../core/data/ServiceDocumentItemImpl.java | 78 -
.../data/XMLServiceDocumentDeserializer.java | 118 -
.../core/data/v3/JSONServiceDocumentImpl.java | 65 -
.../core/data/v3/XMLServiceDocumentImpl.java | 46 -
.../core/data/v4/AbstractServiceDocument.java | 88 -
.../core/data/v4/JSONServiceDocumentImpl.java | 41 -
.../core/data/v4/XMLServiceDocumentImpl.java | 28 -
.../deserializer/AnnotationPropertyImpl.java | 53 -
.../core/deserializer/ComplexValueImpl.java | 82 -
.../client/core/deserializer/EntityImpl.java | 126 -
.../core/deserializer/EntitySetBuilder.java | 72 -
.../client/core/deserializer/EntitySetImpl.java | 120 -
.../client/core/deserializer/JsonReader.java | 89 -
.../deserializer/NavigationPropertyImpl.java | 89 -
.../core/deserializer/PrimitiveValue.java | 51 -
.../core/deserializer/PropertyCollection.java | 96 -
.../deserializer/PropertyCollectionBuilder.java | 220 -
.../deserializer/StructuralPropertyImpl.java | 83 -
.../edm/AbstractEdmServiceMetadataImpl.java | 98 -
.../odata4/client/core/edm/EdmActionImpl.java | 37 -
.../client/core/edm/EdmActionImportImpl.java | 45 -
.../client/core/edm/EdmBindingTargetImpl.java | 78 -
.../odata4/client/core/edm/EdmClientImpl.java | 370 --
.../client/core/edm/EdmComplexTypeImpl.java | 67 -
.../client/core/edm/EdmEntityContainerImpl.java | 125 -
.../client/core/edm/EdmEntitySetImpl.java | 35 -
.../client/core/edm/EdmEntityTypeImpl.java | 79 -
.../odata4/client/core/edm/EdmEnumTypeImpl.java | 83 -
.../odata4/client/core/edm/EdmFunctionImpl.java | 44 -
.../client/core/edm/EdmFunctionImportImpl.java | 47 -
.../client/core/edm/EdmKeyPropertyRefImpl.java | 49 -
.../core/edm/EdmNavigationPropertyImpl.java | 74 -
.../client/core/edm/EdmOperationImpl.java | 60 -
.../client/core/edm/EdmOperationImportImpl.java | 34 -
.../client/core/edm/EdmParameterImpl.java | 74 -
.../odata4/client/core/edm/EdmPropertyImpl.java | 91 -
.../client/core/edm/EdmReturnTypeImpl.java | 68 -
.../client/core/edm/EdmSingletonImpl.java | 35 -
.../core/edm/EdmStructuredTypeHelperImpl.java | 71 -
.../client/core/edm/EdmTypeDefinitionImpl.java | 74 -
.../core/edm/v3/EdmActionImportProxy.java | 45 -
.../client/core/edm/v3/EdmActionProxy.java | 39 -
.../client/core/edm/v3/EdmEntitySetProxy.java | 101 -
.../core/edm/v3/EdmFunctionImportProxy.java | 47 -
.../client/core/edm/v3/EdmFunctionProxy.java | 43 -
.../client/core/edm/v3/EdmOperationProxy.java | 64 -
.../core/edm/v3/EdmServiceMetadataImpl.java | 97 -
.../client/core/edm/v3/ReturnTypeProxy.java | 62 -
.../core/edm/v3/V3FunctionImportUtils.java | 36 -
.../core/edm/v4/EdmServiceMetadataImpl.java | 104 -
.../core/edm/xml/AbstractAnnotations.java | 51 -
.../core/edm/xml/AbstractComplexType.java | 52 -
.../core/edm/xml/AbstractDataServices.java | 50 -
.../client/core/edm/xml/AbstractEdmItem.java | 61 -
.../client/core/edm/xml/AbstractEdmx.java | 51 -
.../core/edm/xml/AbstractEntityContainer.java | 103 -
.../client/core/edm/xml/AbstractEntitySet.java | 51 -
.../client/core/edm/xml/AbstractEntityType.java | 86 -
.../client/core/edm/xml/AbstractEnumType.java | 95 -
.../client/core/edm/xml/AbstractMember.java | 51 -
.../edm/xml/AbstractNavigationProperty.java | 39 -
.../client/core/edm/xml/AbstractParameter.java | 94 -
.../client/core/edm/xml/AbstractProperty.java | 173 -
.../client/core/edm/xml/AbstractSchema.java | 69 -
.../core/edm/xml/AbstractXMLMetadata.java | 95 -
.../core/edm/xml/DataServicesDeserializer.java | 64 -
.../client/core/edm/xml/EdmxDeserializer.java | 67 -
.../client/core/edm/xml/EntityKeyImpl.java | 39 -
.../client/core/edm/xml/OnDeleteImpl.java | 41 -
.../core/edm/xml/ParameterDeserializer.java | 69 -
.../core/edm/xml/PropertyDeserializer.java | 102 -
.../client/core/edm/xml/PropertyRefImpl.java | 52 -
.../edm/xml/v3/AnnotationsDeserializer.java | 55 -
.../client/core/edm/xml/v3/AnnotationsImpl.java | 48 -
.../edm/xml/v3/AssociationDeserializer.java | 53 -
.../core/edm/xml/v3/AssociationEndImpl.java | 77 -
.../client/core/edm/xml/v3/AssociationImpl.java | 62 -
.../edm/xml/v3/AssociationSetDeserializer.java | 52 -
.../core/edm/xml/v3/AssociationSetEndImpl.java | 52 -
.../core/edm/xml/v3/AssociationSetImpl.java | 61 -
.../client/core/edm/xml/v3/ComplexTypeImpl.java | 54 -
.../core/edm/xml/v3/DataServicesImpl.java | 37 -
.../odata4/client/core/edm/xml/v3/EdmxImpl.java | 32 -
.../core/edm/xml/v3/EntityContainerImpl.java | 68 -
.../client/core/edm/xml/v3/EntitySetImpl.java | 27 -
.../client/core/edm/xml/v3/EntityTypeImpl.java | 53 -
.../client/core/edm/xml/v3/EnumTypeImpl.java | 37 -
.../edm/xml/v3/FunctionImportDeserializer.java | 67 -
.../core/edm/xml/v3/FunctionImportImpl.java | 138 -
.../client/core/edm/xml/v3/MemberImpl.java | 27 -
.../core/edm/xml/v3/NavigationPropertyImpl.java | 65 -
.../client/core/edm/xml/v3/ParameterImpl.java | 40 -
.../client/core/edm/xml/v3/PropertyImpl.java | 95 -
.../core/edm/xml/v3/PropertyValueImpl.java | 127 -
.../edm/xml/v3/ReferentialConstraintImpl.java | 56 -
.../ReferentialConstraintRoleDeserializer.java | 51 -
.../xml/v3/ReferentialConstraintRoleImpl.java | 49 -
.../client/core/edm/xml/v3/SchemaImpl.java | 137 -
.../edm/xml/v3/TypeAnnotationDeserializer.java | 52 -
.../core/edm/xml/v3/TypeAnnotationImpl.java | 62 -
.../client/core/edm/xml/v3/UsingImpl.java | 52 -
.../core/edm/xml/v3/ValueAnnotationImpl.java | 139 -
.../client/core/edm/xml/v3/ValueTermImpl.java | 52 -
.../client/core/edm/xml/v3/XMLMetadataImpl.java | 31 -
.../edm/xml/v4/AbstractAnnotatedEdmItem.java | 44 -
.../core/edm/xml/v4/ActionDeserializer.java | 60 -
.../client/core/edm/xml/v4/ActionImpl.java | 89 -
.../core/edm/xml/v4/ActionImportImpl.java | 65 -
.../core/edm/xml/v4/AnnotationDeserializer.java | 57 -
.../client/core/edm/xml/v4/AnnotationImpl.java | 76 -
.../edm/xml/v4/AnnotationsDeserializer.java | 53 -
.../client/core/edm/xml/v4/AnnotationsImpl.java | 49 -
.../client/core/edm/xml/v4/ComplexTypeImpl.java | 101 -
.../core/edm/xml/v4/DataServicesImpl.java | 37 -
.../odata4/client/core/edm/xml/v4/EdmxImpl.java | 43 -
.../core/edm/xml/v4/EntityContainerImpl.java | 128 -
.../client/core/edm/xml/v4/EntitySetImpl.java | 61 -
.../client/core/edm/xml/v4/EntityTypeImpl.java | 68 -
.../client/core/edm/xml/v4/EnumTypeImpl.java | 40 -
.../core/edm/xml/v4/FunctionDeserializer.java | 62 -
.../client/core/edm/xml/v4/FunctionImpl.java | 40 -
.../core/edm/xml/v4/FunctionImportImpl.java | 92 -
.../core/edm/xml/v4/IncludeAnnotationsImpl.java | 65 -
.../client/core/edm/xml/v4/IncludeImpl.java | 53 -
.../client/core/edm/xml/v4/MemberImpl.java | 44 -
.../xml/v4/NavigationPropertyBindingImpl.java | 53 -
.../xml/v4/NavigationPropertyDeserializer.java | 67 -
.../core/edm/xml/v4/NavigationPropertyImpl.java | 108 -
.../client/core/edm/xml/v4/ParameterImpl.java | 39 -
.../client/core/edm/xml/v4/PropertyImpl.java | 41 -
.../core/edm/xml/v4/ReferenceDeserializer.java | 58 -
.../client/core/edm/xml/v4/ReferenceImpl.java | 68 -
.../edm/xml/v4/ReferentialConstraintImpl.java | 52 -
.../core/edm/xml/v4/ReturnTypeDeserializer.java | 60 -
.../client/core/edm/xml/v4/ReturnTypeImpl.java | 96 -
.../client/core/edm/xml/v4/SchemaImpl.java | 180 -
.../core/edm/xml/v4/SingletonDeserializer.java | 57 -
.../client/core/edm/xml/v4/SingletonImpl.java | 61 -
.../core/edm/xml/v4/TermDeserializer.java | 75 -
.../odata4/client/core/edm/xml/v4/TermImpl.java | 138 -
.../edm/xml/v4/TypeDefinitionDeserializer.java | 64 -
.../core/edm/xml/v4/TypeDefinitionImpl.java | 117 -
.../client/core/edm/xml/v4/XMLMetadataImpl.java | 55 -
.../annotation/AbstractElOrAttrConstruct.java | 37 -
.../annotation/AnnotatedDynExprConstruct.java | 38 -
.../edm/xml/v4/annotation/AnnotationPath.java | 25 -
.../core/edm/xml/v4/annotation/Apply.java | 53 -
.../xml/v4/annotation/ApplyDeserializer.java | 55 -
.../client/core/edm/xml/v4/annotation/Cast.java | 90 -
.../edm/xml/v4/annotation/CastDeserializer.java | 62 -
.../core/edm/xml/v4/annotation/Collection.java | 37 -
.../v4/annotation/CollectionDeserializer.java | 50 -
.../v4/annotation/ConstExprConstructImpl.java | 51 -
.../DynExprConstructDeserializer.java | 145 -
.../xml/v4/annotation/DynExprConstructImpl.java | 29 -
.../xml/v4/annotation/DynExprDoubleParamOp.java | 73 -
.../xml/v4/annotation/DynExprSingleParamOp.java | 69 -
.../xml/v4/annotation/ExprConstructImpl.java | 28 -
.../client/core/edm/xml/v4/annotation/If.java | 57 -
.../client/core/edm/xml/v4/annotation/IsOf.java | 90 -
.../edm/xml/v4/annotation/IsOfDeserializer.java | 62 -
.../edm/xml/v4/annotation/LabeledElement.java | 49 -
.../annotation/LabeledElementDeserializer.java | 53 -
.../v4/annotation/LabeledElementReference.java | 25 -
.../v4/annotation/NavigationPropertyPath.java | 25 -
.../client/core/edm/xml/v4/annotation/Null.java | 28 -
.../edm/xml/v4/annotation/NullDeserializer.java | 49 -
.../client/core/edm/xml/v4/annotation/Path.java | 25 -
.../edm/xml/v4/annotation/PropertyPath.java | 25 -
.../edm/xml/v4/annotation/PropertyValue.java | 49 -
.../annotation/PropertyValueDeserializer.java | 55 -
.../core/edm/xml/v4/annotation/Record.java | 46 -
.../xml/v4/annotation/RecordDeserializer.java | 53 -
.../core/edm/xml/v4/annotation/UrlRef.java | 39 -
.../xml/v4/annotation/UrlRefDeserializer.java | 50 -
.../AbstractBasicAuthHttpClientFactory.java | 50 -
.../http/AbstractNTLMAuthHttpClientFactory.java | 62 -
.../core/http/DefaultHttpClientFactory.java | 39 -
.../core/http/DefaultHttpUriRequestFactory.java | 68 -
.../odata4/client/core/http/HttpMerge.java | 70 -
.../odata4/client/core/http/HttpPatch.java | 70 -
.../core/op/impl/AbstractEdmDeserializer.java | 69 -
.../core/op/impl/AbstractJacksonTool.java | 83 -
.../core/op/impl/AbstractODataBinder.java | 581 --
.../core/op/impl/AbstractODataDeserializer.java | 177 -
.../core/op/impl/AbstractODataReader.java | 138 -
.../core/op/impl/AbstractODataSerializer.java | 160 -
.../core/op/impl/ComplexTypeDeserializer.java | 81 -
.../op/impl/EntityContainerDeserializer.java | 100 -
.../core/op/impl/EntityKeyDeserializer.java | 48 -
.../core/op/impl/EntitySetDeserializer.java | 68 -
.../core/op/impl/EntityTypeDeserializer.java | 90 -
.../core/op/impl/EnumTypeDeserializer.java | 71 -
.../op/impl/InjectableSerializerProvider.java | 43 -
.../client/core/op/impl/ODataV3BinderImpl.java | 37 -
.../core/op/impl/ODataV3DeserializerImpl.java | 69 -
.../client/core/op/impl/ODataV3ReaderImpl.java | 47 -
.../core/op/impl/ODataV3SerializerImpl.java | 32 -
.../client/core/op/impl/ODataV4BinderImpl.java | 62 -
.../core/op/impl/ODataV4DeserializerImpl.java | 70 -
.../client/core/op/impl/ODataV4ReaderImpl.java | 47 -
.../core/op/impl/ODataV4SerializerImpl.java | 32 -
.../client/core/op/impl/SchemaDeserializer.java | 147 -
.../client/core/uri/AbstractURIBuilder.java | 273 -
.../olingo/odata4/client/core/uri/URIUtils.java | 195 -
.../client/core/uri/V3URIBuilderImpl.java | 93 -
.../client/core/uri/V4URIBuilderImpl.java | 101 -
.../uri/filter/AbstractComparingFilter.java | 45 -
.../uri/filter/AbstractFilterArgFactory.java | 178 -
.../core/uri/filter/AbstractFilterFactory.java | 108 -
.../client/core/uri/filter/AndFilter.java | 42 -
.../odata4/client/core/uri/filter/EqFilter.java | 33 -
.../client/core/uri/filter/FilterConst.java | 41 -
.../client/core/uri/filter/FilterFunction.java | 48 -
.../client/core/uri/filter/FilterLambda.java | 46 -
.../client/core/uri/filter/FilterLiteral.java | 41 -
.../odata4/client/core/uri/filter/FilterOp.java | 45 -
.../client/core/uri/filter/FilterProperty.java | 40 -
.../odata4/client/core/uri/filter/GeFilter.java | 33 -
.../odata4/client/core/uri/filter/GtFilter.java | 33 -
.../client/core/uri/filter/HasFilter.java | 34 -
.../odata4/client/core/uri/filter/LeFilter.java | 33 -
.../odata4/client/core/uri/filter/LtFilter.java | 33 -
.../client/core/uri/filter/MatchFilter.java | 36 -
.../odata4/client/core/uri/filter/NeFilter.java | 33 -
.../client/core/uri/filter/NotFilter.java | 35 -
.../odata4/client/core/uri/filter/OrFilter.java | 42 -
.../core/uri/filter/V3FilterArgFactoryImpl.java | 31 -
.../core/uri/filter/V3FilterFactoryImpl.java | 33 -
.../core/uri/filter/V4FilterArgFactoryImpl.java | 107 -
.../core/uri/filter/V4FilterFactoryImpl.java | 46 -
.../client/core/xml/AbstractDOMParser.java | 46 -
.../client/core/xml/AndroidDOMParserImpl.java | 50 -
.../client/core/xml/DefaultDOMParserImpl.java | 78 -
.../odata4/client/core/xml/XMLParser.java | 37 -
.../apache/olingo/client/core/AbstractTest.java | 60 +
.../olingo/client/core/ODataClientTest.java | 41 +
.../deserializer/JsonReaderPerformance.java | 76 +
.../core/deserializer/JsonReaderTest.java | 372 ++
.../client/core/v3/FilterFactoryTest.java | 167 +
.../olingo/client/core/v3/MetadataTest.java | 224 +
.../client/core/v3/ServiceDocumentTest.java | 58 +
.../olingo/client/core/v3/URIBuilderTest.java | 131 +
.../client/core/v4/FilterFactoryTest.java | 85 +
.../olingo/client/core/v4/MetadataTest.java | 286 +
.../client/core/v4/ServiceDocumentTest.java | 68 +
.../olingo/client/core/v4/URIBuilderTest.java | 136 +
.../olingo/odata4/client/core/AbstractTest.java | 58 -
.../odata4/client/core/ODataClientTest.java | 40 -
.../deserializer/JsonReaderPerformance.java | 75 -
.../core/deserializer/JsonReaderTest.java | 371 --
.../client/core/v3/FilterFactoryTest.java | 166 -
.../odata4/client/core/v3/MetadataTest.java | 223 -
.../client/core/v3/ServiceDocumentTest.java | 57 -
.../odata4/client/core/v3/URIBuilderTest.java | 130 -
.../client/core/v4/FilterFactoryTest.java | 84 -
.../odata4/client/core/v4/MetadataTest.java | 286 -
.../client/core/v4/ServiceDocumentTest.java | 67 -
.../odata4/client/core/v4/URIBuilderTest.java | 133 -
.../apache/olingo/client/core/v3/metadata.xml | 721 +++
.../client/core/v3/northwind-metadata.xml | 22 +
.../olingo/client/core/v3/serviceDocument.json | 33 +
.../olingo/client/core/v3/serviceDocument.xml | 49 +
.../olingo/client/core/v4/demo-metadata.xml | 163 +
.../olingo/client/core/v4/fromdoc1-metadata.xml | 126 +
.../olingo/client/core/v4/fromdoc2-metadata.xml | 54 +
.../olingo/client/core/v4/fromdoc3-metadata.xml | 131 +
.../apache/olingo/client/core/v4/metadata.xml | 232 +
.../client/core/v4/northwind-metadata.xml | 471 ++
.../olingo/client/core/v4/serviceDocument.json | 32 +
.../olingo/client/core/v4/serviceDocument.xml | 46 +
.../olingo/odata4/client/core/v3/metadata.xml | 721 ---
.../client/core/v3/northwind-metadata.xml | 22 -
.../odata4/client/core/v3/serviceDocument.json | 33 -
.../odata4/client/core/v3/serviceDocument.xml | 49 -
.../odata4/client/core/v4/demo-metadata.xml | 163 -
.../odata4/client/core/v4/fromdoc1-metadata.xml | 126 -
.../odata4/client/core/v4/fromdoc2-metadata.xml | 54 -
.../odata4/client/core/v4/fromdoc3-metadata.xml | 131 -
.../olingo/odata4/client/core/v4/metadata.xml | 232 -
.../client/core/v4/northwind-metadata.xml | 471 --
.../odata4/client/core/v4/serviceDocument.json | 32 -
.../odata4/client/core/v4/serviceDocument.xml | 46 -
.../commons/api/ODataApplicationException.java | 37 +
.../olingo/commons/api/ODataException.java | 37 +
.../api/ODataNotImplementedException.java | 33 +
.../org/apache/olingo/commons/api/edm/Edm.java | 111 +
.../olingo/commons/api/edm/EdmAction.java | 26 +
.../olingo/commons/api/edm/EdmActionImport.java | 27 +
.../commons/api/edm/EdmActionImportInfo.java | 40 +
.../olingo/commons/api/edm/EdmAnnotatable.java | 30 +
.../olingo/commons/api/edm/EdmAnnotations.java | 24 +
.../commons/api/edm/EdmBindingTarget.java | 48 +
.../olingo/commons/api/edm/EdmComplexType.java | 31 +
.../olingo/commons/api/edm/EdmElement.java | 27 +
.../commons/api/edm/EdmEntityContainer.java | 66 +
.../olingo/commons/api/edm/EdmEntitySet.java | 29 +
.../commons/api/edm/EdmEntitySetInfo.java | 47 +
.../olingo/commons/api/edm/EdmEntityType.java | 64 +
.../olingo/commons/api/edm/EdmEnumType.java | 43 +
.../olingo/commons/api/edm/EdmException.java | 37 +
.../olingo/commons/api/edm/EdmFunction.java | 31 +
.../commons/api/edm/EdmFunctionImport.java | 30 +
.../commons/api/edm/EdmFunctionImportInfo.java | 40 +
.../commons/api/edm/EdmKeyPropertyRef.java | 43 +
.../olingo/commons/api/edm/EdmMappable.java | 32 +
.../olingo/commons/api/edm/EdmMapping.java | 53 +
.../olingo/commons/api/edm/EdmMember.java | 30 +
.../apache/olingo/commons/api/edm/EdmNamed.java | 30 +
.../commons/api/edm/EdmNavigationProperty.java | 40 +
.../olingo/commons/api/edm/EdmOperation.java | 57 +
.../commons/api/edm/EdmOperationImport.java | 36 +
.../commons/api/edm/EdmOperationImportInfo.java | 31 +
.../olingo/commons/api/edm/EdmParameter.java | 45 +
.../commons/api/edm/EdmPrimitiveType.java | 166 +
.../api/edm/EdmPrimitiveTypeException.java | 32 +
.../olingo/commons/api/edm/EdmProperty.java | 71 +
.../olingo/commons/api/edm/EdmReturnType.java | 45 +
.../commons/api/edm/EdmServiceMetadata.java | 59 +
.../olingo/commons/api/edm/EdmSingleton.java | 26 +
.../commons/api/edm/EdmSingletonInfo.java | 45 +
.../commons/api/edm/EdmStructuredType.java | 82 +
.../apache/olingo/commons/api/edm/EdmTerm.java | 50 +
.../apache/olingo/commons/api/edm/EdmType.java | 40 +
.../commons/api/edm/EdmTypeDefinition.java | 52 +
.../apache/olingo/commons/api/edm/EdmTyped.java | 37 +
.../commons/api/edm/FullQualifiedName.java | 84 +
.../apache/olingo/commons/api/edm/Target.java | 71 +
.../api/edm/constants/ConcurrencyMode.java | 26 +
.../api/edm/constants/EdmContentKind.java | 30 +
.../commons/api/edm/constants/EdmOnDelete.java | 25 +
.../api/edm/constants/EdmTargetPath.java | 50 +
.../commons/api/edm/constants/EdmTypeKind.java | 28 +
.../api/edm/constants/ODataServiceVersion.java | 140 +
.../edm/constants/StoreGeneratedPattern.java | 27 +
.../olingo/commons/api/edm/package-info.java | 19 +
.../commons/api/ODataApplicationException.java | 37 -
.../odata4/commons/api/ODataException.java | 37 -
.../api/ODataNotImplementedException.java | 33 -
.../olingo/odata4/commons/api/edm/Edm.java | 111 -
.../odata4/commons/api/edm/EdmAction.java | 26 -
.../odata4/commons/api/edm/EdmActionImport.java | 27 -
.../commons/api/edm/EdmActionImportInfo.java | 40 -
.../odata4/commons/api/edm/EdmAnnotatable.java | 30 -
.../odata4/commons/api/edm/EdmAnnotations.java | 24 -
.../commons/api/edm/EdmBindingTarget.java | 48 -
.../odata4/commons/api/edm/EdmComplexType.java | 31 -
.../odata4/commons/api/edm/EdmElement.java | 27 -
.../commons/api/edm/EdmEntityContainer.java | 66 -
.../odata4/commons/api/edm/EdmEntitySet.java | 29 -
.../commons/api/edm/EdmEntitySetInfo.java | 47 -
.../odata4/commons/api/edm/EdmEntityType.java | 64 -
.../odata4/commons/api/edm/EdmEnumType.java | 43 -
.../odata4/commons/api/edm/EdmException.java | 37 -
.../odata4/commons/api/edm/EdmFunction.java | 31 -
.../commons/api/edm/EdmFunctionImport.java | 30 -
.../commons/api/edm/EdmFunctionImportInfo.java | 40 -
.../commons/api/edm/EdmKeyPropertyRef.java | 43 -
.../odata4/commons/api/edm/EdmMappable.java | 32 -
.../odata4/commons/api/edm/EdmMapping.java | 53 -
.../odata4/commons/api/edm/EdmMember.java | 30 -
.../olingo/odata4/commons/api/edm/EdmNamed.java | 30 -
.../commons/api/edm/EdmNavigationProperty.java | 40 -
.../odata4/commons/api/edm/EdmOperation.java | 57 -
.../commons/api/edm/EdmOperationImport.java | 36 -
.../commons/api/edm/EdmOperationImportInfo.java | 31 -
.../odata4/commons/api/edm/EdmParameter.java | 45 -
.../commons/api/edm/EdmPrimitiveType.java | 166 -
.../api/edm/EdmPrimitiveTypeException.java | 32 -
.../odata4/commons/api/edm/EdmProperty.java | 71 -
.../odata4/commons/api/edm/EdmReturnType.java | 45 -
.../commons/api/edm/EdmServiceMetadata.java | 59 -
.../odata4/commons/api/edm/EdmSingleton.java | 26 -
.../commons/api/edm/EdmSingletonInfo.java | 45 -
.../commons/api/edm/EdmStructuredType.java | 82 -
.../olingo/odata4/commons/api/edm/EdmTerm.java | 50 -
.../olingo/odata4/commons/api/edm/EdmType.java | 40 -
.../commons/api/edm/EdmTypeDefinition.java | 52 -
.../olingo/odata4/commons/api/edm/EdmTyped.java | 37 -
.../commons/api/edm/FullQualifiedName.java | 84 -
.../olingo/odata4/commons/api/edm/Target.java | 71 -
.../api/edm/constants/ConcurrencyMode.java | 26 -
.../api/edm/constants/EdmContentKind.java | 30 -
.../commons/api/edm/constants/EdmOnDelete.java | 25 -
.../api/edm/constants/EdmTargetPath.java | 50 -
.../commons/api/edm/constants/EdmTypeKind.java | 28 -
.../api/edm/constants/ODataServiceVersion.java | 140 -
.../edm/constants/StoreGeneratedPattern.java | 27 -
.../odata4/commons/api/edm/package-info.java | 19 -
.../core/edm/AbstractEdmBindingTarget.java | 55 +
.../core/edm/AbstractEdmComplexType.java | 50 +
.../core/edm/AbstractEdmEntityContainer.java | 102 +
.../commons/core/edm/AbstractEdmEntityType.java | 114 +
.../commons/core/edm/AbstractEdmEnumType.java | 206 +
.../commons/core/edm/AbstractEdmImpl.java | 252 +
.../core/edm/AbstractEdmKeyPropertyRef.java | 80 +
.../core/edm/AbstractEdmNavigationProperty.java | 76 +
.../commons/core/edm/AbstractEdmOperation.java | 114 +
.../core/edm/AbstractEdmOperationImport.java | 63 +
.../commons/core/edm/AbstractEdmParameter.java | 87 +
.../commons/core/edm/AbstractEdmProperty.java | 70 +
.../commons/core/edm/AbstractEdmReturnType.java | 85 +
.../core/edm/AbstractEdmStructuredType.java | 129 +
.../core/edm/AbstractEdmTypeDefinition.java | 107 +
.../olingo/commons/core/edm/ActionMapKey.java | 67 +
.../core/edm/EdmActionImportInfoImpl.java | 45 +
.../olingo/commons/core/edm/EdmElementImpl.java | 29 +
.../commons/core/edm/EdmEntitySetInfoImpl.java | 52 +
.../core/edm/EdmFunctionImportInfoImpl.java | 45 +
.../olingo/commons/core/edm/EdmMemberImpl.java | 38 +
.../olingo/commons/core/edm/EdmNamedImpl.java | 40 +
.../core/edm/EdmOperationImportInfoImpl.java | 36 +
.../commons/core/edm/EdmSingletonInfoImpl.java | 52 +
.../core/edm/EdmStructuredTypeHelper.java | 31 +
.../olingo/commons/core/edm/EdmTypeImpl.java | 48 +
.../olingo/commons/core/edm/FunctionMapKey.java | 113 +
.../primitivetype/AbstractPrimitiveType.java | 116 +
.../core/edm/primitivetype/EdmBinary.java | 117 +
.../core/edm/primitivetype/EdmBoolean.java | 81 +
.../commons/core/edm/primitivetype/EdmByte.java | 101 +
.../commons/core/edm/primitivetype/EdmDate.java | 95 +
.../edm/primitivetype/EdmDateTimeOffset.java | 239 +
.../core/edm/primitivetype/EdmDecimal.java | 200 +
.../core/edm/primitivetype/EdmDouble.java | 146 +
.../core/edm/primitivetype/EdmDuration.java | 140 +
.../commons/core/edm/primitivetype/EdmGuid.java | 88 +
.../core/edm/primitivetype/EdmInt16.java | 99 +
.../core/edm/primitivetype/EdmInt32.java | 100 +
.../core/edm/primitivetype/EdmInt64.java | 135 +
.../commons/core/edm/primitivetype/EdmNull.java | 75 +
.../edm/primitivetype/EdmPrimitiveTypeKind.java | 98 +
.../core/edm/primitivetype/EdmSByte.java | 95 +
.../core/edm/primitivetype/EdmSingle.java | 148 +
.../core/edm/primitivetype/EdmString.java | 108 +
.../core/edm/primitivetype/EdmTimeOfDay.java | 107 +
.../primitivetype/SingletonPrimitiveType.java | 52 +
.../commons/core/edm/primitivetype/Uint7.java | 66 +
.../core/edm/AbstractEdmBindingTarget.java | 55 -
.../core/edm/AbstractEdmComplexType.java | 50 -
.../core/edm/AbstractEdmEntityContainer.java | 101 -
.../commons/core/edm/AbstractEdmEntityType.java | 113 -
.../commons/core/edm/AbstractEdmEnumType.java | 205 -
.../commons/core/edm/AbstractEdmImpl.java | 252 -
.../core/edm/AbstractEdmKeyPropertyRef.java | 80 -
.../core/edm/AbstractEdmNavigationProperty.java | 76 -
.../commons/core/edm/AbstractEdmOperation.java | 113 -
.../core/edm/AbstractEdmOperationImport.java | 63 -
.../commons/core/edm/AbstractEdmParameter.java | 87 -
.../commons/core/edm/AbstractEdmProperty.java | 70 -
.../commons/core/edm/AbstractEdmReturnType.java | 85 -
.../core/edm/AbstractEdmStructuredType.java | 128 -
.../core/edm/AbstractEdmTypeDefinition.java | 107 -
.../odata4/commons/core/edm/ActionMapKey.java | 67 -
.../core/edm/EdmActionImportInfoImpl.java | 45 -
.../odata4/commons/core/edm/EdmElementImpl.java | 29 -
.../commons/core/edm/EdmEntitySetInfoImpl.java | 52 -
.../core/edm/EdmFunctionImportInfoImpl.java | 45 -
.../odata4/commons/core/edm/EdmMemberImpl.java | 38 -
.../odata4/commons/core/edm/EdmNamedImpl.java | 40 -
.../core/edm/EdmOperationImportInfoImpl.java | 36 -
.../commons/core/edm/EdmSingletonInfoImpl.java | 52 -
.../core/edm/EdmStructuredTypeHelper.java | 30 -
.../odata4/commons/core/edm/EdmTypeImpl.java | 48 -
.../odata4/commons/core/edm/FunctionMapKey.java | 113 -
.../primitivetype/AbstractPrimitiveType.java | 116 -
.../core/edm/primitivetype/EdmBinary.java | 117 -
.../core/edm/primitivetype/EdmBoolean.java | 81 -
.../commons/core/edm/primitivetype/EdmByte.java | 101 -
.../commons/core/edm/primitivetype/EdmDate.java | 95 -
.../edm/primitivetype/EdmDateTimeOffset.java | 239 -
.../core/edm/primitivetype/EdmDecimal.java | 200 -
.../core/edm/primitivetype/EdmDouble.java | 146 -
.../core/edm/primitivetype/EdmDuration.java | 140 -
.../commons/core/edm/primitivetype/EdmGuid.java | 88 -
.../core/edm/primitivetype/EdmInt16.java | 99 -
.../core/edm/primitivetype/EdmInt32.java | 100 -
.../core/edm/primitivetype/EdmInt64.java | 135 -
.../commons/core/edm/primitivetype/EdmNull.java | 75 -
.../edm/primitivetype/EdmPrimitiveTypeKind.java | 98 -
.../core/edm/primitivetype/EdmSByte.java | 95 -
.../core/edm/primitivetype/EdmSingle.java | 148 -
.../core/edm/primitivetype/EdmString.java | 108 -
.../core/edm/primitivetype/EdmTimeOfDay.java | 107 -
.../primitivetype/SingletonPrimitiveType.java | 52 -
.../commons/core/edm/primitivetype/Uint7.java | 66 -
.../commons/core/edm/ActionMapKeyTest.java | 102 +
.../commons/core/edm/EdmImplCachingTest.java | 389 ++
.../commons/core/edm/EdmImplCallCreateTest.java | 268 +
.../commons/core/edm/FunctionMapKeyTest.java | 252 +
.../primitivetype/CommonPrimitiveTypeTest.java | 175 +
.../core/edm/primitivetype/EdmBinaryTest.java | 106 +
.../core/edm/primitivetype/EdmBooleanTest.java | 64 +
.../core/edm/primitivetype/EdmByteTest.java | 86 +
.../core/edm/primitivetype/EdmDateTest.java | 93 +
.../primitivetype/EdmDateTimeOffsetTest.java | 125 +
.../core/edm/primitivetype/EdmDecimalTest.java | 132 +
.../core/edm/primitivetype/EdmDoubleTest.java | 132 +
.../core/edm/primitivetype/EdmDurationTest.java | 105 +
.../core/edm/primitivetype/EdmGuidTest.java | 68 +
.../core/edm/primitivetype/EdmInt16Test.java | 88 +
.../core/edm/primitivetype/EdmInt32Test.java | 89 +
.../core/edm/primitivetype/EdmInt64Test.java | 96 +
.../core/edm/primitivetype/EdmNullTest.java | 50 +
.../core/edm/primitivetype/EdmSByteTest.java | 82 +
.../core/edm/primitivetype/EdmSingleTest.java | 138 +
.../core/edm/primitivetype/EdmStringTest.java | 78 +
.../edm/primitivetype/EdmTimeOfDayTest.java | 93 +
.../primitivetype/PrimitiveTypeBaseTest.java | 119 +
.../core/edm/primitivetype/UInt7Test.java | 35 +
.../commons/core/edm/ActionMapKeyTest.java | 101 -
.../commons/core/edm/EdmImplCachingTest.java | 388 --
.../commons/core/edm/EdmImplCallCreateTest.java | 267 -
.../commons/core/edm/FunctionMapKeyTest.java | 251 -
.../primitivetype/CommonPrimitiveTypeTest.java | 172 -
.../core/edm/primitivetype/EdmBinaryTest.java | 105 -
.../core/edm/primitivetype/EdmBooleanTest.java | 63 -
.../core/edm/primitivetype/EdmByteTest.java | 84 -
.../core/edm/primitivetype/EdmDateTest.java | 92 -
.../primitivetype/EdmDateTimeOffsetTest.java | 124 -
.../core/edm/primitivetype/EdmDecimalTest.java | 130 -
.../core/edm/primitivetype/EdmDoubleTest.java | 130 -
.../core/edm/primitivetype/EdmDurationTest.java | 104 -
.../core/edm/primitivetype/EdmGuidTest.java | 67 -
.../core/edm/primitivetype/EdmInt16Test.java | 86 -
.../core/edm/primitivetype/EdmInt32Test.java | 87 -
.../core/edm/primitivetype/EdmInt64Test.java | 94 -
.../core/edm/primitivetype/EdmNullTest.java | 49 -
.../core/edm/primitivetype/EdmSByteTest.java | 80 -
.../core/edm/primitivetype/EdmSingleTest.java | 136 -
.../core/edm/primitivetype/EdmStringTest.java | 77 -
.../edm/primitivetype/EdmTimeOfDayTest.java | 92 -
.../primitivetype/PrimitiveTypeBaseTest.java | 119 -
.../core/edm/primitivetype/UInt7Test.java | 33 -
.../odata4/server/api/edm/provider/Action.java | 54 -
.../server/api/edm/provider/ActionImport.java | 48 -
.../server/api/edm/provider/AliasInfo.java | 45 -
.../server/api/edm/provider/Annotation.java | 72 -
.../server/api/edm/provider/BindingTarget.java | 60 -
.../server/api/edm/provider/ComplexType.java | 62 -
.../server/api/edm/provider/EdmProvider.java | 182 -
.../api/edm/provider/EntityContainer.java | 93 -
.../api/edm/provider/EntityContainerInfo.java | 47 -
.../server/api/edm/provider/EntitySet.java | 55 -
.../server/api/edm/provider/EntitySetPath.java | 45 -
.../server/api/edm/provider/EntityType.java | 84 -
.../server/api/edm/provider/EnumMember.java | 49 -
.../server/api/edm/provider/EnumType.java | 73 -
.../server/api/edm/provider/Expression.java | 24 -
.../server/api/edm/provider/Function.java | 65 -
.../server/api/edm/provider/FunctionImport.java | 64 -
.../odata4/server/api/edm/provider/Mapping.java | 96 -
.../api/edm/provider/NavigationProperty.java | 118 -
.../edm/provider/NavigationPropertyBinding.java | 46 -
.../server/api/edm/provider/Operation.java | 81 -
.../api/edm/provider/OperationImport.java | 47 -
.../server/api/edm/provider/Parameter.java | 113 -
.../server/api/edm/provider/Property.java | 148 -
.../server/api/edm/provider/PropertyRef.java | 55 -
.../api/edm/provider/ReferentialConstraint.java | 46 -
.../server/api/edm/provider/ReturnType.java | 91 -
.../odata4/server/api/edm/provider/Schema.java | 135 -
.../server/api/edm/provider/Singleton.java | 44 -
.../server/api/edm/provider/StructuredType.java | 93 -
.../odata4/server/api/edm/provider/Term.java | 150 -
.../server/api/edm/provider/TypeDefinition.java | 94 -
.../olingo/odata4/server/api/uri/UriInfo.java | 48 -
.../odata4/server/api/uri/UriInfoAll.java | 28 -
.../odata4/server/api/uri/UriInfoBatch.java | 27 -
.../odata4/server/api/uri/UriInfoCrossjoin.java | 34 -
.../odata4/server/api/uri/UriInfoEntityId.java | 68 -
.../odata4/server/api/uri/UriInfoKind.java | 67 -
.../odata4/server/api/uri/UriInfoMetadata.java | 39 -
.../odata4/server/api/uri/UriInfoResource.java | 118 -
.../odata4/server/api/uri/UriInfoService.java | 27 -
.../odata4/server/api/uri/UriParameter.java | 53 -
.../odata4/server/api/uri/UriResource.java | 35 -
.../server/api/uri/UriResourceAction.java | 42 -
.../api/uri/UriResourceComplexProperty.java | 41 -
.../odata4/server/api/uri/UriResourceCount.java | 27 -
.../server/api/uri/UriResourceEntitySet.java | 58 -
.../server/api/uri/UriResourceFunction.java | 66 -
.../odata4/server/api/uri/UriResourceIt.java | 38 -
.../odata4/server/api/uri/UriResourceKind.java | 115 -
.../server/api/uri/UriResourceLambdaAll.java | 39 -
.../server/api/uri/UriResourceLambdaAny.java | 39 -
.../api/uri/UriResourceLambdaVariable.java | 33 -
.../server/api/uri/UriResourceNavigation.java | 51 -
.../server/api/uri/UriResourcePartTyped.java | 43 -
.../api/uri/UriResourcePrimitiveProperty.java | 27 -
.../server/api/uri/UriResourceProperty.java | 33 -
.../odata4/server/api/uri/UriResourceRef.java | 28 -
.../odata4/server/api/uri/UriResourceRoot.java | 28 -
.../server/api/uri/UriResourceSingleton.java | 46 -
.../odata4/server/api/uri/UriResourceValue.java | 27 -
.../api/uri/queryoption/AliasQueryOption.java | 27 -
.../server/api/uri/queryoption/CountOption.java | 25 -
.../api/uri/queryoption/CustomQueryOption.java | 23 -
.../uri/queryoption/ExceptionVisitExpand.java | 25 -
.../server/api/uri/queryoption/ExpandItem.java | 53 -
.../api/uri/queryoption/ExpandOption.java | 27 -
.../api/uri/queryoption/FilterOption.java | 26 -
.../api/uri/queryoption/FormatOption.java | 25 -
.../server/api/uri/queryoption/IdOption.java | 25 -
.../api/uri/queryoption/LevelsExpandOption.java | 27 -
.../server/api/uri/queryoption/OrderByItem.java | 33 -
.../api/uri/queryoption/OrderByOption.java | 27 -
.../server/api/uri/queryoption/QueryOption.java | 27 -
.../api/uri/queryoption/SearchOption.java | 27 -
.../server/api/uri/queryoption/SelectItem.java | 37 -
.../api/uri/queryoption/SelectOption.java | 27 -
.../server/api/uri/queryoption/SkipOption.java | 25 -
.../api/uri/queryoption/SkipTokenOption.java | 25 -
.../uri/queryoption/SupportedQueryOptions.java | 45 -
.../api/uri/queryoption/SystemQueryOption.java | 25 -
.../server/api/uri/queryoption/TopOption.java | 25 -
.../queryoption/expression/AliasExpression.java | 25 -
.../expression/BinaryExpression.java | 29 -
.../expression/BinaryOperatorKind.java | 57 -
.../uri/queryoption/expression/Enumeration.java | 31 -
.../uri/queryoption/expression/Expression.java | 23 -
.../expression/ExpressionVisitException.java | 25 -
.../expression/ExpressionVisitor.java | 57 -
.../uri/queryoption/expression/LambdaRef.java | 25 -
.../api/uri/queryoption/expression/Literal.java | 29 -
.../api/uri/queryoption/expression/Member.java | 36 -
.../uri/queryoption/expression/MethodCall.java | 29 -
.../queryoption/expression/MethodCallKind.java | 58 -
.../uri/queryoption/expression/TypeLiteral.java | 27 -
.../queryoption/expression/UnaryOperator.java | 27 -
.../expression/UnaryOperatorKind.java | 44 -
.../expression/VisitableExression.java | 47 -
.../uri/queryoption/search/SearchBinary.java | 29 -
.../search/SearchBinaryOperatorKind.java | 45 -
.../queryoption/search/SearchExpression.java | 23 -
.../api/uri/queryoption/search/SearchTerm.java | 25 -
.../api/uri/queryoption/search/SearchUnary.java | 25 -
.../search/SearchUnaryOperatorKind.java | 43 -
.../olingo/server/api/edm/provider/Action.java | 54 +
.../server/api/edm/provider/ActionImport.java | 48 +
.../server/api/edm/provider/AliasInfo.java | 45 +
.../server/api/edm/provider/Annotation.java | 72 +
.../server/api/edm/provider/BindingTarget.java | 60 +
.../server/api/edm/provider/ComplexType.java | 62 +
.../server/api/edm/provider/EdmProvider.java | 182 +
.../api/edm/provider/EntityContainer.java | 93 +
.../api/edm/provider/EntityContainerInfo.java | 47 +
.../server/api/edm/provider/EntitySet.java | 55 +
.../server/api/edm/provider/EntitySetPath.java | 45 +
.../server/api/edm/provider/EntityType.java | 84 +
.../server/api/edm/provider/EnumMember.java | 49 +
.../server/api/edm/provider/EnumType.java | 73 +
.../server/api/edm/provider/Expression.java | 24 +
.../server/api/edm/provider/Function.java | 65 +
.../server/api/edm/provider/FunctionImport.java | 64 +
.../olingo/server/api/edm/provider/Mapping.java | 96 +
.../api/edm/provider/NavigationProperty.java | 118 +
.../edm/provider/NavigationPropertyBinding.java | 46 +
.../server/api/edm/provider/Operation.java | 81 +
.../api/edm/provider/OperationImport.java | 47 +
.../server/api/edm/provider/Parameter.java | 113 +
.../server/api/edm/provider/Property.java | 148 +
.../server/api/edm/provider/PropertyRef.java | 55 +
.../api/edm/provider/ReferentialConstraint.java | 46 +
.../server/api/edm/provider/ReturnType.java | 91 +
.../olingo/server/api/edm/provider/Schema.java | 135 +
.../server/api/edm/provider/Singleton.java | 44 +
.../server/api/edm/provider/StructuredType.java | 93 +
.../olingo/server/api/edm/provider/Term.java | 150 +
.../server/api/edm/provider/TypeDefinition.java | 94 +
.../apache/olingo/server/api/uri/UriInfo.java | 48 +
.../olingo/server/api/uri/UriInfoAll.java | 28 +
.../olingo/server/api/uri/UriInfoBatch.java | 27 +
.../olingo/server/api/uri/UriInfoCrossjoin.java | 34 +
.../olingo/server/api/uri/UriInfoEntityId.java | 68 +
.../olingo/server/api/uri/UriInfoKind.java | 67 +
.../olingo/server/api/uri/UriInfoMetadata.java | 39 +
.../olingo/server/api/uri/UriInfoResource.java | 118 +
.../olingo/server/api/uri/UriInfoService.java | 27 +
.../olingo/server/api/uri/UriParameter.java | 53 +
.../olingo/server/api/uri/UriResource.java | 35 +
.../server/api/uri/UriResourceAction.java | 42 +
.../api/uri/UriResourceComplexProperty.java | 41 +
.../olingo/server/api/uri/UriResourceCount.java | 27 +
.../server/api/uri/UriResourceEntitySet.java | 58 +
.../server/api/uri/UriResourceFunction.java | 66 +
.../olingo/server/api/uri/UriResourceIt.java | 38 +
.../olingo/server/api/uri/UriResourceKind.java | 115 +
.../server/api/uri/UriResourceLambdaAll.java | 39 +
.../server/api/uri/UriResourceLambdaAny.java | 39 +
.../api/uri/UriResourceLambdaVariable.java | 33 +
.../server/api/uri/UriResourceNavigation.java | 51 +
.../server/api/uri/UriResourcePartTyped.java | 43 +
.../api/uri/UriResourcePrimitiveProperty.java | 27 +
.../server/api/uri/UriResourceProperty.java | 33 +
.../olingo/server/api/uri/UriResourceRef.java | 28 +
.../olingo/server/api/uri/UriResourceRoot.java | 28 +
.../server/api/uri/UriResourceSingleton.java | 46 +
.../olingo/server/api/uri/UriResourceValue.java | 27 +
.../api/uri/queryoption/AliasQueryOption.java | 27 +
.../server/api/uri/queryoption/CountOption.java | 25 +
.../api/uri/queryoption/CustomQueryOption.java | 23 +
.../uri/queryoption/ExceptionVisitExpand.java | 25 +
.../server/api/uri/queryoption/ExpandItem.java | 53 +
.../api/uri/queryoption/ExpandOption.java | 27 +
.../api/uri/queryoption/FilterOption.java | 26 +
.../api/uri/queryoption/FormatOption.java | 25 +
.../server/api/uri/queryoption/IdOption.java | 25 +
.../api/uri/queryoption/LevelsExpandOption.java | 27 +
.../server/api/uri/queryoption/OrderByItem.java | 33 +
.../api/uri/queryoption/OrderByOption.java | 27 +
.../server/api/uri/queryoption/QueryOption.java | 27 +
.../api/uri/queryoption/SearchOption.java | 27 +
.../server/api/uri/queryoption/SelectItem.java | 37 +
.../api/uri/queryoption/SelectOption.java | 27 +
.../server/api/uri/queryoption/SkipOption.java | 25 +
.../api/uri/queryoption/SkipTokenOption.java | 25 +
.../uri/queryoption/SupportedQueryOptions.java | 45 +
.../api/uri/queryoption/SystemQueryOption.java | 25 +
.../server/api/uri/queryoption/TopOption.java | 25 +
.../queryoption/expression/AliasExpression.java | 25 +
.../expression/BinaryExpression.java | 29 +
.../expression/BinaryOperatorKind.java | 57 +
.../uri/queryoption/expression/Enumeration.java | 31 +
.../uri/queryoption/expression/Expression.java | 23 +
.../expression/ExpressionVisitException.java | 25 +
.../expression/ExpressionVisitor.java | 57 +
.../uri/queryoption/expression/LambdaRef.java | 25 +
.../api/uri/queryoption/expression/Literal.java | 29 +
.../api/uri/queryoption/expression/Member.java | 36 +
.../uri/queryoption/expression/MethodCall.java | 29 +
.../queryoption/expression/MethodCallKind.java | 58 +
.../uri/queryoption/expression/TypeLiteral.java | 27 +
.../queryoption/expression/UnaryOperator.java | 27 +
.../expression/UnaryOperatorKind.java | 44 +
.../expression/VisitableExression.java | 47 +
.../uri/queryoption/search/SearchBinary.java | 29 +
.../search/SearchBinaryOperatorKind.java | 45 +
.../queryoption/search/SearchExpression.java | 23 +
.../api/uri/queryoption/search/SearchTerm.java | 25 +
.../api/uri/queryoption/search/SearchUnary.java | 25 +
.../search/SearchUnaryOperatorKind.java | 43 +
lib/server-core/pom.xml | 2 +-
.../odata4/server/core/uri/antlr/UriLexer.g4 | 404 --
.../odata4/server/core/uri/antlr/UriParser.g4 | 439 --
.../olingo/server/core/uri/antlr/UriLexer.g4 | 404 ++
.../olingo/server/core/uri/antlr/UriParser.g4 | 439 ++
.../server/core/edm/provider/EdmActionImpl.java | 36 -
.../core/edm/provider/EdmActionImportImpl.java | 43 -
.../core/edm/provider/EdmBindingTargetImpl.java | 77 -
.../core/edm/provider/EdmComplexTypeImpl.java | 58 -
.../edm/provider/EdmEntityContainerImpl.java | 111 -
.../core/edm/provider/EdmEntitySetImpl.java | 32 -
.../core/edm/provider/EdmEntityTypeImpl.java | 87 -
.../core/edm/provider/EdmEnumTypeImpl.java | 61 -
.../core/edm/provider/EdmFunctionImpl.java | 56 -
.../edm/provider/EdmFunctionImportImpl.java | 45 -
.../edm/provider/EdmKeyPropertyRefImpl.java | 48 -
.../edm/provider/EdmNavigationPropertyImpl.java | 71 -
.../core/edm/provider/EdmOperationImpl.java | 67 -
.../edm/provider/EdmOperationImportImpl.java | 33 -
.../core/edm/provider/EdmParameterImpl.java | 65 -
.../core/edm/provider/EdmPropertyImpl.java | 87 -
.../core/edm/provider/EdmProviderImpl.java | 287 -
.../core/edm/provider/EdmReturnTypeImpl.java | 59 -
.../edm/provider/EdmServiceMetadataImpl.java | 190 -
.../core/edm/provider/EdmSingletonImpl.java | 31 -
.../provider/EdmStructuredTypeHelperImpl.java | 72 -
.../edm/provider/EdmTypeDefinitionImpl.java | 74 -
.../odata4/server/core/uri/UriInfoImpl.java | 296 -
.../server/core/uri/UriParameterImpl.java | 82 -
.../server/core/uri/UriResourceActionImpl.java | 77 -
.../uri/UriResourceComplexPropertyImpl.java | 70 -
.../server/core/uri/UriResourceCountImpl.java | 35 -
.../core/uri/UriResourceEntitySetImpl.java | 66 -
.../core/uri/UriResourceFunctionImpl.java | 111 -
.../odata4/server/core/uri/UriResourceImpl.java | 39 -
.../server/core/uri/UriResourceItImpl.java | 65 -
.../core/uri/UriResourceLambdaAllImpl.java | 73 -
.../core/uri/UriResourceLambdaAnyImpl.java | 72 -
.../core/uri/UriResourceLambdaVarImpl.java | 70 -
.../uri/UriResourceNavigationPropertyImpl.java | 63 -
.../uri/UriResourcePrimitivePropertyImpl.java | 59 -
.../server/core/uri/UriResourceRefImpl.java | 36 -
.../server/core/uri/UriResourceRootImpl.java | 62 -
.../core/uri/UriResourceSingletonImpl.java | 71 -
.../uri/UriResourceStartingTypeFilterImpl.java | 66 -
.../server/core/uri/UriResourceTypedImpl.java | 60 -
.../server/core/uri/UriResourceValueImpl.java | 36 -
.../core/uri/UriResourceWithKeysImpl.java | 99 -
.../uri/parser/CheckFullContextListener.java | 60 -
.../odata4/server/core/uri/parser/Parser.java | 442 --
.../odata4/server/core/uri/parser/RawUri.java | 46 -
.../server/core/uri/parser/UriContext.java | 80 -
.../server/core/uri/parser/UriDecoder.java | 137 -
.../core/uri/parser/UriParseTreeVisitor.java | 2111 --------
.../core/uri/parser/UriParserException.java | 35 -
.../uri/parser/UriParserSemanticException.java | 33 -
.../uri/parser/UriParserSyntaxException.java | 36 -
.../uri/queryoption/AliasQueryOptionImpl.java | 38 -
.../core/uri/queryoption/CountOptionImpl.java | 42 -
.../uri/queryoption/CustomQueryOptionImpl.java | 25 -
.../core/uri/queryoption/ExpandItemImpl.java | 176 -
.../core/uri/queryoption/ExpandOptionImpl.java | 49 -
.../core/uri/queryoption/FilterOptionImpl.java | 43 -
.../core/uri/queryoption/FormatOptionImpl.java | 41 -
.../core/uri/queryoption/IdOptionImpl.java | 40 -
.../core/uri/queryoption/LevelsOptionImpl.java | 53 -
.../core/uri/queryoption/OrderByItemImpl.java | 49 -
.../core/uri/queryoption/OrderByOptionImpl.java | 50 -
.../core/uri/queryoption/QueryOptionImpl.java | 47 -
.../core/uri/queryoption/SearchOptionImpl.java | 37 -
.../core/uri/queryoption/SelectItemImpl.java | 84 -
.../core/uri/queryoption/SelectOptionImpl.java | 50 -
.../core/uri/queryoption/SkipOptionImpl.java | 41 -
.../uri/queryoption/SkipTokenOptionImpl.java | 41 -
.../uri/queryoption/SystemQueryOptionImpl.java | 42 -
.../core/uri/queryoption/TopOptionImpl.java | 42 -
.../uri/queryoption/expression/AliasImpl.java | 44 -
.../uri/queryoption/expression/BinaryImpl.java | 70 -
.../queryoption/expression/EnumerationImpl.java | 60 -
.../queryoption/expression/ExpressionImpl.java | 25 -
.../queryoption/expression/LambdaRefImpl.java | 46 -
.../uri/queryoption/expression/LiteralImpl.java | 58 -
.../uri/queryoption/expression/MemberImpl.java | 99 -
.../queryoption/expression/MethodCallImpl.java | 70 -
.../queryoption/expression/TypeLiteralImpl.java | 47 -
.../uri/queryoption/expression/UnaryImpl.java | 58 -
.../server/core/edm/provider/EdmActionImpl.java | 36 +
.../core/edm/provider/EdmActionImportImpl.java | 43 +
.../core/edm/provider/EdmBindingTargetImpl.java | 77 +
.../core/edm/provider/EdmComplexTypeImpl.java | 59 +
.../edm/provider/EdmEntityContainerImpl.java | 111 +
.../core/edm/provider/EdmEntitySetImpl.java | 32 +
.../core/edm/provider/EdmEntityTypeImpl.java | 87 +
.../core/edm/provider/EdmEnumTypeImpl.java | 61 +
.../core/edm/provider/EdmFunctionImpl.java | 56 +
.../edm/provider/EdmFunctionImportImpl.java | 45 +
.../edm/provider/EdmKeyPropertyRefImpl.java | 48 +
.../edm/provider/EdmNavigationPropertyImpl.java | 71 +
.../core/edm/provider/EdmOperationImpl.java | 67 +
.../edm/provider/EdmOperationImportImpl.java | 33 +
.../core/edm/provider/EdmParameterImpl.java | 65 +
.../core/edm/provider/EdmPropertyImpl.java | 87 +
.../core/edm/provider/EdmProviderImpl.java | 287 +
.../core/edm/provider/EdmReturnTypeImpl.java | 59 +
.../edm/provider/EdmServiceMetadataImpl.java | 190 +
.../core/edm/provider/EdmSingletonImpl.java | 31 +
.../provider/EdmStructuredTypeHelperImpl.java | 73 +
.../edm/provider/EdmTypeDefinitionImpl.java | 74 +
.../olingo/server/core/uri/UriInfoImpl.java | 296 +
.../server/core/uri/UriParameterImpl.java | 82 +
.../server/core/uri/UriResourceActionImpl.java | 77 +
.../uri/UriResourceComplexPropertyImpl.java | 70 +
.../server/core/uri/UriResourceCountImpl.java | 35 +
.../core/uri/UriResourceEntitySetImpl.java | 66 +
.../core/uri/UriResourceFunctionImpl.java | 111 +
.../olingo/server/core/uri/UriResourceImpl.java | 39 +
.../server/core/uri/UriResourceItImpl.java | 65 +
.../core/uri/UriResourceLambdaAllImpl.java | 73 +
.../core/uri/UriResourceLambdaAnyImpl.java | 72 +
.../core/uri/UriResourceLambdaVarImpl.java | 70 +
.../uri/UriResourceNavigationPropertyImpl.java | 63 +
.../uri/UriResourcePrimitivePropertyImpl.java | 59 +
.../server/core/uri/UriResourceRefImpl.java | 36 +
.../server/core/uri/UriResourceRootImpl.java | 62 +
.../core/uri/UriResourceSingletonImpl.java | 71 +
.../uri/UriResourceStartingTypeFilterImpl.java | 66 +
.../server/core/uri/UriResourceTypedImpl.java | 60 +
.../server/core/uri/UriResourceValueImpl.java | 36 +
.../core/uri/UriResourceWithKeysImpl.java | 99 +
.../uri/parser/CheckFullContextListener.java | 60 +
.../olingo/server/core/uri/parser/Parser.java | 442 ++
.../olingo/server/core/uri/parser/RawUri.java | 46 +
.../server/core/uri/parser/UriContext.java | 80 +
.../server/core/uri/parser/UriDecoder.java | 137 +
.../core/uri/parser/UriParseTreeVisitor.java | 2111 ++++++++
.../core/uri/parser/UriParserException.java | 35 +
.../uri/parser/UriParserSemanticException.java | 33 +
.../uri/parser/UriParserSyntaxException.java | 36 +
.../uri/queryoption/AliasQueryOptionImpl.java | 38 +
.../core/uri/queryoption/CountOptionImpl.java | 42 +
.../uri/queryoption/CustomQueryOptionImpl.java | 25 +
.../core/uri/queryoption/ExpandItemImpl.java | 176 +
.../core/uri/queryoption/ExpandOptionImpl.java | 49 +
.../core/uri/queryoption/FilterOptionImpl.java | 43 +
.../core/uri/queryoption/FormatOptionImpl.java | 41 +
.../core/uri/queryoption/IdOptionImpl.java | 40 +
.../core/uri/queryoption/LevelsOptionImpl.java | 53 +
.../core/uri/queryoption/OrderByItemImpl.java | 49 +
.../core/uri/queryoption/OrderByOptionImpl.java | 50 +
.../core/uri/queryoption/QueryOptionImpl.java | 47 +
.../core/uri/queryoption/SearchOptionImpl.java | 37 +
.../core/uri/queryoption/SelectItemImpl.java | 84 +
.../core/uri/queryoption/SelectOptionImpl.java | 50 +
.../core/uri/queryoption/SkipOptionImpl.java | 41 +
.../uri/queryoption/SkipTokenOptionImpl.java | 41 +
.../uri/queryoption/SystemQueryOptionImpl.java | 42 +
.../core/uri/queryoption/TopOptionImpl.java | 42 +
.../uri/queryoption/expression/AliasImpl.java | 44 +
.../uri/queryoption/expression/BinaryImpl.java | 70 +
.../queryoption/expression/EnumerationImpl.java | 60 +
.../queryoption/expression/ExpressionImpl.java | 25 +
.../queryoption/expression/LambdaRefImpl.java | 46 +
.../uri/queryoption/expression/LiteralImpl.java | 58 +
.../uri/queryoption/expression/MemberImpl.java | 99 +
.../queryoption/expression/MethodCallImpl.java | 70 +
.../queryoption/expression/TypeLiteralImpl.java | 47 +
.../uri/queryoption/expression/UnaryImpl.java | 58 +
.../core/edm/provider/EdmActionImplTest.java | 156 -
.../edm/provider/EdmActionImportImplTest.java | 103 -
.../edm/provider/EdmComplexTypeImplTest.java | 163 -
.../provider/EdmEntityContainerImplTest.java | 205 -
.../core/edm/provider/EdmEntitySetImplTest.java | 81 -
.../edm/provider/EdmEntityTypeImplTest.java | 276 -
.../server/core/edm/provider/EdmEnumTest.java | 177 -
.../core/edm/provider/EdmFunctionImplTest.java | 75 -
.../edm/provider/EdmFunctionImportImplTest.java | 84 -
.../edm/provider/EdmKeyPropertyRefImplTest.java | 142 -
.../core/edm/provider/EdmMemberImplTest.java | 39 -
.../core/edm/provider/EdmNamedImplTest.java | 42 -
.../provider/EdmNavigationPropertyImplTest.java | 144 -
.../core/edm/provider/EdmParameterImplTest.java | 140 -
.../core/edm/provider/EdmPropertyImplTest.java | 155 -
.../EdmProviderImplOverloadingTest.java | 198 -
.../core/edm/provider/EdmProviderImplTest.java | 231 -
.../edm/provider/EdmReturnTypeImplTest.java | 129 -
.../provider/EdmServiceMetadataImplTest.java | 188 -
.../core/edm/provider/EdmSingletonImplTest.java | 129 -
.../edm/provider/EdmTypeDefinitionImplTest.java | 73 -
.../core/edm/provider/EdmTypeImplTest.java | 45 -
.../edm/provider/PrimitiveTypeBaseTest.java | 117 -
.../server/core/testutil/EdmTechProvider.java | 1976 -------
.../core/testutil/EdmTechTestProvider.java | 94 -
.../odata4/server/core/uri/RawUriTest.java | 151 -
.../odata4/server/core/uri/UriInfoImplTest.java | 201 -
.../server/core/uri/UriResourceImplTest.java | 504 --
.../core/uri/antlr/TestFullResourcePath.java | 5104 ------------------
.../odata4/server/core/uri/antlr/TestLexer.java | 250 -
.../core/uri/antlr/TestUriParserImpl.java | 1128 ----
.../core/uri/queryoption/QueryOptionTest.java | 303 --
.../queryoption/expression/ExpressionTest.java | 239 -
.../core/uri/testutil/ExpandValidator.java | 232 -
.../core/uri/testutil/FilterTreeToText.java | 154 -
.../core/uri/testutil/FilterValidator.java | 534 --
.../core/uri/testutil/ParseTreeToText.java | 82 -
.../core/uri/testutil/ParserValidator.java | 162 -
.../core/uri/testutil/ParserWithLogging.java | 56 -
.../core/uri/testutil/ResourceValidator.java | 595 --
.../core/uri/testutil/TestErrorLogger.java | 105 -
.../core/uri/testutil/TokenValidator.java | 194 -
.../core/uri/testutil/UriLexerWithTrace.java | 85 -
.../server/core/uri/testutil/UriValidator.java | 258 -
.../server/core/uri/testutil/Validator.java | 23 -
.../core/edm/provider/EdmActionImplTest.java | 158 +
.../edm/provider/EdmActionImportImplTest.java | 105 +
.../edm/provider/EdmComplexTypeImplTest.java | 165 +
.../provider/EdmEntityContainerImplTest.java | 207 +
.../core/edm/provider/EdmEntitySetImplTest.java | 84 +
.../edm/provider/EdmEntityTypeImplTest.java | 278 +
.../server/core/edm/provider/EdmEnumTest.java | 179 +
.../core/edm/provider/EdmFunctionImplTest.java | 77 +
.../edm/provider/EdmFunctionImportImplTest.java | 87 +
.../edm/provider/EdmKeyPropertyRefImplTest.java | 143 +
.../core/edm/provider/EdmMemberImplTest.java | 41 +
.../core/edm/provider/EdmNamedImplTest.java | 42 +
.../provider/EdmNavigationPropertyImplTest.java | 146 +
.../core/edm/provider/EdmParameterImplTest.java | 142 +
.../core/edm/provider/EdmPropertyImplTest.java | 157 +
.../EdmProviderImplOverloadingTest.java | 199 +
.../core/edm/provider/EdmProviderImplTest.java | 232 +
.../edm/provider/EdmReturnTypeImplTest.java | 131 +
.../provider/EdmServiceMetadataImplTest.java | 189 +
.../core/edm/provider/EdmSingletonImplTest.java | 132 +
.../edm/provider/EdmTypeDefinitionImplTest.java | 75 +
.../core/edm/provider/EdmTypeImplTest.java | 45 +
.../edm/provider/PrimitiveTypeBaseTest.java | 117 +
.../server/core/testutil/EdmTechProvider.java | 1976 +++++++
.../core/testutil/EdmTechTestProvider.java | 94 +
.../olingo/server/core/uri/RawUriTest.java | 151 +
.../olingo/server/core/uri/UriInfoImplTest.java | 204 +
.../server/core/uri/UriResourceImplTest.java | 523 ++
.../core/uri/antlr/TestFullResourcePath.java | 5104 ++++++++++++++++++
.../olingo/server/core/uri/antlr/TestLexer.java | 251 +
.../core/uri/antlr/TestUriParserImpl.java | 1128 ++++
.../core/uri/queryoption/QueryOptionTest.java | 321 ++
.../queryoption/expression/ExpressionTest.java | 249 +
.../core/uri/testutil/ExpandValidator.java | 232 +
.../core/uri/testutil/FilterTreeToText.java | 154 +
.../core/uri/testutil/FilterValidator.java | 534 ++
.../core/uri/testutil/ParseTreeToText.java | 82 +
.../core/uri/testutil/ParserValidator.java | 162 +
.../core/uri/testutil/ParserWithLogging.java | 56 +
.../core/uri/testutil/ResourceValidator.java | 595 ++
.../core/uri/testutil/TestErrorLogger.java | 105 +
.../core/uri/testutil/TokenValidator.java | 194 +
.../core/uri/testutil/UriLexerWithTrace.java | 85 +
.../server/core/uri/testutil/UriValidator.java | 258 +
.../server/core/uri/testutil/Validator.java | 23 +
1537 files changed, 69423 insertions(+), 69022 deletions(-)
----------------------------------------------------------------------
[35/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataBinder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataBinder.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataBinder.java
new file mode 100644
index 0000000..d6ade11
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataBinder.java
@@ -0,0 +1,582 @@
+/*
+ * 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.op.impl;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.ODataConstants;
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.api.data.ServiceDocumentItem;
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+import org.apache.olingo.client.api.op.ODataBinder;
+import org.apache.olingo.client.api.utils.XMLUtils;
+import org.apache.olingo.client.core.uri.URIUtils;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public abstract class AbstractODataBinder implements ODataBinder {
+
+ private static final long serialVersionUID = 454285889193689536L;
+
+ /**
+ * Logger.
+ */
+ protected final Logger LOG = LoggerFactory.getLogger(AbstractODataBinder.class);
+
+ protected final ODataClient client;
+
+ protected AbstractODataBinder(final ODataClient client) {
+ this.client = client;
+ }
+
+ protected Element newEntryContent() {
+ Element properties = null;
+ try {
+ final DocumentBuilder builder = XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder();
+ final Document doc = builder.newDocument();
+ properties = doc.createElement(ODataConstants.ELEM_PROPERTIES);
+ properties.setAttribute(ODataConstants.XMLNS_METADATA,
+ client.getServiceVersion().getNamespaceMap().get(ODataServiceVersion.NS_METADATA));
+ properties.setAttribute(ODataConstants.XMLNS_DATASERVICES,
+ client.getServiceVersion().getNamespaceMap().get(ODataServiceVersion.NS_DATASERVICES));
+ properties.setAttribute(ODataConstants.XMLNS_GML, ODataConstants.NS_GML);
+ properties.setAttribute(ODataConstants.XMLNS_GEORSS, ODataConstants.NS_GEORSS);
+ } catch (ParserConfigurationException e) {
+ LOG.error("Failure building entry content", e);
+ }
+
+ return properties;
+ }
+
+ @Override
+ public ODataServiceDocument getODataServiceDocument(final ServiceDocument resource) {
+ final ODataServiceDocument serviceDocument = new ODataServiceDocument();
+
+ for (ServiceDocumentItem entitySet : resource.getEntitySets()) {
+ // handles V3 JSON format oddities, where title is not contained
+ serviceDocument.getEntitySets().put(StringUtils.isBlank(entitySet.getTitle())
+ ? entitySet.getName() : entitySet.getTitle(),
+ URIUtils.getURI(resource.getBaseURI(), entitySet.getHref()));
+ }
+
+ return serviceDocument;
+ }
+
+// @Override
+// public <T extends Feed> T getFeed(final ODataEntitySet feed, final Class<T> reference) {
+// final T feedResource = ResourceFactory.newFeed(reference);
+//
+// final List<Entry> entries = new ArrayList<Entry>();
+// feedResource.setEntries(entries);
+//
+// final URI next = feed.getNext();
+// if (next != null) {
+// feedResource.setNext(next);
+// }
+//
+// for (ODataEntity entity : feed.getEntities()) {
+// entries.add(getEntry(entity, ResourceFactory.entryClassForFeed(reference)));
+// }
+//
+// feedResource.setEntries(entries);
+//
+// return feedResource;
+// }
+//
+// @Override
+// public <T extends Entry> T getEntry(final ODataEntity entity, final Class<T> reference) {
+// return getEntry(entity, reference, true);
+// }
+//
+// @Override
+// @SuppressWarnings("unchecked")
+// public <T extends Entry> T getEntry(final ODataEntity entity, final Class<T> reference,
+// final boolean setType) {
+//
+// final T entry = ResourceFactory.newEntry(reference);
+// entry.setType(entity.getName());
+//
+// // -------------------------------------------------------------
+// // Add edit and self link
+// // -------------------------------------------------------------
+// final URI editLink = entity.getEditLink();
+// if (editLink != null) {
+// final Link entryEditLink = ResourceFactory.newLinkForEntry(reference);
+// entryEditLink.setTitle(entity.getName());
+// entryEditLink.setHref(editLink.toASCIIString());
+// entryEditLink.setRel(ODataConstants.EDIT_LINK_REL);
+// entry.setEditLink(entryEditLink);
+// }
+//
+// if (entity.isReadOnly()) {
+// final Link entrySelfLink = ResourceFactory.newLinkForEntry(reference);
+// entrySelfLink.setTitle(entity.getName());
+// entrySelfLink.setHref(entity.getLink().toASCIIString());
+// entrySelfLink.setRel(ODataConstants.SELF_LINK_REL);
+// entry.setSelfLink(entrySelfLink);
+// }
+// // -------------------------------------------------------------
+//
+// // -------------------------------------------------------------
+// // Append navigation links (handling inline entry / feed as well)
+// // -------------------------------------------------------------
+// // handle navigation links
+// for (ODataLink link : entity.getNavigationLinks()) {
+// // append link
+// LOG.debug("Append navigation link\n{}", link);
+// entry.addNavigationLink(getLinkResource(link, ResourceFactory.linkClassForEntry(reference)));
+// }
+// // -------------------------------------------------------------
+//
+// // -------------------------------------------------------------
+// // Append edit-media links
+// // -------------------------------------------------------------
+// for (ODataLink link : entity.getEditMediaLinks()) {
+// LOG.debug("Append edit-media link\n{}", link);
+// entry.addMediaEditLink(getLinkResource(link, ResourceFactory.linkClassForEntry(reference)));
+// }
+// // -------------------------------------------------------------
+//
+// // -------------------------------------------------------------
+// // Append association links
+// // -------------------------------------------------------------
+// for (ODataLink link : entity.getAssociationLinks()) {
+// LOG.debug("Append association link\n{}", link);
+// entry.addAssociationLink(getLinkResource(link, ResourceFactory.linkClassForEntry(reference)));
+// }
+// // -------------------------------------------------------------
+//
+// final Element content = newEntryContent();
+// if (entity.isMediaEntity()) {
+// entry.setMediaEntryProperties(content);
+// entry.setMediaContentSource(entity.getMediaContentSource());
+// entry.setMediaContentType(entity.getMediaContentType());
+// } else {
+// entry.setContent(content);
+// }
+//
+// for (ODataProperty prop : entity.getProperties()) {
+// content.appendChild(toDOMElement(prop, content.getOwnerDocument(), setType));
+// }
+//
+// return entry;
+// }
+//
+// @Override
+// public Element toDOMElement(final ODataProperty prop) {
+// try {
+// return toDOMElement(prop, XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder().newDocument(), true);
+// } catch (ParserConfigurationException e) {
+// LOG.error("Error retrieving property DOM", e);
+// throw new IllegalArgumentException(e);
+// }
+// }
+//
+// @Override
+// public ODataLinkCollection getLinkCollection(final LinkCollection linkCollection) {
+// final ODataLinkCollection collection = new ODataLinkCollection(linkCollection.getNext());
+// collection.setLinks(linkCollection.getLinks());
+// return collection;
+// }
+//
+// @Override
+// public ODataEntitySet getODataEntitySet(final Feed resource) {
+// return getODataEntitySet(resource, null);
+// }
+//
+// @Override
+// public ODataEntitySet getODataEntitySet(final Feed resource, final URI defaultBaseURI) {
+// if (LOG.isDebugEnabled()) {
+// final StringWriter writer = new StringWriter();
+// client.getSerializer().feed(resource, writer);
+// writer.flush();
+// LOG.debug("FeedResource -> ODataEntitySet:\n{}", writer.toString());
+// }
+//
+// final URI base = defaultBaseURI == null ? resource.getBaseURI() : defaultBaseURI;
+//
+// final URI next = resource.getNext();
+//
+// final ODataEntitySet entitySet = next == null
+// ? client.getObjectFactory().newEntitySet()
+// : client.getObjectFactory().newEntitySet(URIUtils.getURI(base, next.toASCIIString()));
+//
+// if (resource.getCount() != null) {
+// entitySet.setCount(resource.getCount());
+// }
+//
+// for (Entry entryResource : resource.getEntries()) {
+// entitySet.addEntity(getODataEntity(entryResource));
+// }
+//
+// return entitySet;
+// }
+//
+// @Override
+// public ODataEntity getODataEntity(final Entry resource) {
+// return getODataEntity(resource, null);
+// }
+//
+// @Override
+// public ODataEntity getODataEntity(final Entry resource, final URI defaultBaseURI) {
+// if (LOG.isDebugEnabled()) {
+// final StringWriter writer = new StringWriter();
+// client.getSerializer().entry(resource, writer);
+// writer.flush();
+// LOG.debug("EntryResource -> ODataEntity:\n{}", writer.toString());
+// }
+//
+// final URI base = defaultBaseURI == null ? resource.getBaseURI() : defaultBaseURI;
+//
+// final ODataEntity entity = resource.getSelfLink() == null
+// ? client.getObjectFactory().newEntity(resource.getType())
+// : client.getObjectFactory().newEntity(resource.getType(),
+// URIUtils.getURI(base, resource.getSelfLink().getHref()));
+//
+// if (StringUtils.isNotBlank(resource.getETag())) {
+// entity.setETag(resource.getETag());
+// }
+//
+// if (resource.getEditLink() != null) {
+// entity.setEditLink(URIUtils.getURI(base, resource.getEditLink().getHref()));
+// }
+//
+// for (Link link : resource.getAssociationLinks()) {
+// entity.addLink(client.getObjectFactory().newAssociationLink(link.getTitle(), base, link.getHref()));
+// }
+//
+// for (Link link : resource.getNavigationLinks()) {
+// final Entry inlineEntry = link.getInlineEntry();
+// final Feed inlineFeed = link.getInlineFeed();
+//
+// if (inlineEntry == null && inlineFeed == null) {
+// entity.addLink(
+// client.getObjectFactory().newEntityNavigationLink(link.getTitle(), base, link.getHref()));
+// } else if (inlineFeed == null) {
+// entity.addLink(client.getObjectFactory().newInlineEntity(
+// link.getTitle(), base, link.getHref(),
+// getODataEntity(inlineEntry,
+// inlineEntry.getBaseURI() == null ? base : inlineEntry.getBaseURI())));
+// } else {
+// entity.addLink(client.getObjectFactory().newInlineEntitySet(
+// link.getTitle(), base, link.getHref(),
+// getODataEntitySet(inlineFeed,
+// inlineFeed.getBaseURI() == null ? base : inlineFeed.getBaseURI())));
+// }
+// }
+//
+// for (Link link : resource.getMediaEditLinks()) {
+// entity.addLink(client.getObjectFactory().newMediaEditLink(link.getTitle(), base, link.getHref()));
+// }
+//
+// for (ODataOperation operation : resource.getOperations()) {
+// operation.setTarget(URIUtils.getURI(base, operation.getTarget()));
+// entity.addOperation(operation);
+// }
+//
+// final Element content;
+// if (resource.isMediaEntry()) {
+// entity.setMediaEntity(true);
+// entity.setMediaContentSource(resource.getMediaContentSource());
+// entity.setMediaContentType(resource.getMediaContentType());
+// content = resource.getMediaEntryProperties();
+// } else {
+// content = resource.getContent();
+// }
+// if (content != null) {
+// for (Node property : XMLUtils.getChildNodes(content, Node.ELEMENT_NODE)) {
+// try {
+// entity.addProperty(getProperty((Element) property));
+// } catch (IllegalArgumentException e) {
+// LOG.warn("Failure retrieving EdmType for {}", property.getTextContent(), e);
+// }
+// }
+// }
+//
+// return entity;
+// }
+//
+// @Override
+// public <T extends Link> T getLinkResource(final ODataLink link, final Class<T> reference) {
+// final T linkResource = ResourceFactory.newLink(reference);
+// linkResource.setRel(link.getRel());
+// linkResource.setTitle(link.getName());
+// linkResource.setHref(link.getLink() == null ? null : link.getLink().toASCIIString());
+// linkResource.setType(link.getType().toString());
+//
+// if (link instanceof ODataInlineEntity) {
+// // append inline entity
+// final ODataEntity inlineEntity = ((ODataInlineEntity) link).getEntity();
+// LOG.debug("Append in-line entity\n{}", inlineEntity);
+//
+// linkResource.setInlineEntry(getEntry(inlineEntity, ResourceFactory.entryClassForLink(reference)));
+// } else if (link instanceof ODataInlineEntitySet) {
+// // append inline feed
+// final ODataEntitySet InlineFeed = ((ODataInlineEntitySet) link).getEntitySet();
+// LOG.debug("Append in-line feed\n{}", InlineFeed);
+//
+// linkResource.setInlineFeed(getFeed(InlineFeed, ResourceFactory.feedClassForLink(reference)));
+// }
+//
+// return linkResource;
+// }
+//
+// @Override
+// public ODataProperty getProperty(final Element property) {
+// final ODataProperty res;
+//
+// final Node nullNode = property.getAttributes().getNamedItem(ODataConstants.ATTR_NULL);
+//
+// if (nullNode == null) {
+// final EdmType edmType = StringUtils.isBlank(property.getAttribute(ODataConstants.ATTR_M_TYPE))
+// ? null
+// : newEdmType(property.getAttribute(ODataConstants.ATTR_M_TYPE));
+//
+// final PropertyType propType = edmType == null
+// ? guessPropertyType(property)
+// : edmType.isCollection()
+// ? PropertyType.COLLECTION
+// : edmType.isSimpleType()
+// ? PropertyType.PRIMITIVE
+// : PropertyType.COMPLEX;
+//
+// switch (propType) {
+// case COLLECTION:
+// res = fromCollectionPropertyElement(property, edmType);
+// break;
+//
+// case COMPLEX:
+// res = fromComplexPropertyElement(property, edmType);
+// break;
+//
+// case PRIMITIVE:
+// res = fromPrimitivePropertyElement(property, edmType);
+// break;
+//
+// case EMPTY:
+// default:
+// res = client.getObjectFactory().newPrimitiveProperty(XMLUtils.getSimpleName(property), null);
+// }
+// } else {
+// res = client.getObjectFactory().newPrimitiveProperty(XMLUtils.getSimpleName(property), null);
+// }
+//
+// return res;
+// }
+//
+// protected PropertyType guessPropertyType(final Element property) {
+// PropertyType res = null;
+//
+// if (property.hasChildNodes()) {
+// final NodeList children = property.getChildNodes();
+//
+// for (int i = 0; res == null && i < children.getLength(); i++) {
+// final Node child = children.item(i);
+//
+// if (child.getNodeType() == Node.ELEMENT_NODE
+// && !child.getNodeName().startsWith(ODataConstants.PREFIX_GML)) {
+//
+// res = ODataConstants.ELEM_ELEMENT.equals(XMLUtils.getSimpleName(child))
+// ? PropertyType.COLLECTION
+// : PropertyType.COMPLEX;
+// }
+// }
+// } else {
+// res = PropertyType.EMPTY;
+// }
+//
+// if (res == null) {
+// res = PropertyType.PRIMITIVE;
+// }
+//
+// return res;
+// }
+//
+// protected Element toDOMElement(final ODataProperty prop, final Document doc, final boolean setType) {
+// final Element element;
+//
+// if (prop.hasNullValue()) {
+// // null property handling
+// element = toNullPropertyElement(prop, doc);
+// } else if (prop.hasPrimitiveValue()) {
+// // primitive property handling
+// element = toPrimitivePropertyElement(prop, doc, setType);
+// } else if (prop.hasCollectionValue()) {
+// // collection property handling
+// element = toCollectionPropertyElement(prop, doc, setType);
+// } else {
+// // complex property handling
+// element = toComplexPropertyElement(prop, doc, setType);
+// }
+//
+// element.setAttribute(ODataConstants.XMLNS_METADATA,
+// client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_METADATA));
+// element.setAttribute(ODataConstants.XMLNS_DATASERVICES,
+// client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_DATASERVICES));
+// element.setAttribute(ODataConstants.XMLNS_GML, ODataConstants.NS_GML);
+// element.setAttribute(ODataConstants.XMLNS_GEORSS, ODataConstants.NS_GEORSS);
+//
+// return element;
+// }
+//
+// protected Element toNullPropertyElement(final ODataProperty prop, final Document doc) {
+// final Element element = doc.createElement(ODataConstants.PREFIX_DATASERVICES + prop.getName());
+// element.setAttribute(ODataConstants.ATTR_NULL, Boolean.toString(true));
+// return element;
+// }
+//
+// protected Element toPrimitivePropertyElement(
+// final ODataProperty prop, final Document doc, final boolean setType) {
+//
+// return toPrimitivePropertyElement(prop.getName(), prop.getPrimitiveValue(), doc, setType);
+// }
+//
+// protected Element toPrimitivePropertyElement(
+// final String name, final ODataPrimitiveValue value, final Document doc, final boolean setType) {
+//
+// final Element element = doc.createElement(ODataConstants.PREFIX_DATASERVICES + name);
+// if (setType) {
+// element.setAttribute(ODataConstants.ATTR_M_TYPE, value.getTypeName());
+// }
+//
+// if (value instanceof ODataGeospatialValue) {
+// element.appendChild(doc.importNode(((ODataGeospatialValue) value).toTree(), true));
+// } else {
+// element.setTextContent(value.toString());
+// }
+//
+// return element;
+// }
+//
+// protected Element toCollectionPropertyElement(
+// final ODataProperty prop, final Document doc, final boolean setType) {
+//
+// if (!prop.hasCollectionValue()) {
+// throw new IllegalArgumentException("Invalid property value type "
+// + prop.getValue().getClass().getSimpleName());
+// }
+//
+// final ODataCollectionValue value = prop.getCollectionValue();
+//
+// final Element element = doc.createElement(ODataConstants.PREFIX_DATASERVICES + prop.getName());
+// if (value.getTypeName() != null && setType) {
+// element.setAttribute(ODataConstants.ATTR_M_TYPE, value.getTypeName());
+// }
+//
+// for (ODataValue el : value) {
+// if (el.isPrimitive()) {
+// element.appendChild(
+// toPrimitivePropertyElement(ODataConstants.ELEM_ELEMENT, el.asPrimitive(), doc, setType));
+// } else {
+// element.appendChild(
+// toComplexPropertyElement(ODataConstants.ELEM_ELEMENT, el.asComplex(), doc, setType));
+// }
+// }
+//
+// return element;
+// }
+//
+// protected Element toComplexPropertyElement(
+// final ODataProperty prop, final Document doc, final boolean setType) {
+//
+// return toComplexPropertyElement(prop.getName(), prop.getComplexValue(), doc, setType);
+// }
+//
+// protected Element toComplexPropertyElement(
+// final String name, final ODataComplexValue value, final Document doc, final boolean setType) {
+//
+// final Element element = doc.createElement(ODataConstants.PREFIX_DATASERVICES + name);
+// if (value.getTypeName() != null && setType) {
+// element.setAttribute(ODataConstants.ATTR_M_TYPE, value.getTypeName());
+// }
+//
+// for (ODataProperty field : value) {
+// element.appendChild(toDOMElement(field, doc, true));
+// }
+// return element;
+// }
+//
+// protected ODataPrimitiveValue fromPrimitiveValueElement(final Element prop, final EdmType edmType) {
+// final ODataPrimitiveValue value;
+// if (edmType != null && edmType.getSimpleType().isGeospatial()) {
+// final Element geoProp = ODataConstants.PREFIX_GML.equals(prop.getPrefix())
+// ? prop : (Element) XMLUtils.getChildNodes(prop, Node.ELEMENT_NODE).get(0);
+// value = client.getGeospatialValueBuilder().
+// setType(edmType.getSimpleType()).setTree(geoProp).build();
+// } else {
+// value = client.getPrimitiveValueBuilder().
+// setType(edmType == null ? null : edmType.getSimpleType()).setText(prop.getTextContent()).build();
+// }
+// return value;
+// }
+//
+// protected ODataProperty fromPrimitivePropertyElement(final Element prop, final EdmType edmType) {
+// return client.getObjectFactory().newPrimitiveProperty(
+// XMLUtils.getSimpleName(prop), fromPrimitiveValueElement(prop, edmType));
+// }
+//
+// protected ODataComplexValue fromComplexValueElement(final Element prop, final EdmType edmType) {
+// final ODataComplexValue value = new ODataComplexValue(edmType == null ? null : edmType.getTypeExpression());
+//
+// for (Node child : XMLUtils.getChildNodes(prop, Node.ELEMENT_NODE)) {
+// value.add(getProperty((Element) child));
+// }
+//
+// return value;
+// }
+//
+// protected ODataProperty fromComplexPropertyElement(final Element prop, final EdmType edmType) {
+// return client.getObjectFactory().newComplexProperty(XMLUtils.getSimpleName(prop),
+// fromComplexValueElement(prop, edmType));
+// }
+//
+// protected ODataProperty fromCollectionPropertyElement(final Element prop, final EdmType edmType) {
+// final ODataCollectionValue value
+// = new ODataCollectionValue(edmType == null ? null : edmType.getTypeExpression());
+//
+// final EdmType type = edmType == null ? null : newEdmType(edmType.getBaseType());
+// final NodeList elements = prop.getChildNodes();
+//
+// for (int i = 0; i < elements.getLength(); i++) {
+// if (elements.item(i).getNodeType() != Node.TEXT_NODE) {
+// final Element child = (Element) elements.item(i);
+//
+// switch (guessPropertyType(child)) {
+// case COMPLEX:
+// value.add(fromComplexValueElement(child, type));
+// break;
+// case PRIMITIVE:
+// value.add(fromPrimitiveValueElement(child, type));
+// break;
+// default:
+// // do not add null or empty values
+// }
+// }
+// }
+//
+// return client.getObjectFactory().newCollectionProperty(XMLUtils.getSimpleName(prop), value);
+// }
+// protected abstract EdmType newEdmType(String 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/op/impl/AbstractODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataDeserializer.java
new file mode 100644
index 0000000..2c7ff22
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataDeserializer.java
@@ -0,0 +1,178 @@
+/*
+ * 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.op.impl;
+
+import java.io.InputStream;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.op.ODataDeserializer;
+import org.apache.olingo.client.core.xml.XMLParser;
+import org.w3c.dom.Element;
+
+public abstract class AbstractODataDeserializer extends AbstractJacksonTool implements ODataDeserializer {
+
+ private static final long serialVersionUID = -4244158979195609909L;
+
+// private final AtomDeserializer atomDeserializer;
+ public AbstractODataDeserializer(final ODataClient client) {
+ super(client);
+// this.atomDeserializer = new AtomDeserializer(client);
+ }
+
+// @Override
+// @SuppressWarnings("unchecked")
+// public <T extends Feed> T toFeed(final InputStream input, final Class<T> reference) {
+// T entry;
+//
+// if (AtomFeed.class.equals(reference)) {
+// entry = (T) toAtomFeed(input);
+// } else {
+// entry = (T) toJSONFeed(input);
+// }
+//
+// return entry;
+// }
+//
+// @Override
+// @SuppressWarnings("unchecked")
+// public <T extends Entry> T toEntry(final InputStream input, final Class<T> reference) {
+// T entry;
+//
+// if (AtomEntry.class.equals(reference)) {
+// entry = (T) toAtomEntry(input);
+//
+// } else {
+// entry = (T) toJSONEntry(input);
+// }
+//
+// return entry;
+// }
+//
+// @Override
+// public Element toPropertyDOM(final InputStream input, final ODataFormat format) {
+// return format == ODataFormat.XML
+// ? toPropertyDOMFromXML(input)
+// : toPropertyDOMFromJSON(input);
+// }
+//
+// @Override
+// public LinkCollection toLinkCollection(final InputStream input, final ODataFormat format) {
+// return format == ODataFormat.XML
+// ? toLinkCollectionFromXML(input)
+// : toLinkCollectionFromJSON(input);
+// }
+//
+// @Override
+// public ODataError toODataError(final InputStream input, final boolean isXML) {
+// return isXML
+// ? toODataErrorFromXML(input)
+// : toODataErrorFromJSON(input);
+// }
+//
+ @Override
+ public Element toDOM(final InputStream input) {
+ return XMLParser.PARSER.deserialize(input);
+ }
+//
+// /*
+// * ------------------ Protected methods ------------------
+// */
+// protected AtomFeed toAtomFeed(final InputStream input) {
+// try {
+// return atomDeserializer.feed(toDOM(input));
+// } catch (Exception e) {
+// throw new IllegalArgumentException("While deserializing Atom feed", e);
+// }
+// }
+//
+// protected AtomEntry toAtomEntry(final InputStream input) {
+// try {
+// return atomDeserializer.entry(toDOM(input));
+// } catch (Exception e) {
+// throw new IllegalArgumentException("While deserializing Atom entry", e);
+// }
+// }
+//
+// protected JSONFeed toJSONFeed(final InputStream input) {
+// try {
+// return getObjectMapper().readValue(input, JSONFeed.class);
+// } catch (IOException e) {
+// throw new IllegalArgumentException("While deserializing JSON feed", e);
+// }
+// }
+//
+// protected abstract AbstractJSONEntry toJSONEntry(final InputStream input);
+//
+// protected Element toPropertyDOMFromXML(final InputStream input) {
+// return toDOM(input);
+// }
+//
+// protected Element toPropertyDOMFromJSON(final InputStream input) {
+// try {
+// return getObjectMapper().readValue(input, JSONProperty.class).getContent();
+// } catch (IOException e) {
+// throw new IllegalArgumentException("While deserializing JSON property", e);
+// }
+// }
+//
+// protected XMLLinkCollection toLinkCollectionFromXML(final InputStream input) {
+// final Element root = toDOM(input);
+//
+// final NodeList uris = root.getOwnerDocument().getElementsByTagName(ODataConstants.ELEM_URI);
+//
+// final List<URI> links = new ArrayList<URI>();
+// for (int i = 0; i < uris.getLength(); i++) {
+// links.add(URI.create(uris.item(i).getTextContent()));
+// }
+//
+// final NodeList next = root.getElementsByTagName(ODataConstants.NEXT_LINK_REL);
+// final XMLLinkCollection linkCollection = next.getLength() > 0
+// ? new XMLLinkCollection(URI.create(next.item(0).getTextContent()))
+// : new XMLLinkCollection();
+// linkCollection.setLinks(links);
+//
+// return linkCollection;
+// }
+//
+// protected JSONLinkCollection toLinkCollectionFromJSON(final InputStream input) {
+// try {
+// return getObjectMapper().readValue(input, JSONLinkCollection.class);
+// } catch (IOException e) {
+// throw new IllegalArgumentException("While deserializing JSON $links", e);
+// }
+// }
+//
+// protected XMLODataError toODataErrorFromXML(final InputStream input) {
+// try {
+// final XmlMapper xmlMapper = new XmlMapper(
+// new XmlFactory(new InputFactoryImpl(), new OutputFactoryImpl()), new JacksonXmlModule());
+// return xmlMapper.readValue(input, XMLODataError.class);
+// } catch (Exception e) {
+// throw new IllegalArgumentException("While deserializing XML error", e);
+// }
+// }
+//
+// protected JSONODataError toODataErrorFromJSON(final InputStream input) {
+// try {
+// return getObjectMapper().readValue(input, JSONODataErrorBundle.class).getError();
+// } catch (IOException e) {
+// throw new IllegalArgumentException("While deserializing JSON error", 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/op/impl/AbstractODataReader.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataReader.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataReader.java
new file mode 100644
index 0000000..6cf19a3
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataReader.java
@@ -0,0 +1,138 @@
+/*
+ * 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.op.impl;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.op.ODataReader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractODataReader implements ODataReader {
+
+ private static final long serialVersionUID = -1988865870981207079L;
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractODataReader.class);
+
+ protected final ODataClient client;
+
+ protected AbstractODataReader(final ODataClient client) {
+ this.client = client;
+ }
+
+// @Override
+// public ODataEntitySet readEntitySet(final InputStream input, final ODataPubFormat format) {
+// return client.getBinder().getODataEntitySet(
+// client.getDeserializer().toFeed(input, ResourceFactory.feedClassForFormat(format)));
+// }
+//
+// @Override
+// public ODataEntity readEntity(final InputStream input, final ODataPubFormat format) {
+// return client.getBinder().getODataEntity(
+// client.getDeserializer().toEntry(input, ResourceFactory.entryClassForFormat(format)));
+// }
+//
+// @Override
+// public ODataProperty readProperty(final InputStream input, final ODataFormat format) {
+// final Element property = client.getDeserializer().toPropertyDOM(input, format);
+//
+// // The ODataProperty object is used either for actual entity properties and for invoke result
+// // (when return type is neither an entity nor a collection of entities).
+// // Such formats are mostly the same except for collections: an entity property looks like
+// // <aproperty m:type="Collection(AType)">
+// // <element>....</element>
+// // </aproperty>
+// //
+// // while an invoke result with returnType="Collection(AnotherType)" looks like
+// // <functionImportName>
+// // <element m:type="AnotherType">...</element>
+// // <functionImportName>
+// //
+// // The code below is meant for "normalizing" the latter into
+// // <functionImportName m:type="Collection(AnotherType)">
+// // <element m:type="AnotherType">...</element>
+// // <functionImportName>
+// final String type = property.getAttribute(ODataConstants.ATTR_M_TYPE);
+// final NodeList elements = property.getElementsByTagName(ODataConstants.ELEM_ELEMENT);
+// if (StringUtils.isBlank(type) && elements != null && elements.getLength() > 0) {
+// final Node elementType = elements.item(0).getAttributes().getNamedItem(ODataConstants.ATTR_M_TYPE);
+// if (elementType != null) {
+// property.setAttribute(ODataConstants.ATTR_M_TYPE, "Collection(" + elementType.getTextContent() + ")");
+// }
+// }
+//
+// return client.getBinder().getProperty(property);
+// }
+//
+// @Override
+// public ODataLinkCollection readLinks(final InputStream input, final ODataFormat format) {
+// return client.getBinder().getLinkCollection(
+// client.getDeserializer().toLinkCollection(input, format));
+// }
+//
+// @Override
+// public ODataError readError(final InputStream inputStream, final boolean isXML) {
+// return client.getDeserializer().toODataError(inputStream, isXML);
+// }
+//
+// @Override
+// @SuppressWarnings("unchecked")
+// public <T> T read(final InputStream src, final String format, final Class<T> reference) {
+// Object res;
+//
+// try {
+// if (ODataEntitySetIterator.class.isAssignableFrom(reference)) {
+// res = new ODataEntitySetIterator(client, src, ODataPubFormat.fromString(format));
+// } else if (ODataEntitySet.class.isAssignableFrom(reference)) {
+// res = readEntitySet(src, ODataPubFormat.fromString(format));
+// } else if (ODataEntity.class.isAssignableFrom(reference)) {
+// res = readEntity(src, ODataPubFormat.fromString(format));
+// } else if (ODataProperty.class.isAssignableFrom(reference)) {
+// res = readProperty(src, ODataFormat.fromString(format));
+// } else if (ODataLinkCollection.class.isAssignableFrom(reference)) {
+// res = readLinks(src, ODataFormat.fromString(format));
+// } else if (ODataValue.class.isAssignableFrom(reference)) {
+// res = client.getPrimitiveValueBuilder().
+// setType(ODataValueFormat.fromString(format) == ODataValueFormat.TEXT
+// ? EdmSimpleType.String : EdmSimpleType.Stream).
+// setText(IOUtils.toString(src)).
+// build();
+// } else if (AbstractEdmMetadata.class.isAssignableFrom(reference)) {
+// res = readMetadata(src);
+// } else if (ODataServiceDocument.class.isAssignableFrom(reference)) {
+// res = readServiceDocument(src, ODataFormat.fromString(format));
+// } else if (ODataError.class.isAssignableFrom(reference)) {
+// res = readError(src, !format.toString().contains("json"));
+// } else {
+// throw new IllegalArgumentException("Invalid reference type " + reference);
+// }
+// } catch (Exception e) {
+// LOG.warn("Cast error", e);
+// res = null;
+// } finally {
+// if (!ODataEntitySetIterator.class.isAssignableFrom(reference)) {
+// IOUtils.closeQuietly(src);
+// }
+// }
+//
+// return (T) res;
+// }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataSerializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataSerializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataSerializer.java
new file mode 100644
index 0000000..d60ff19
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractODataSerializer.java
@@ -0,0 +1,161 @@
+/*
+ * 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.op.impl;
+
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.op.ODataSerializer;
+import org.apache.olingo.client.core.xml.XMLParser;
+import org.w3c.dom.Node;
+
+public abstract class AbstractODataSerializer extends AbstractJacksonTool implements ODataSerializer {
+
+ private static final long serialVersionUID = -357777648541325363L;
+
+// private final AtomSerializer atomSerializer;
+ public AbstractODataSerializer(final ODataClient client) {
+ super(client);
+// this.atomSerializer = new AtomSerializer(client);
+ }
+
+// @Override
+// public <T extends Feed> void feed(final T obj, final OutputStream out) {
+// feed(obj, new OutputStreamWriter(out));
+// }
+//
+// @Override
+// public <T extends Feed> void feed(final T obj, final Writer writer) {
+// if (obj instanceof AtomFeed) {
+// atom((AtomFeed) obj, writer);
+// } else {
+// json((JSONFeed) obj, writer);
+// }
+// }
+//
+// @Override
+// public <T extends Entry> void entry(final T obj, final OutputStream out) {
+// entry(obj, new OutputStreamWriter(out));
+// }
+//
+// @Override
+// public <T extends Entry> void entry(final T obj, final Writer writer) {
+// if (obj instanceof AtomEntry) {
+// atom((AtomEntry) obj, writer);
+// } else {
+// json((JSONEntry) obj, writer);
+// }
+// }
+//
+// @Override
+// public void property(final Element element, final ODataFormat format, final OutputStream out) {
+// property(element, format, new OutputStreamWriter(out));
+// }
+//
+// @Override
+// public void property(final Element element, final ODataFormat format, final Writer writer) {
+// if (format == ODataFormat.XML) {
+// dom(element, writer);
+// } else {
+// json(element, writer);
+// }
+// }
+//
+// @Override
+// public void link(final ODataLink link, final ODataFormat format, final OutputStream out) {
+// link(link, format, new OutputStreamWriter(out));
+// }
+//
+// @Override
+// public void link(final ODataLink link, final ODataFormat format, final Writer writer) {
+// if (format == ODataFormat.XML) {
+// xmlLink(link, writer);
+// } else {
+// jsonLink(link, writer);
+// }
+// }
+//
+ @Override
+ public void dom(final Node content, final OutputStream out) {
+ dom(content, new OutputStreamWriter(out));
+ }
+
+ @Override
+ public void dom(final Node content, final Writer writer) {
+ XMLParser.PARSER.serialize(content, writer);
+ }
+//
+// /*
+// * ------------------ Protected methods ------------------
+// */
+// protected <T extends AbstractPayloadObject> void atom(final T obj, final Writer writer) {
+// try {
+// dom(atomSerializer.serialize(obj), writer);
+// } catch (Exception e) {
+// throw new IllegalArgumentException("While serializing Atom object", e);
+// }
+// }
+//
+// protected <T extends AbstractPayloadObject> void json(final T obj, final Writer writer) {
+// try {
+// getObjectMapper().writeValue(writer, obj);
+// } catch (IOException e) {
+// throw new IllegalArgumentException("While serializing JSON object", e);
+// }
+// }
+//
+// protected void json(final Element element, final Writer writer) {
+// try {
+// final JSONProperty property = new JSONProperty();
+// property.setContent(element);
+// getObjectMapper().writeValue(writer, property);
+// } catch (IOException e) {
+// throw new IllegalArgumentException("While serializing JSON property", e);
+// }
+// }
+//
+// protected void xmlLink(final ODataLink link, final Writer writer) {
+// try {
+// final DocumentBuilder builder = XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder();
+// final Document doc = builder.newDocument();
+// final Element uri = doc.createElementNS(
+// client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_DATASERVICES),
+// ODataConstants.ELEM_URI);
+// uri.appendChild(doc.createTextNode(link.getLink().toASCIIString()));
+//
+// dom(uri, writer);
+// } catch (Exception e) {
+// throw new IllegalArgumentException("While serializing XML link", e);
+// }
+// }
+//
+// protected void jsonLink(final ODataLink link, final Writer writer) {
+// final ObjectMapper mapper = getObjectMapper();
+// final ObjectNode uri = mapper.createObjectNode();
+// uri.put(ODataConstants.JSON_URL, link.getLink().toASCIIString());
+//
+// try {
+// mapper.writeValue(writer, uri);
+// } catch (Exception e) {
+// throw new IllegalArgumentException("While serializing JSON link", 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/op/impl/ComplexTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ComplexTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ComplexTypeDeserializer.java
new file mode 100644
index 0000000..e07d907
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ComplexTypeDeserializer.java
@@ -0,0 +1,83 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.edm.xml.AbstractComplexType;
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class ComplexTypeDeserializer extends AbstractEdmDeserializer<AbstractComplexType> {
+
+ @Override
+ protected AbstractComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractComplexType complexType = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ complexType.setName(jp.nextTextValue());
+ } else if ("Abstract".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("BaseType".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ setBaseType(jp.nextTextValue());
+ } else if ("OpenType".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Property".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (complexType instanceof org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl) complexType).
+ getProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.PropertyImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ getProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.PropertyImpl.class));
+ }
+ } else if ("NavigationProperty".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ getNavigationProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return complexType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityContainerDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityContainerDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityContainerDeserializer.java
new file mode 100644
index 0000000..5269128
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityContainerDeserializer.java
@@ -0,0 +1,102 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.edm.xml.AbstractEntityContainer;
+import org.apache.olingo.client.core.edm.xml.v3.AssociationSetImpl;
+import org.apache.olingo.client.core.edm.xml.v4.ActionImportImpl;
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.edm.xml.v4.SingletonImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+@SuppressWarnings("rawtypes")
+public class EntityContainerDeserializer extends AbstractEdmDeserializer<AbstractEntityContainer> {
+
+ @Override
+ protected AbstractEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractEntityContainer entityContainer = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ entityContainer.setName(jp.nextTextValue());
+ } else if ("Extends".equals(jp.getCurrentName())) {
+ entityContainer.setExtends(jp.nextTextValue());
+ } else if ("LazyLoadingEnabled".equals(jp.getCurrentName())) {
+ entityContainer.setLazyLoadingEnabled(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("IsDefaultEntityContainer".equals(jp.getCurrentName())) {
+ entityContainer.setDefaultEntityContainer(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("EntitySet".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (entityContainer instanceof org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) entityContainer).
+ getEntitySets().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.EntitySetImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ getEntitySets().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl.class));
+ }
+ } else if ("AssociationSet".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) entityContainer).
+ getAssociationSets().add(jp.readValueAs(AssociationSetImpl.class));
+ } else if ("Singleton".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ getSingletons().add(jp.readValueAs(SingletonImpl.class));
+ } else if ("ActionImport".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ getActionImports().add(jp.readValueAs(ActionImportImpl.class));
+ } else if ("FunctionImport".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (entityContainer instanceof org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) entityContainer).
+ getFunctionImports().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.FunctionImportImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ getFunctionImports().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.FunctionImportImpl.class));
+ }
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return entityContainer;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityKeyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityKeyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityKeyDeserializer.java
new file mode 100644
index 0000000..1f6b415
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityKeyDeserializer.java
@@ -0,0 +1,50 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.EntityKeyImpl;
+import org.apache.olingo.client.core.edm.xml.PropertyRefImpl;
+
+public class EntityKeyDeserializer extends AbstractEdmDeserializer<EntityKeyImpl> {
+
+ @Override
+ protected EntityKeyImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final EntityKeyImpl entityKey = new EntityKeyImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+
+ if (token == JsonToken.FIELD_NAME && "PropertyRef".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityKey.getPropertyRefs().add(jp.readValueAs( PropertyRefImpl.class));
+ }
+ }
+
+ return entityKey;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntitySetDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntitySetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntitySetDeserializer.java
new file mode 100644
index 0000000..7dba1f6
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntitySetDeserializer.java
@@ -0,0 +1,70 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.edm.xml.AbstractEntitySet;
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyBindingImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class EntitySetDeserializer extends AbstractEdmDeserializer<AbstractEntitySet> {
+
+ @Override
+ protected AbstractEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractEntitySet entitySet = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.EntitySetImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ entitySet.setName(jp.nextTextValue());
+ } else if ("EntityType".equals(jp.getCurrentName())) {
+ entitySet.setEntityType(jp.nextTextValue());
+ } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).
+ setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).
+ getNavigationPropertyBindings().add(
+ jp.readValueAs(NavigationPropertyBindingImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return entitySet;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityTypeDeserializer.java
new file mode 100644
index 0000000..a772b14
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EntityTypeDeserializer.java
@@ -0,0 +1,92 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.edm.xml.AbstractEntityType;
+import org.apache.olingo.client.core.edm.xml.EntityKeyImpl;
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class EntityTypeDeserializer extends AbstractEdmDeserializer<AbstractEntityType> {
+
+ @Override
+ protected AbstractEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractEntityType entityType = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ entityType.setName(jp.nextTextValue());
+ } else if ("Abstract".equals(jp.getCurrentName())) {
+ entityType.setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("BaseType".equals(jp.getCurrentName())) {
+ entityType.setBaseType(jp.nextTextValue());
+ } else if ("OpenType".equals(jp.getCurrentName())) {
+ entityType.setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("HasStream".equals(jp.getCurrentName())) {
+ entityType.setHasStream(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Key".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityType.setKey(jp.readValueAs(EntityKeyImpl.class));
+ } else if ("Property".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (entityType instanceof org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) entityType).
+ getProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.PropertyImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).
+ getProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.PropertyImpl.class));
+ }
+ } else if ("NavigationProperty".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (entityType instanceof org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) entityType).
+ getNavigationProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.NavigationPropertyImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).
+ getNavigationProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyImpl.class));
+ }
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return entityType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EnumTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EnumTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EnumTypeDeserializer.java
new file mode 100644
index 0000000..42d68ba
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/EnumTypeDeserializer.java
@@ -0,0 +1,73 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.edm.xml.AbstractEnumType;
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class EnumTypeDeserializer extends AbstractEdmDeserializer<AbstractEnumType> {
+
+ @Override
+ protected AbstractEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractEnumType enumType = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ enumType.setName(jp.nextTextValue());
+ } else if ("UnderlyingType".equals(jp.getCurrentName())) {
+ enumType.setUnderlyingType(jp.nextTextValue());
+ } else if ("IsFlags".equals(jp.getCurrentName())) {
+ enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Member".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (enumType instanceof org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl) enumType).
+ getMembers().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.MemberImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl) enumType).
+ getMembers().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.MemberImpl.class));
+ }
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl) enumType).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return enumType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/InjectableSerializerProvider.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/InjectableSerializerProvider.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/InjectableSerializerProvider.java
new file mode 100644
index 0000000..ec9fd29
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/InjectableSerializerProvider.java
@@ -0,0 +1,43 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;
+import com.fasterxml.jackson.databind.ser.SerializerFactory;
+
+class InjectableSerializerProvider extends DefaultSerializerProvider {
+
+ private static final long serialVersionUID = 3432260063063739646L;
+
+ public InjectableSerializerProvider(
+ final SerializerProvider src, final SerializationConfig config, final SerializerFactory factory) {
+
+ super(src, config, factory);
+ }
+
+ @Override
+ public InjectableSerializerProvider createInstance(
+ final SerializationConfig config, final SerializerFactory factory) {
+
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3BinderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3BinderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3BinderImpl.java
new file mode 100644
index 0000000..9196c9c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3BinderImpl.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.op.impl;
+
+import org.apache.olingo.client.core.ODataV3ClientImpl;
+import org.apache.olingo.client.core.op.impl.AbstractODataBinder;
+
+public class ODataV3BinderImpl extends AbstractODataBinder {
+
+ private static final long serialVersionUID = 8970843539708952308L;
+
+ public ODataV3BinderImpl(final ODataV3ClientImpl client) {
+ super(client);
+ }
+
+// @Override
+// protected EdmType newEdmType(final String expression) {
+// return new EdmV3Type(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/op/impl/ODataV3DeserializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3DeserializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3DeserializerImpl.java
new file mode 100644
index 0000000..a5c6e95
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3DeserializerImpl.java
@@ -0,0 +1,70 @@
+/*
+ * 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.op.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.client.api.op.ODataV3Deserializer;
+import org.apache.olingo.client.core.data.v3.JSONServiceDocumentImpl;
+import org.apache.olingo.client.core.data.v4.XMLServiceDocumentImpl;
+import org.apache.olingo.client.core.edm.xml.v3.EdmxImpl;
+import org.apache.olingo.client.core.edm.xml.v3.XMLMetadataImpl;
+import org.apache.olingo.client.core.op.impl.AbstractODataDeserializer;
+
+public class ODataV3DeserializerImpl extends AbstractODataDeserializer implements ODataV3Deserializer {
+
+ private static final long serialVersionUID = -8221085862548914611L;
+
+ public ODataV3DeserializerImpl(final ODataClient client) {
+ super(client);
+ }
+
+ @Override
+ public XMLMetadataImpl toMetadata(final InputStream input) {
+ try {
+ return new XMLMetadataImpl(getXmlMapper().readValue(input, EdmxImpl.class));
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Could not parse as Edmx document", e);
+ }
+ }
+
+ @Override
+ public ServiceDocument toServiceDocument(final InputStream input, final ODataFormat format) {
+ try {
+ return format == ODataFormat.XML
+ ? getXmlMapper().readValue(input, XMLServiceDocumentImpl.class)
+ : getObjectMapper().readValue(input, JSONServiceDocumentImpl.class);
+ } catch (IOException e) {
+ throw new IllegalArgumentException("Could not parse Service Document", e);
+ }
+ }
+
+// @Override
+// protected JSONEntry toJSONEntry(final InputStream input) {
+// try {
+// return getObjectMapper().readValue(input, JSONEntry.class);
+// } catch (IOException e) {
+// throw new IllegalArgumentException("While deserializing JSON entry", e);
+// }
+// }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3ReaderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3ReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3ReaderImpl.java
new file mode 100644
index 0000000..187bc41
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3ReaderImpl.java
@@ -0,0 +1,48 @@
+/*
+ * 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.op.impl;
+
+import java.io.InputStream;
+
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.client.core.ODataV3ClientImpl;
+import org.apache.olingo.client.core.edm.EdmClientImpl;
+import org.apache.olingo.client.core.op.impl.AbstractODataReader;
+import org.apache.olingo.commons.api.edm.Edm;
+
+public class ODataV3ReaderImpl extends AbstractODataReader {
+
+ private static final long serialVersionUID = -2481293269536406956L;
+
+ public ODataV3ReaderImpl(final ODataV3ClientImpl client) {
+ super(client);
+ }
+
+ @Override
+ public Edm readMetadata(final InputStream input) {
+ return new EdmClientImpl(client.getDeserializer().toMetadata(input));
+ }
+
+ @Override
+ public ODataServiceDocument readServiceDocument(final InputStream input, final ODataFormat format) {
+ return ((ODataV3ClientImpl) client).getBinder().getODataServiceDocument(
+ ((ODataV3ClientImpl) client).getDeserializer().toServiceDocument(input, format));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3SerializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3SerializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3SerializerImpl.java
new file mode 100644
index 0000000..41f8567
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV3SerializerImpl.java
@@ -0,0 +1,32 @@
+/*
+ * 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.op.impl;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.core.op.impl.AbstractODataSerializer;
+
+public class ODataV3SerializerImpl extends AbstractODataSerializer {
+
+ private static final long serialVersionUID = -8861908250297989806L;
+
+ public ODataV3SerializerImpl(final ODataClient client) {
+ super(client);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4BinderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4BinderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4BinderImpl.java
new file mode 100644
index 0000000..22a42ab
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4BinderImpl.java
@@ -0,0 +1,62 @@
+/*
+ * 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.op.impl;
+
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.api.data.ServiceDocumentItem;
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+import org.apache.olingo.client.core.ODataV4ClientImpl;
+import org.apache.olingo.client.core.op.impl.AbstractODataBinder;
+import org.apache.olingo.client.core.uri.URIUtils;
+
+public class ODataV4BinderImpl extends AbstractODataBinder {
+
+ private static final long serialVersionUID = -6371110655960799393L;
+
+ public ODataV4BinderImpl(final ODataV4ClientImpl client) {
+ super(client);
+ }
+
+// @Override
+// protected EdmType newEdmType(final String expression) {
+// return new EdmV4Type(expression);
+// }
+ @Override
+ public ODataServiceDocument getODataServiceDocument(final ServiceDocument resource) {
+ final ODataServiceDocument serviceDocument = super.getODataServiceDocument(resource);
+
+ serviceDocument.setMetadataContext(URIUtils.getURI(resource.getBaseURI(), resource.getMetadataContext()));
+ serviceDocument.setMetadataETag(resource.getMetadataETag());
+
+ for (ServiceDocumentItem functionImport : resource.getFunctionImports()) {
+ serviceDocument.getFunctionImports().put(functionImport.getTitle(),
+ URIUtils.getURI(resource.getBaseURI(), functionImport.getHref()));
+ }
+ for (ServiceDocumentItem singleton : resource.getSingletons()) {
+ serviceDocument.getSingletons().put(singleton.getTitle(),
+ URIUtils.getURI(resource.getBaseURI(), singleton.getHref()));
+ }
+ for (ServiceDocumentItem sdoc : resource.getRelatedServiceDocuments()) {
+ serviceDocument.getRelatedServiceDocuments().put(sdoc.getTitle(),
+ URIUtils.getURI(resource.getBaseURI(), sdoc.getHref()));
+ }
+
+ return serviceDocument;
+ }
+}
[17/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmTargetPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmTargetPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmTargetPath.java
new file mode 100644
index 0000000..37ca4ca
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmTargetPath.java
@@ -0,0 +1,50 @@
+/*
+ * 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.commons.api.edm.constants;
+
+/**
+ * EdmTargetPath specifies the possible default targets for an EDM property which is mapped to an atom element.
+ */
+public class EdmTargetPath {
+
+ public static final String SYNDICATION_AUTHORNAME = "SyndicationAuthorName";
+
+ public static final String SYNDICATION_AUTHOREMAIL = "SyndicationAuthorEmail";
+
+ public static final String SYNDICATION_AUTHORURI = "SyndicationAuthorUri";
+
+ public static final String SYNDICATION_PUBLISHED = "SyndicationPublished";
+
+ public static final String SYNDICATION_RIGHTS = "SyndicationRights";
+
+ public static final String SYNDICATION_TITLE = "SyndicationTitle";
+
+ public static final String SYNDICATION_UPDATED = "SyndicationUpdated";
+
+ public static final String SYNDICATION_CONTRIBUTORNAME = "SyndicationContributorName";
+
+ public static final String SYNDICATION_CONTRIBUTOREMAIL = "SyndicationContributorEmail";
+
+ public static final String SYNDICATION_CONTRIBUTORURI = "SyndicationContributorUri";
+
+ public static final String SYNDICATION_SOURCE = "SyndicationSource";
+
+ public static final String SYNDICATION_SUMMARY = "SyndicationSummary";
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmTypeKind.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmTypeKind.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmTypeKind.java
new file mode 100644
index 0000000..13237ca
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmTypeKind.java
@@ -0,0 +1,28 @@
+/*
+ * 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.commons.api.edm.constants;
+
+/**
+ * EdmTypeKind specifies the type of an EDM element.
+ */
+public enum EdmTypeKind {
+
+ UNDEFINED, PRIMITIVE, ENUM, DEFINITION, COMPLEX, ENTITY, NAVIGATION, ACTION, FUNCTION, SYSTEM;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ODataServiceVersion.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ODataServiceVersion.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ODataServiceVersion.java
new file mode 100644
index 0000000..4bd0ea9
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ODataServiceVersion.java
@@ -0,0 +1,140 @@
+/*
+ * 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.commons.api.edm.constants;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * This class is a container for the supported ODataServiceVersions.
+ */
+public enum ODataServiceVersion {
+
+ V10("1.0"),
+ V20("2.0"),
+ V30("3.0"),
+ V40("4.0");
+
+ private static final Pattern DATASERVICEVERSIONPATTERN = Pattern.compile("(\\p{Digit}+\\.\\p{Digit}+)(:?;.*)?");
+
+ public static final String NS_DATASERVICES = "dataservices";
+
+ public static final String NS_METADATA = "metadata";
+
+ public static final String NS_DATA = "data";
+
+ public static final String NS_SCHEME = "scheme";
+
+ public static final String NAVIGATION_LINK_REL = "navigationLinkRel";
+
+ public static final String ASSOCIATION_LINK_REL = "associationLinkRel";
+
+ public static final String MEDIA_EDIT_LINK_REL = "mediaEditLinkRel";
+
+ private static final Map<String, String> V30_NAMESPACES = Collections.unmodifiableMap(new HashMap<String, String>() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ {
+ put(NS_DATASERVICES, "http://schemas.microsoft.com/ado/2007/08/dataservices");
+ put(NS_METADATA, "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata");
+ put(NS_SCHEME, "http://schemas.microsoft.com/ado/2007/08/dataservices/scheme");
+ put(NAVIGATION_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/related/");
+ put(ASSOCIATION_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/");
+ put(MEDIA_EDIT_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/");
+ }
+ });
+
+ private static final Map<String, String> V40_NAMESPACES = Collections.unmodifiableMap(new HashMap<String, String>() {
+
+ private static final long serialVersionUID = 3109256773218160485L;
+
+ {
+ put(NS_METADATA, "http://docs.oasis-open.org/odata/ns/metadata");
+ put(NS_DATA, "http://docs.oasis-open.org/odata/ns/data");
+ }
+ });
+
+ /**
+ * Validates format and range of a data service version string.
+ *
+ * @param version version string
+ * @return <code>true</code> for a valid version
+ */
+ public static boolean validateDataServiceVersion(final String version) {
+ final Matcher matcher = DATASERVICEVERSIONPATTERN.matcher(version);
+ if (matcher.matches()) {
+ final String possibleDataServiceVersion = matcher.group(1);
+ return V10.toString().equals(possibleDataServiceVersion)
+ || V20.toString().equals(possibleDataServiceVersion)
+ || V30.toString().equals(possibleDataServiceVersion)
+ || V40.toString().equals(possibleDataServiceVersion);
+ } else {
+ throw new IllegalArgumentException(version);
+ }
+ }
+
+ /**
+ * actual > comparedTo
+ *
+ * @param actual
+ * @param comparedTo
+ * @return <code>true</code> if actual is bigger than comparedTo
+ */
+ public static boolean isBiggerThan(final String actual, final String comparedTo) {
+ if (!validateDataServiceVersion(comparedTo) || !validateDataServiceVersion(actual)) {
+ throw new IllegalArgumentException("Illegal arguments: " + comparedTo + " and " + actual);
+ }
+
+ final double me = Double.parseDouble(extractDataServiceVersionString(actual));
+ final double other = Double.parseDouble(extractDataServiceVersionString(comparedTo));
+
+ return me > other;
+ }
+
+ private static String extractDataServiceVersionString(final String rawDataServiceVersion) {
+ if (rawDataServiceVersion != null) {
+ final String[] pattern = rawDataServiceVersion.split(";");
+ return pattern[0];
+ }
+
+ return null;
+ }
+ private final String version;
+
+ private ODataServiceVersion(final String version) {
+ this.version = version;
+ }
+
+ public Map<String, String> getNamespaceMap() {
+ return this == V10 || this == V20
+ ? Collections.<String, String>emptyMap()
+ : this == V30
+ ? V30_NAMESPACES
+ : V40_NAMESPACES;
+ }
+
+ @Override
+ public String toString() {
+ return version;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/StoreGeneratedPattern.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/StoreGeneratedPattern.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/StoreGeneratedPattern.java
new file mode 100644
index 0000000..40df765
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/StoreGeneratedPattern.java
@@ -0,0 +1,27 @@
+/*
+ * 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.commons.api.edm.constants;
+
+public enum StoreGeneratedPattern {
+
+ None,
+ Identity,
+ Computed
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/package-info.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/package-info.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/package-info.java
new file mode 100644
index 0000000..2a975bc
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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.commons.api.edm;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataApplicationException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataApplicationException.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataApplicationException.java
deleted file mode 100644
index 045d1d8..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataApplicationException.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.commons.api;
-
-public class ODataApplicationException extends Exception {
-
- private static final long serialVersionUID = 5358683245923127425L;
-
- public ODataApplicationException(final String msg) {
- super(msg);
- }
-
- public ODataApplicationException(final String msg, final Throwable cause) {
- super(msg, cause);
- }
-
- public ODataApplicationException(final Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataException.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataException.java
deleted file mode 100644
index 865cb75..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataException.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.commons.api;
-
-public class ODataException extends Exception {
-
- private static final long serialVersionUID = 3057981437954048107L;
-
- public ODataException(final String msg) {
- super(msg);
- }
-
- public ODataException(final String msg, final Throwable cause) {
- super(msg, cause);
- }
-
- public ODataException(final Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataNotImplementedException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataNotImplementedException.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataNotImplementedException.java
deleted file mode 100644
index e6804a2..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/ODataNotImplementedException.java
+++ /dev/null
@@ -1,33 +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.commons.api;
-
-public class ODataNotImplementedException extends ODataException {
-
- private static final long serialVersionUID = 3921772210762644762L;
-
- public ODataNotImplementedException(final String msg) {
- super(msg);
- }
-
- public ODataNotImplementedException() {
- super("Not implemented");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/Edm.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/Edm.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/Edm.java
deleted file mode 100644
index 26861e3..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/Edm.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 org.apache.olingo.odata4.commons.api.edm;
-
-import java.util.List;
-
-/**
- * Entity Data Model (EDM)
- * <br/>
- * Interface representing a Entity Data Model as described in the Conceptual Schema Definition.
- */
-public interface Edm {
-
- /**
- * Get entity container by full qualified name.
- * <br/>
- * See {@link EdmEntityContainer} for more information.
- *
- * @param name
- * @return {@link EdmEntityContainer}
- */
- EdmEntityContainer getEntityContainer(FullQualifiedName name);
-
- /**
- * Get enum type by full qualified name.
- * <br/>
- * See {@link EdmEnumType} for more information
- *
- * @param name
- * @return {@link EdmEnumType}
- */
- EdmEnumType getEnumType(FullQualifiedName name);
-
- /**
- * Get a type definition by full qualified name.
- * <br/>
- * See {@link EdmTypeDefinition} for more information
- *
- * @param name
- * @return {@link EdmTypeDefinition}
- */
- EdmTypeDefinition getTypeDefinition(FullQualifiedName name);
-
- /**
- * Get entity type by full qualified name.
- * <br/>
- * See {@link EdmEntityType} for more information.
- *
- * @param name
- * @return {@link EdmEntityType}
- */
- EdmEntityType getEntityType(FullQualifiedName name);
-
- /**
- * Get complex type by full qualified name..
- * <br/>
- * See {@link EdmComplexType} for more information.
- *
- * @param name
- * @return {@link EdmComplexType}
- */
- EdmComplexType getComplexType(FullQualifiedName name);
-
- /**
- * Get Action by full qualified name and binding parameter type.
- *
- * @param actionName must not be null
- * @param bindingParameterTypeName may be null if it is an unbound action
- * @param isBindingParameterCollection may be null if it is an unbound action
- * @return {@link EdmAction}
- */
- EdmAction getAction(FullQualifiedName actionName, FullQualifiedName bindingParameterTypeName,
- Boolean isBindingParameterCollection);
-
- /**
- * Get Function by full qualified name and binding parameter type and binding parameter names.
- *
- * @param functionName
- * @param bindingParameterTypeName may be null if it is an unbound function
- * @param isBindingParameterCollection may be null if it is an unbound function
- * @param parameterNames may be null if it is an unbound function
- * @return {@link EdmFunction}
- */
- EdmFunction getFunction(FullQualifiedName functionName, FullQualifiedName bindingParameterTypeName,
- Boolean isBindingParameterCollection, List<String> parameterNames);
-
- /**
- * Get service metadata.
- * <br/>
- * See {@link EdmServiceMetadata} for more information.
- *
- * @return {@link EdmServiceMetadata}
- */
- EdmServiceMetadata getServiceMetadata();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAction.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAction.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAction.java
deleted file mode 100644
index 69632ec..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAction.java
+++ /dev/null
@@ -1,26 +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.commons.api.edm;
-
-/**
- * A CSDL action.
- */
-public interface EdmAction extends EdmOperation {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmActionImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmActionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmActionImport.java
deleted file mode 100644
index ff6f519..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmActionImport.java
+++ /dev/null
@@ -1,27 +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.commons.api.edm;
-
-/**
- * An EdmActionImport.
- */
-public interface EdmActionImport extends EdmOperationImport {
-
- EdmAction getAction();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmActionImportInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmActionImportInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmActionImportInfo.java
deleted file mode 100644
index 18f0d74..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmActionImportInfo.java
+++ /dev/null
@@ -1,40 +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.commons.api.edm;
-
-import java.net.URI;
-
-/**
- * Objects of this class contain information about one action import inside the EntityDataModel.
- */
-public interface EdmActionImportInfo extends EdmOperationImportInfo {
-
- /**
- * @return the action import name
- */
- String getActionImportName();
-
- /**
- * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
- * toASCIIString() method can be used.
- *
- * @return the uri to this function import
- */
- URI getActionImportUri();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAnnotatable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAnnotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAnnotatable.java
deleted file mode 100644
index ac3187f..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAnnotatable.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 org.apache.olingo.odata4.commons.api.edm;
-
-/**
- * EdmAnnotatable can be applied to CSDL elements as described in the Conceptual Schema Definition Language.
- */
-public interface EdmAnnotatable {
-
- EdmAnnotations getAnnotations();
-
- // TODO: enhance annotations
- Object getAnnotation();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAnnotations.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAnnotations.java
deleted file mode 100644
index 524e4b7..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmAnnotations.java
+++ /dev/null
@@ -1,24 +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.commons.api.edm;
-
-//TODO: EDM Annotation Interfaces
-public interface EdmAnnotations {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmBindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmBindingTarget.java
deleted file mode 100644
index e46cf13..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmBindingTarget.java
+++ /dev/null
@@ -1,48 +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.commons.api.edm;
-
-/**
- * Entity Sets or Singletons can be bound to each other using a navigation property binding so an
- * {@link EdmBindingTarget} can either be an {@link EdmEntitySet} or an {@link EdmSingleton}.
- */
-public interface EdmBindingTarget extends EdmNamed {
-
- /**
- * Returns the target for a given path.
- *
- * @param path
- * @return {@link EdmBindingTarget}
- */
- EdmBindingTarget getRelatedBindingTarget(String path);
-
- /**
- * Returns the entity container this target is contained in.
- *
- * @return {@link EdmEntityContainer}
- */
- EdmEntityContainer getEntityContainer();
-
- /**
- * Get the entity type.
- *
- * @return {@link EdmEntityType}
- */
- EdmEntityType getEntityType();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmComplexType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmComplexType.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmComplexType.java
deleted file mode 100644
index 7287228..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmComplexType.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.commons.api.edm;
-
-/**
- * A CSDL ComplexType element.
- * <br/>
- * EdmComplexType holds a set of related information like {@link EdmPrimitiveType} properties and EdmComplexType
- * properties.
- */
-public interface EdmComplexType extends EdmStructuredType {
-
- @Override
- EdmComplexType getBaseType();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmElement.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmElement.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmElement.java
deleted file mode 100644
index 9fcb13f..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmElement.java
+++ /dev/null
@@ -1,27 +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.commons.api.edm;
-
-/**
- * An {@link EdmElement} can either be an {@link EdmNavigationProperty}, an {@link EdmProperty} or an
- * {@link EdmParameter}.
- */
-public interface EdmElement extends EdmNamed, EdmTyped {
-//Should we introduce an element kind?
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntityContainer.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntityContainer.java
deleted file mode 100644
index df816bc..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntityContainer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.commons.api.edm;
-
-/**
- * A CSDL EntityContainer element.
- *
- * <br/>
- * EdmEntityContainer hold the information of EntitySets, Singletons, ActionImports and FunctionImports contained
- */
-public interface EdmEntityContainer extends EdmNamed {
-
- /**
- * @return namespace of this entity container
- */
- String getNamespace();
-
- /**
- * Get contained Singleton by name.
- *
- * @param name
- * @return {@link EdmSingleton}
- */
- EdmSingleton getSingleton(String name);
-
- /**
- * Get contained EntitySet by name.
- *
- * @param name
- * @return {@link EdmEntitySet}
- */
- EdmEntitySet getEntitySet(String name);
-
- /**
- * Get contained ActionImport by name.
- *
- * @param name
- * @return {@link EdmActionImport}
- */
- EdmActionImport getActionImport(String name);
-
- /**
- * Get contained FunctionImport by name.
- *
- * @param name
- * @return {@link EdmFunctionImport}
- */
- EdmFunctionImport getFunctionImport(String name);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntitySet.java
deleted file mode 100644
index 50dbe05..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntitySet.java
+++ /dev/null
@@ -1,29 +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.commons.api.edm;
-
-/**
- * A CSDL EntitySet element.
- * <br/>
- * EdmEntitySet is the container for entity type instances as described in the OData protocol. It can be the target of a
- * navigation property binding.
- */
-public interface EdmEntitySet extends EdmBindingTarget {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntitySetInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntitySetInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntitySetInfo.java
deleted file mode 100644
index b4b9983..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntitySetInfo.java
+++ /dev/null
@@ -1,47 +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.commons.api.edm;
-
-import java.net.URI;
-
-/**
- * Objects of this class contain information about one entity set inside the EntityDataModel.
- */
-public interface EdmEntitySetInfo {
-
- // TODO: Either make this a class or alias info an interface!
- /**
- * @return the entity container name which contains this entity set.
- */
- String getEntityContainerName();
-
- /**
- * @return the entity set name
- */
- String getEntitySetName();
-
- /**
- * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
- * toASCIIString() method can be used.
- *
- * @return the uri to this entity set e.g. "Employees"
- */
- URI getEntitySetUri();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntityType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntityType.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntityType.java
deleted file mode 100644
index b582551..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEntityType.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.commons.api.edm;
-
-import java.util.List;
-
-/**
- * A CSDL EntityType element.
- */
-public interface EdmEntityType extends EdmStructuredType {
-
- /**
- * Gets all key predicate names. In case an alias is defined for a key predicate this will be returned.
- *
- * @return collection of key property names of type List<String>
- */
- List<String> getKeyPredicateNames();
-
- /**
- * Get all key properties references as list of {@link EdmKeyPropertyRef}.
- *
- * @return collection of key properties of type List<EdmKeyPropertyRef>
- */
- List<EdmKeyPropertyRef> getKeyPropertyRefs();
-
- /**
- * Get a key property ref by its name.
- *
- * @param keyPredicateName
- * @return {@link EdmKeyPropertyRef} for given name
- */
- EdmKeyPropertyRef getKeyPropertyRef(String keyPredicateName);
-
- /**
- * Indicates if the entity type is treated as Media Link Entry with associated Media Resource.
- *
- * @return <code>true</code> if the entity type is a Media Link Entry
- */
- boolean hasStream();
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.olingo.api.edm.EdmStructuralType#getBaseType()
- */
- @Override
- EdmEntityType getBaseType();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEnumType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEnumType.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEnumType.java
deleted file mode 100644
index d1ad9d9..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmEnumType.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.commons.api.edm;
-
-import java.util.List;
-
-/**
- * An EdmEnumType represents a set of related values.
- */
-public interface EdmEnumType extends EdmPrimitiveType {
-
- /**
- * @param name
- * @return {@link EdmMember} for the given name
- */
- EdmMember getMember(String name);
-
- /**
- * @return member names as a list
- */
- List<String> getMemberNames();
-
- /**
- * @return the {@link EdmPrimitiveType} this {@link EdmEnumType} is based upon
- */
- EdmPrimitiveType getUnderlyingType();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmException.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmException.java
deleted file mode 100644
index 8360f08..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmException.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.commons.api.edm;
-
-public class EdmException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- public EdmException(final Exception cause) {
- super(cause);
- }
-
- public EdmException(final String msg) {
- super(msg);
- }
-
- public EdmException(final String string, final Exception cause) {
- super(string, cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunction.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunction.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunction.java
deleted file mode 100644
index 084eb62..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunction.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.commons.api.edm;
-
-/**
- * An EdmFunction as described in the OData specification
- */
-public interface EdmFunction extends EdmOperation {
-
- /**
- * @return true if this function is composable
- */
- boolean isComposable();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunctionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunctionImport.java
deleted file mode 100644
index 344f76d..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunctionImport.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 org.apache.olingo.odata4.commons.api.edm;
-
-import java.util.List;
-
-/**
- * A CSDL FunctionImport element
- */
-public interface EdmFunctionImport extends EdmOperationImport {
-
- EdmFunction getFunction(List<String> parameterNames);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunctionImportInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunctionImportInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunctionImportInfo.java
deleted file mode 100644
index 28fc6fa..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmFunctionImportInfo.java
+++ /dev/null
@@ -1,40 +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.commons.api.edm;
-
-import java.net.URI;
-
-/**
- * Objects of this class contain information about one function import inside the EntityDataModel.
- */
-public interface EdmFunctionImportInfo extends EdmOperationImportInfo {
-
- /**
- * @return the function import name
- */
- String getFunctionImportName();
-
- /**
- * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
- * toASCIIString() method can be used.
- *
- * @return the uri to this function import
- */
- URI getFunctionImportUri();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmKeyPropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmKeyPropertyRef.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmKeyPropertyRef.java
deleted file mode 100644
index 3b20ab5..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmKeyPropertyRef.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.commons.api.edm;
-
-public interface EdmKeyPropertyRef {
-
- /**
- * @return name of the key predicate
- */
- String getKeyPropertyName();
-
- /**
- * @return alias of this reference or null if not set
- */
- String getAlias();
-
- /**
- * @return path to the property
- */
- String getPath();
-
- /**
- * @return the property this property ref points to
- */
- EdmProperty getProperty();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMappable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMappable.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMappable.java
deleted file mode 100644
index c16d357..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMappable.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.commons.api.edm;
-
-/**
- * EdmMappable can be applied to CSDL elements to associate additional information.
- */
-public interface EdmMappable {
-
- /**
- * Get mapping information applied to an EDM element
- *
- * @return {@link EdmMapping}
- */
- EdmMapping getMapping();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMapping.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMapping.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMapping.java
deleted file mode 100644
index 2f96fc3..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMapping.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.commons.api.edm;
-
-/**
- * EdmMapping holds custom mapping information which can be applied to a CSDL element.
- */
-public interface EdmMapping {
-
- /**
- * Get the mapping value
- *
- * @return mapping name as String
- */
- String getInternalName();
-
- /**
- * Get the set object for this mapping
- *
- * @return {@link Object} object
- */
- Object getObject();
-
- /**
- * Gets the key under which the resource source value can be found in the data map.
- *
- * @return the key of the media resource source
- */
- String getMediaResourceSourceKey();
-
- /**
- * Gets the key under which the resource mime type can be found in the data map.
- *
- * @return the key of the media resource type
- */
- String getMediaResourceMimeTypeKey();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMember.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMember.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMember.java
deleted file mode 100644
index 9633311..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmMember.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 org.apache.olingo.odata4.commons.api.edm;
-
-/**
- * An {@link EdmEnumType} member element.
- */
-public interface EdmMember extends EdmNamed {
-
- /**
- * @return value of this member as string
- */
- String getValue();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmNamed.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmNamed.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmNamed.java
deleted file mode 100644
index e9f2c28..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmNamed.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 org.apache.olingo.odata4.commons.api.edm;
-
-/**
- * EdmNamed is the base interface for nearly all CSDL constructs.
- */
-public interface EdmNamed {
-
- /**
- * @return name as String
- */
- String getName();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmNavigationProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmNavigationProperty.java
deleted file mode 100644
index e1fc4be..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmNavigationProperty.java
+++ /dev/null
@@ -1,40 +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.commons.api.edm;
-
-/**
- * A CSDL NavigationProperty element
- * <br/>
- * EdmNavigationProperty allows navigation from one entity type to another via a relationship.
- */
-public interface EdmNavigationProperty extends EdmElement {
-
- /**
- * @return true if nullable or null if not specified
- */
- Boolean isNullable();
-
- /**
- * @return the partner navigation property
- */
- EdmNavigationProperty getPartner();
-
- String getReferencingPropertyName(String referencedPropertyName);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperation.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperation.java
deleted file mode 100644
index 4e47db6..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperation.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.commons.api.edm;
-
-import java.util.List;
-
-/**
- * A EdmOperation can either be an {@link EdmAction} or an {@link EdmFunction}.
- */
-public interface EdmOperation extends EdmType {
-
- /**
- * @param name
- * @return {@link EdmParameter} for this name
- */
- EdmParameter getParameter(String name);
-
- /**
- * @return a list of all parameter names
- */
- List<String> getParameterNames();
-
- /**
- * @param bindingParameterEntitySet
- * @return {@link EdmEntitySet} for this binding
- */
- EdmEntitySet getReturnedEntitySet(EdmEntitySet bindingParameterEntitySet);
-
- /**
- * @return {@link EdmReturnType} of this operation
- */
- EdmReturnType getReturnType();
-
- /**
- * For more information on bound operations please refer to the OData V4 specification.
- *
- * @return true if bound
- */
- boolean isBound();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperationImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperationImport.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperationImport.java
deleted file mode 100644
index 15e8d5d..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperationImport.java
+++ /dev/null
@@ -1,36 +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.commons.api.edm;
-
-/**
- * An EdmOperationImport can be an EdmActionImport or an EdmFunctionImport.
- */
-public interface EdmOperationImport extends EdmNamed {
-
- /**
- * @return {@link EdmEntitySet} of this OperationImport
- */
- EdmEntitySet getReturnedEntitySet();
-
- /**
- * @return {@link EdmEntityContainer} of this EdmOperationImport
- */
- EdmEntityContainer getEntityContainer();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperationImportInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperationImportInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperationImportInfo.java
deleted file mode 100644
index 1c2c62a..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmOperationImportInfo.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.commons.api.edm;
-
-/**
- * Objects of this class contain information about one action or function import inside the EntityDataModel.
- */
-public interface EdmOperationImportInfo {
-
- /**
- * @return the entity container name which contains this function import.
- */
- String getEntityContainerName();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmParameter.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmParameter.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmParameter.java
deleted file mode 100644
index 9ba655a..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmParameter.java
+++ /dev/null
@@ -1,45 +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.commons.api.edm;
-
-/**
- * A CSDL parameter element
- */
-public interface EdmParameter extends EdmElement, EdmMappable {
-
- /**
- * @return true if nullable or null if not specified
- */
- Boolean isNullable();
-
- /**
- * @return the maximum length as an Integer or null if not specified
- */
- Integer getMaxLength();
-
- /**
- * @return the precision as an Integer or null if not specified
- */
- Integer getPrecision();
-
- /**
- * @return the scale as an Integer or null if not specified
- */
- Integer getScale();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmPrimitiveType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmPrimitiveType.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmPrimitiveType.java
deleted file mode 100644
index 5771157..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmPrimitiveType.java
+++ /dev/null
@@ -1,166 +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.commons.api.edm;
-
-/**
- * EdmPrimitiveType is a primitive type as defined in the Entity Data Model (EDM).
- * <br/>
- * There are methods to convert EDM primitive types from and to Java objects, respectively. The following Java types are
- * supported:
- * <table frame="hsides" rules="groups">
- * <thead>
- * <tr><th>EDM primitive type</th><th>Java types</th></tr>
- * </thead>
- * <tbody>
- * <tr><td>Binary</td><td>byte[], {@link Byte}[]</td></tr>
- * <tr><td>Boolean</td><td>{@link Boolean}</td></tr>
- * <tr><td>Byte</td><td>{@link Short}, {@link Byte}, {@link Integer}, {@link Long}, {@link java.math.BigInteger}
- * </td></tr>
- * <tr><td>Date</td><td>{@link java.util.Calendar}, {@link java.util.Date}, {@link Long}</td></tr>
- * <tr><td>DateTimeOffset</td><td>{@link java.util.Calendar}, {@link java.util.Date}, {@link Long}</td></tr>
- * <tr><td>Decimal</td><td>{@link java.math.BigDecimal}, {@link java.math.BigInteger}, {@link Double}, {@link Float},
- * {@link Byte}, {@link Short}, {@link Integer}, {@link Long}</td></tr>
- * <tr><td>Double</td><td>{@link Double}, {@link Float}, {@link java.math.BigDecimal}, {@link Byte}, {@link Short},
- * {@link Integer}, {@link Long}</td></tr>
- * <tr><td>Duration</td><td>{@link java.math.BigDecimal}, {@link java.math.BigInteger}, {@link Double}, {@link Float},
- * {@link Byte}, {@link Short}, {@link Integer}, {@link Long}</td></tr>
- * <tr><td>Guid</td><td>{@link java.util.UUID}</td></tr>
- * <tr><td>Int16</td><td>{@link Short}, {@link Byte}, {@link Integer}, {@link Long}, {@link java.math.BigInteger}
- * </td></tr>
- * <tr><td>Int32</td><td>{@link Integer}, {@link Byte}, {@link Short}, {@link Long}, {@link java.math.BigInteger}
- * </td></tr>
- * <tr><td>Int64</td><td>{@link Long}, {@link Byte}, {@link Short}, {@link Integer}, {@link java.math.BigInteger}
- * </td></tr>
- * <tr><td>SByte</td><td>{@link Byte}, {@link Short}, {@link Integer}, {@link Long}, {@link java.math.BigInteger}
- * </td></tr>
- * <tr><td>Single</td><td>{@link Float}, {@link Double}, {@link java.math.BigDecimal}, {@link Byte}, {@link Short},
- * {@link Integer}, {@link Long}</td></tr>
- * <tr><td>String</td><td>{@link String}</td></tr>
- * <tr><td>TimeOfDay</td><td>{@link java.util.Calendar}, {@link java.util.Date}, {@link Long}</td></tr>
- * </tbody>
- * </table>
- * <p>
- * The first Java type is the default type for the respective EDM primitive type.
- * </p>
- * <p>
- * For all EDM primitive types, the <code>Nullable</code> facet is taken into account. For <code>Binary</code> and
- * <code>String</code>, <code>MaxLength</code> is also applicable. For <code>String</code>, the facet
- * <code>Unicode</code> is considered additionally. The EDM primitive types <code>DateTimeOffset</code>,
- * <code>Decimal</code>, <code>Duration</code>, and <code>TimeOfDay</code> can have a <code>Precision</code> facet.
- * Additionally, <code>Decimal</code> can have the facet <code>Scale</code>.
- * </p>
- */
-public interface EdmPrimitiveType extends EdmType {
-
- static final String EDM_NAMESPACE = "Edm";
-
- static final String SYSTEM_NAMESPACE = "System";
-
- /**
- * Checks type compatibility.
- *
- * @param primitiveType the {@link EdmPrimitiveType} to be tested for compatibility
- * @return <code>true</code> if the provided type is compatible to this type
- */
- boolean isCompatible(EdmPrimitiveType primitiveType);
-
- /**
- * Returns the default Java type for this EDM primitive type as described in the documentation of
- * {@link EdmPrimitiveType}.
- *
- * @return the default Java type
- */
- Class<?> getDefaultType();
-
- /**
- * Validates literal value.
- *
- * @param value the literal value
- * @param isNullable whether the <code>null</code> value is allowed
- * @param maxLength the maximum length
- * @param precision the precision
- * @param scale the scale
- * @param isUnicode whether non-ASCII characters are allowed (relevant only for Edm.String)
- * @return <code>true</code> if the validation is successful
- */
- boolean validate(String value,
- Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode);
-
- /**
- * Converts literal representation of value to system data type.
- *
- * @param value the literal representation of value
- * @param isNullable whether the <code>null</code> value is allowed
- * @param maxLength the maximum length
- * @param precision the precision
- * @param scale the scale
- * @param isUnicode whether non-ASCII characters are allowed (relevant only for Edm.String)
- * @param returnType the class of the returned value; it must be one of the list in the documentation of
- * {@link EdmPrimitiveType}
- * @throws EdmPrimitiveTypeException
- * @return the value as an instance of the class the parameter <code>returnType</code> indicates
- */
- <T> T valueOfString(String value,
- Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode,
- Class<T> returnType) throws EdmPrimitiveTypeException;
-
- /**
- * Converts system data type to literal representation of value.
- * <p>
- * Returns <code>null</code> if value is <code>null</code> and <code>null</code> is an allowed value.
- * </p>
- *
- * @param value the Java value as Object; its type must be one of the list in the documentation of
- * {@link EdmPrimitiveType}
- * @param isNullable whether the <code>null</code> value is allowed
- * @param maxLength the maximum length
- * @param precision the precision
- * @param scale the scale
- * @param isUnicode whether non-ASCII characters are allowed (relevant only for Edm.String)
- * @throws EdmPrimitiveTypeException
- * @return literal representation as String
- */
- String valueToString(Object value,
- Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode)
- throws EdmPrimitiveTypeException;
-
- /**
- * Converts default literal representation to URI literal representation.
- * <p>
- * Returns <code>null</code> if the literal is <code>null</code>. Does not perform any validation.
- * </p>
- *
- * @param literal the literal in default representation
- * @return URI literal representation as String
- */
- String toUriLiteral(String literal);
-
- /**
- * Converts URI literal representation to default literal representation.
- * <p>
- * Returns <code>null</code> if the literal is <code>null</code>. Checks the presence of a required prefix and of
- * required surrounding quotation marks but does not perform any further validation.
- * </p>
- *
- * @param literal the literal in URI representation
- * @return default literal representation as String
- * @throws EdmPrimitiveTypeException if a required prefix or required surrounding quotation marks are missing
- */
- String fromUriLiteral(String literal) throws EdmPrimitiveTypeException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmPrimitiveTypeException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmPrimitiveTypeException.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmPrimitiveTypeException.java
deleted file mode 100644
index 5691fd2..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmPrimitiveTypeException.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.commons.api.edm;
-
-public class EdmPrimitiveTypeException extends Exception {
-
- private static final long serialVersionUID = -93578822384514620L;
-
- public EdmPrimitiveTypeException(final String msg) {
- super(msg);
- }
-
- public EdmPrimitiveTypeException(final String msg, final Exception cause) {
- super(msg, cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmProperty.java
deleted file mode 100644
index 6453163..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmProperty.java
+++ /dev/null
@@ -1,71 +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.commons.api.edm;
-
-/**
- * A CSDL Property element.
- * <br/>
- * EdmProperty defines a simple type or a complex type.
- */
-public interface EdmProperty extends EdmElement, EdmMappable {
-
- /**
- * Gets the related MIME type for the property.
- *
- * @return MIME type as String
- */
- String getMimeType();
-
- /**
- * Gets the info if the property is a primitive property.
- *
- * @return true, if it is a primitive property
- */
- boolean isPrimitive();
-
- /**
- * @return true if nullable or null if not specified
- */
- Boolean isNullable();
-
- /**
- * @return the maximum length as an Integer or null if not specified
- */
- Integer getMaxLength();
-
- /**
- * @return the precision as an Integer or null if not specified
- */
- Integer getPrecision();
-
- /**
- * @return the scale as an Integer or null if not specified
- */
- Integer getScale();
-
- /**
- * @return true if unicode or null if not specified
- */
- Boolean isUnicode();
-
- /**
- * @return the default value as a String or null if not specified
- */
- String getDefaultValue();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmReturnType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmReturnType.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmReturnType.java
deleted file mode 100644
index 556093d..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmReturnType.java
+++ /dev/null
@@ -1,45 +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.commons.api.edm;
-
-/**
- * An {@link EdmReturnType} of an {@link EdmOperation}.
- */
-public interface EdmReturnType extends EdmTyped {
-
- /**
- * @return true if nullable or null if not specified
- */
- Boolean isNullable();
-
- /**
- * @return the maximum length as an Integer or null if not specified
- */
- Integer getMaxLength();
-
- /**
- * @return the precision as an Integer or null if not specified
- */
- Integer getPrecision();
-
- /**
- * @return the scale as an Integer or null if not specified
- */
- Integer getScale();
-}
[43/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Schema.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Schema.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Schema.java
deleted file mode 100644
index bfccae2..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Schema.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.edm.xml.v4;
-
-import java.util.List;
-
-public interface Schema extends org.apache.olingo.odata4.client.api.edm.xml.Schema, AnnotatedEdmItem {
-
- @Override
- List<EntityContainer> getEntityContainers();
-
- EntityContainer getEntityContainer();
-
- @Override
- ComplexType getComplexType(String name);
-
- @Override
- List<ComplexType> getComplexTypes();
-
- @Override
- EntityType getEntityType(String name);
-
- @Override
- List<EntityType> getEntityTypes();
-
- List<Action> getActions();
-
- List<Action> getActions(String name);
-
- List<Annotation> getAnnotations();
-
- List<Function> getFunctions();
-
- List<Function> getFunctions(String name);
-
- List<Term> getTerms();
-
- TypeDefinition getTypeDefinition(String name);
-
- List<TypeDefinition> getTypeDefinitions();
-
- @Override
- List<Annotations> getAnnotationsList();
-
- @Override
- Annotations getAnnotationsList(String target);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Singleton.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Singleton.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Singleton.java
deleted file mode 100644
index 1bc6135..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Singleton.java
+++ /dev/null
@@ -1,25 +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.api.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.EntitySet;
-
-public interface Singleton extends EntitySet, BindingTarget {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Term.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Term.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Term.java
deleted file mode 100644
index 86e6a3f..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/Term.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.api.edm.xml.v4;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.Named;
-
-public interface Term extends Named {
-
- List<CSDLElement> getAppliesTo();
-
- String getBaseTerm();
-
- String getDefaultValue();
-
- Integer getMaxLength();
-
- Integer getPrecision();
-
- Integer getScale();
-
- String getSrid();
-
- String getType();
-
- boolean isNullable();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/TypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/TypeDefinition.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/TypeDefinition.java
deleted file mode 100644
index 424a502..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/TypeDefinition.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.edm.xml.v4;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.Named;
-
-public interface TypeDefinition extends Named {
-
- List<Annotation> getAnnotations();
-
- Integer getMaxLength();
-
- Integer getPrecision();
-
- Integer getScale();
-
- String getSrid();
-
- String getUnderlyingType();
-
- boolean isUnicode();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/XMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/XMLMetadata.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/XMLMetadata.java
deleted file mode 100644
index 5b8d851..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/XMLMetadata.java
+++ /dev/null
@@ -1,36 +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.api.edm.xml.v4;
-
-import java.util.List;
-
-public interface XMLMetadata extends org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata {
-
- @Override
- List<Schema> getSchemas();
-
- @Override
- Schema getSchema(int index);
-
- @Override
- Schema getSchema(String key);
-
- List<Reference> getReferences();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/ConstExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/ConstExprConstruct.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/ConstExprConstruct.java
deleted file mode 100644
index 7d374fd..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/ConstExprConstruct.java
+++ /dev/null
@@ -1,56 +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.api.edm.xml.v4.annotation;
-
-public interface ConstExprConstruct extends ExprConstruct {
-
- public enum Type {
-
- Binary,
- Bool,
- Date,
- DateTimeOffset,
- Decimal,
- Duration,
- EnumMember,
- Float,
- Guid,
- Int,
- String,
- TimeOfDay;
-
- public static Type fromString(final String value) {
- Type result = null;
- try {
- result = valueOf(value);
- } catch (IllegalArgumentException e) {
- // ignore
- }
- return result;
- }
- }
-
- Type getType();
-
- void setType(Type type);
-
- String getValue();
-
- void setValue(String value);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/DynExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/DynExprConstruct.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/DynExprConstruct.java
deleted file mode 100644
index 14c4b68..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/DynExprConstruct.java
+++ /dev/null
@@ -1,23 +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.api.edm.xml.v4.annotation;
-
-public interface DynExprConstruct extends ExprConstruct {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/ExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/ExprConstruct.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/ExprConstruct.java
deleted file mode 100644
index 7a3e6f2..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/v4/annotation/ExprConstruct.java
+++ /dev/null
@@ -1,23 +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.api.edm.xml.v4.annotation;
-
-public interface ExprConstruct {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataFormat.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataFormat.java
deleted file mode 100644
index 939c5a0..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataFormat.java
+++ /dev/null
@@ -1,97 +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.api.format;
-
-import org.apache.http.entity.ContentType;
-
-/**
- * Available formats to be used in various contexts.
- */
-public enum ODataFormat {
-
- /**
- * JSON format with no metadata.
- */
- JSON_NO_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=nometadata"),
- /**
- * JSON format with minimal metadata (default).
- */
- JSON(ContentType.APPLICATION_JSON.getMimeType() + ";odata=minimalmetadata"),
- /**
- * JSON format with no metadata.
- */
- JSON_FULL_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=fullmetadata"),
- /**
- * XML format.
- */
- XML(ContentType.APPLICATION_XML.getMimeType());
-
- private final String format;
-
- ODataFormat(final String format) {
- this.format = format;
- }
-
- /**
- * Gets format as a string.
- *
- * @return format as a string.
- */
- @Override
- public String toString() {
- return format;
- }
-
- /**
- * Gets OData format from its string representation.
- *
- * @param format string representation of the format.
- * @return OData format.
- */
- public static ODataFormat fromString(final String format) {
- ODataFormat result = null;
-
- final StringBuffer _format = new StringBuffer();
-
- final String[] parts = format.split(";");
- _format.append(parts[0]);
- if (ContentType.APPLICATION_JSON.getMimeType().equals(parts[0])) {
- if (parts.length > 1) {
- _format.append(';').append(parts[1]);
- } else {
- result = ODataFormat.JSON;
- }
- }
-
- if (result == null) {
- final String candidate = _format.toString();
- for (ODataFormat value : values()) {
- if (candidate.equals(value.toString())) {
- result = value;
- }
- }
- }
-
- if (result == null) {
- throw new IllegalArgumentException("Unsupported format: " + format);
- }
-
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataMediaFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataMediaFormat.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataMediaFormat.java
deleted file mode 100644
index 415c669..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataMediaFormat.java
+++ /dev/null
@@ -1,71 +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.api.format;
-
-import org.apache.http.entity.ContentType;
-
-/**
- * Available formats for media.
- */
-public enum ODataMediaFormat {
-
- CHARSET_PARAMETER("charset"),
- MEDIA_TYPE_WILDCARD("*"),
- WILDCARD("*/*"),
- APPLICATION_XML(ContentType.APPLICATION_XML.getMimeType()),
- APPLICATION_ATOM_XML(ContentType.APPLICATION_ATOM_XML.getMimeType()),
- APPLICATION_XHTML_XML(ContentType.APPLICATION_XHTML_XML.getMimeType()),
- APPLICATION_SVG_XML(ContentType.APPLICATION_SVG_XML.getMimeType()),
- APPLICATION_JSON(ContentType.APPLICATION_JSON.getMimeType()),
- APPLICATION_FORM_URLENCODED(ContentType.APPLICATION_FORM_URLENCODED.getMimeType()),
- MULTIPART_FORM_DATA(ContentType.MULTIPART_FORM_DATA.getMimeType()),
- APPLICATION_OCTET_STREAM(ContentType.APPLICATION_OCTET_STREAM.getMimeType()),
- TEXT_PLAIN(ContentType.TEXT_PLAIN.getMimeType()),
- TEXT_XML(ContentType.TEXT_XML.getMimeType()),
- TEXT_HTML(ContentType.TEXT_HTML.getMimeType());
-
- private final String format;
-
- private ODataMediaFormat(final String format) {
- this.format = format;
- }
-
- @Override
- public String toString() {
- return format;
- }
-
- public static ODataMediaFormat fromFormat(final String format) {
- final String _format = format.split(";")[0];
-
- ODataMediaFormat result = null;
-
- for (ODataMediaFormat value : values()) {
- if (_format.equals(value.toString())) {
- result = value;
- }
- }
-
- if (result == null) {
- throw new IllegalArgumentException("Unsupported format: " + format);
- }
-
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataPubFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataPubFormat.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataPubFormat.java
deleted file mode 100644
index 10ef838..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataPubFormat.java
+++ /dev/null
@@ -1,97 +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.api.format;
-
-import org.apache.http.entity.ContentType;
-
-/**
- * Available formats for AtomPub exchange.
- */
-public enum ODataPubFormat {
-
- /**
- * JSON format with no metadata.
- */
- JSON_NO_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=nometadata"),
- /**
- * JSON format with minimal metadata (default).
- */
- JSON(ContentType.APPLICATION_JSON.getMimeType() + ";odata=minimalmetadata"),
- /**
- * JSON format with no metadata.
- */
- JSON_FULL_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=fullmetadata"),
- /**
- * Atom format.
- */
- ATOM(ContentType.APPLICATION_ATOM_XML.getMimeType());
-
- private final String format;
-
- ODataPubFormat(final String format) {
- this.format = format;
- }
-
- /**
- * Gets format as a string.
- *
- * @return format as a string.
- */
- @Override
- public String toString() {
- return format;
- }
-
- /**
- * Gets OData format from its string representation.
- *
- * @param format string representation of the format.
- * @return OData format.
- */
- public static ODataPubFormat fromString(final String format) {
- ODataPubFormat result = null;
-
- final StringBuffer _format = new StringBuffer();
-
- final String[] parts = format.split(";");
- _format.append(parts[0]);
- if (ContentType.APPLICATION_JSON.getMimeType().equals(parts[0])) {
- if (parts.length > 1 && parts[1].startsWith("odata=")) {
- _format.append(';').append(parts[1]);
- } else {
- result = ODataPubFormat.JSON;
- }
- }
-
- if (result == null) {
- final String candidate = _format.toString();
- for (ODataPubFormat value : values()) {
- if (candidate.equals(value.toString())) {
- result = value;
- }
- }
- }
-
- if (result == null) {
- throw new IllegalArgumentException("Unsupported format: " + format);
- }
-
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataValueFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataValueFormat.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataValueFormat.java
deleted file mode 100644
index b4db6a3..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/format/ODataValueFormat.java
+++ /dev/null
@@ -1,76 +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.api.format;
-
-import org.apache.http.entity.ContentType;
-
-/**
- * Available formats for property values.
- */
-public enum ODataValueFormat {
-
- /**
- * Application octet stream.
- */
- STREAM(ContentType.APPLICATION_OCTET_STREAM.getMimeType()),
- /**
- * Plain text format.
- */
- TEXT(ContentType.TEXT_PLAIN.getMimeType());
-
- private final String format;
-
- ODataValueFormat(final String format) {
- this.format = format;
- }
-
- /**
- * Gets format as a string.
- *
- * @return format as a string.
- */
- @Override
- public String toString() {
- return format;
- }
-
- /**
- * Gets format from its string representation.
- *
- * @param format string representation of the format.
- * @return OData format.
- */
- public static ODataValueFormat fromString(final String format) {
- final String _format = format.split(";")[0];
-
- ODataValueFormat result = null;
-
- for (ODataValueFormat value : values()) {
- if (_format.equals(value.toString())) {
- result = value;
- }
- }
-
- if (result == null) {
- throw new IllegalArgumentException("Unsupported format: " + format);
- }
-
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpClientException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpClientException.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpClientException.java
deleted file mode 100644
index 9261059..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpClientException.java
+++ /dev/null
@@ -1,68 +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.api.http;
-
-/**
- * A client-side processing runtime exception.
- *
- * The exception is thrown during HTTP request invocation processing, to signal a failure to process the HTTP request or
- * response. The exception message or nested {@link Throwable} cause SHOULD contain additional information about the
- * reason of the processing failure.
- */
-public class HttpClientException extends RuntimeException {
-
- private static final long serialVersionUID = -4232431597816056514L;
-
- /**
- * Constructs a new client-side runtime exception with the specified cause and a detail message of
- * {@code (cause==null ? null : cause.toString())} (which typically contains the class and detail message of
- * {@code cause}). This constructor is useful for runtime exceptions that are little more than wrappers for other
- * throwables.
- *
- * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null}
- * value is permitted, and indicates that the cause is nonexistent or unknown.)
- */
- public HttpClientException(final Throwable cause) {
- super(cause);
- }
-
- /**
- * Constructs a new client-side runtime exception with the specified detail message and cause.
- * <br/>
- * Note that the detail message associated with {@code cause} is <i>not</i>
- * automatically incorporated in this runtime exception's detail message.
- *
- * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
- * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null}
- * value is permitted, and indicates that the cause is nonexistent or unknown.)
- */
- public HttpClientException(final String message, final Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructs a new client-side runtime exception with the specified detail message. The cause is not initialized, and
- * may subsequently be initialized by a call to {@link #initCause}.
- *
- * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
- */
- public HttpClientException(final String message) {
- super(message);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpClientFactory.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpClientFactory.java
deleted file mode 100644
index e73f1b4..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpClientFactory.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 org.apache.olingo.odata4.client.api.http;
-
-import java.net.URI;
-import org.apache.http.client.HttpClient;
-
-/**
- * Interface used by ODataRequest implementations to instantiate HttpClient.
- */
-public interface HttpClientFactory {
-
- HttpClient createHttpClient(HttpMethod method, URI uri);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpMethod.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpMethod.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpMethod.java
deleted file mode 100644
index 266b52b..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpMethod.java
+++ /dev/null
@@ -1,33 +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.api.http;
-
-/**
- * Supported HTTP methods.
- */
-public enum HttpMethod {
-
- GET,
- POST,
- PUT,
- PATCH,
- MERGE,
- DELETE;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpUriRequestFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpUriRequestFactory.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpUriRequestFactory.java
deleted file mode 100644
index c36e26a..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/HttpUriRequestFactory.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 org.apache.olingo.odata4.client.api.http;
-
-import java.net.URI;
-import org.apache.http.client.methods.HttpUriRequest;
-
-/**
- * Interface used by ODataRequest implementations to create the HttpUriRequest.
- */
-public interface HttpUriRequestFactory {
-
- HttpUriRequest createHttpUriRequest(HttpMethod method, URI uri);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/NoContentException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/NoContentException.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/NoContentException.java
deleted file mode 100644
index e202234..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/http/NoContentException.java
+++ /dev/null
@@ -1,36 +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.api.http;
-
-import org.apache.http.HttpStatus;
-
-/**
- * Exception to be thrown when trying to read content with HTTP status 204.
- */
-public class NoContentException extends HttpClientException {
-
- private static final long serialVersionUID = 7947066635285809192L;
-
- /**
- * Constructs a new client-side runtime exception, with fixed message.
- */
- public NoContentException() {
- super("No content found when HTTP status is " + HttpStatus.SC_NO_CONTENT);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataBinder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataBinder.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataBinder.java
deleted file mode 100644
index 6468650..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataBinder.java
+++ /dev/null
@@ -1,121 +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.api.op;
-
-import java.io.Serializable;
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.api.domain.ODataServiceDocument;
-
-public interface ODataBinder extends Serializable {
-
- /**
- * Gets <tt>ODataServiceDocument</tt> from the given service document resource.
- *
- * @param resource service document resource.
- * @return <tt>ODataServiceDocument</tt> object.
- */
- ODataServiceDocument getODataServiceDocument(ServiceDocument resource);
-
- /**
- * Gets a <tt>FeedResource</tt> from the given OData entity set.
- *
- * @param <T> feed resource type.
- * @param feed OData entity set.
- * @param reference reference class.
- * @return <tt>FeedResource</tt> object.
- */
-// <T extends Feed> T getFeed(ODataEntitySet feed, Class<T> reference);
- /**
- * Gets an <tt>EntryResource</tt> from the given OData entity.
- *
- * @param <T> entry resource type.
- * @param entity OData entity.
- * @param reference reference class.
- * @return <tt>EntryResource</tt> object.
- */
-// <T extends Entry> T getEntry(ODataEntity entity, Class<T> reference);
- /**
- * Gets an <tt>EntryResource</tt> from the given OData entity.
- *
- * @param <T> entry resource type.
- * @param entity OData entity.
- * @param reference reference class.
- * @param setType whether to explicitly output type information.
- * @return <tt>EntryResource</tt> object.
- */
-// <T extends Entry> T getEntry(ODataEntity entity, Class<T> reference, boolean setType);
- /**
- * Gets the given OData property as DOM element.
- *
- * @param prop OData property.
- * @return <tt>Element</tt> object.
- */
-// Element toDOMElement(ODataProperty prop);
-// ODataLinkCollection getLinkCollection(LinkCollection linkCollection);
- /**
- * Gets <tt>ODataEntitySet</tt> from the given feed resource.
- *
- * @param resource feed resource.
- * @return <tt>ODataEntitySet</tt> object.
- */
-// ODataEntitySet getODataEntitySet(Feed resource);
- /**
- * Gets <tt>ODataEntitySet</tt> from the given feed resource.
- *
- * @param resource feed resource.
- * @param defaultBaseURI default base URI.
- * @return <tt>ODataEntitySet</tt> object.
- */
-// ODataEntitySet getODataEntitySet(Feed resource, URI defaultBaseURI);
- /**
- * Gets <tt>ODataEntity</tt> from the given entry resource.
- *
- * @param resource entry resource.
- * @return <tt>ODataEntity</tt> object.
- */
-// ODataEntity getODataEntity(Entry resource);
- /**
- * Gets <tt>ODataEntity</tt> from the given entry resource.
- *
- * @param resource entry resource.
- * @param defaultBaseURI default base URI.
- * @return <tt>ODataEntity</tt> object.
- */
-// ODataEntity getODataEntity(Entry resource, URI defaultBaseURI);
- /**
- * Gets a <tt>LinkResource</tt> from the given OData link.
- *
- * @param <T> link resource type.
- * @param link OData link.
- * @param reference reference class.
- * @return <tt>LinkResource</tt> object.
- */
-// @SuppressWarnings("unchecked")
-// <T extends Link> T getLinkResource(ODataLink link, Class<T> reference);
-
- /**
- * Gets an <tt>ODataProperty</tt> from the given DOM element.
- *
- * @param property content.
- * @return <tt>ODataProperty</tt> object.
- */
-// ODataProperty getProperty(Element property);
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataDeserializer.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataDeserializer.java
deleted file mode 100644
index 047983d..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataDeserializer.java
+++ /dev/null
@@ -1,93 +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.api.op;
-
-import java.io.InputStream;
-import java.io.Serializable;
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.w3c.dom.Element;
-
-/**
- * Utility class for serialization.
- */
-public interface ODataDeserializer extends Serializable {
-
- XMLMetadata toMetadata(InputStream input);
-
- /**
- * Gets the ServiceDocumentResource object represented by the given InputStream.
- *
- * @param input stream to be de-serialized.
- * @param format OData service document format.
- * @return ServiceDocumentResource object.
- */
- ServiceDocument toServiceDocument(InputStream input, ODataFormat format);
-
- /**
- * Gets a feed object from the given InputStream.
- *
- * @param <T> reference class type
- * @param input stream to be de-serialized.
- * @param reference reference class (AtomFeed.class, JSONFeed.class).
- * @return FeedResource instance.
- */
-// <T extends Feed> T toFeed(InputStream input, Class<T> reference);
- /**
- * Gets an entry object from the given InputStream.
- *
- * @param <T> reference class type
- * @param input stream to be de-serialized.
- * @param reference reference class (AtomEntry.class, JSONV3Entry.class).
- * @return EntryResource instance.
- */
-// <T extends Entry> T toEntry(InputStream input, Class<T> reference);
- /**
- * Gets a DOM representation of the given InputStream.
- *
- * @param input stream to be de-serialized.
- * @param format OData format.
- * @return DOM.
- */
-// Element toPropertyDOM(InputStream input, ODataFormat format);
- /**
- * Gets a list of links from the given InputStream.
- *
- * @param input stream to be de-serialized.
- * @param format OData format.
- * @return de-serialized links.
- */
-// LinkCollection toLinkCollection(InputStream input, ODataFormat format);
- /**
- * Gets the ODataError object represented by the given InputStream.
- *
- * @param input stream to be parsed and de-serialized.
- * @param isXML 'TRUE' if the error is represented by XML; 'FALSE' otherwise.
- * @return
- */
-// ODataError toODataError(InputStream input, boolean isXML);
- /**
- * Parses the given input into a DOM tree.
- *
- * @param input stream to be parsed and de-serialized.
- * @return DOM tree
- */
- Element toDOM(InputStream input);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataReader.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataReader.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataReader.java
deleted file mode 100644
index 1686c91..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataReader.java
+++ /dev/null
@@ -1,103 +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.api.op;
-
-import java.io.InputStream;
-import java.io.Serializable;
-import org.apache.olingo.odata4.client.api.domain.ODataServiceDocument;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-
-/**
- * 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.
- */
- Edm 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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataSerializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataSerializer.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataSerializer.java
deleted file mode 100644
index 61c3d68..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataSerializer.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.api.op;
-
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.io.Writer;
-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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataV3Deserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataV3Deserializer.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataV3Deserializer.java
deleted file mode 100644
index 0b9edc9..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataV3Deserializer.java
+++ /dev/null
@@ -1,23 +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.api.op;
-
-public interface ODataV3Deserializer extends ODataDeserializer {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataV4Deserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataV4Deserializer.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataV4Deserializer.java
deleted file mode 100644
index 5d54130..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/op/ODataV4Deserializer.java
+++ /dev/null
@@ -1,29 +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.api.op;
-
-import java.io.InputStream;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.XMLMetadata;
-
-public interface ODataV4Deserializer extends ODataDeserializer {
-
- @Override
- XMLMetadata toMetadata(InputStream input);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/QueryOption.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/QueryOption.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/QueryOption.java
deleted file mode 100644
index 544a71a..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/QueryOption.java
+++ /dev/null
@@ -1,95 +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.api.uri;
-
-/**
- * Query options.
- */
-public enum QueryOption {
-
- /**
- * The entity-id specified by $id may be expressed absolute or relative to the request URL.
- */
- ID,
- /**
- * The $count system query option allows clients to request a count of the matching resources included with the
- * resources in the response. The $count query option has a Boolean value of true or false.
- */
- COUNT,
- /**
- * This option indicates entities associated with the EntityType instance or EntitySet, identified by the resource
- * path section of the URI, and MUST be represented inline in the data service's response.
- */
- EXPAND,
- /**
- * This option specifies the media type acceptable in a response. If present, this value SHOULD take precedence over
- * value(s) specified in an Accept request header.
- */
- FORMAT,
- /**
- * This option is used to specify that a subset of the properties of the entities identified by the path of the
- * request URI and $expand query option SHOULD be returned in the response from the data service.
- */
- SELECT,
- /**
- * This option specifies the sort properties and sort direction (ascending or descending) that the data service MUST
- * use to order the entities in the EntitySet, identified by the resource path section of the URI.
- */
- ORDERBY,
- /**
- * This option specifies a positive integer N that is the maximum number of entities in the EntitySet, identified by
- * the resource path section of the URI, that the data service MUST return.
- */
- TOP,
- /**
- * This option specifies a positive integer N that represents the number of entities, counted from the first entity in
- * the EntitySet and ordered as specified by the $orderby option, that the data service should skip when returning the
- * entities in the EntitySet, which is identified by the resource path section of the URI. The data service SHOULD
- * return all subsequent entities, starting from the one in position N+1.
- */
- SKIP,
- /**
- * This query option applies only to the OData 2.0 protocol to the AtomPub protocol. The value of a $skiptoken query
- * option is an opaque token which identifies an index into the collection of entities identified by the URI
- * containing the $skiptoken parameter.
- */
- SKIPTOKEN,
- /**
- * This option specifies a predicate used to filter the elements from the EntitySet identified by the resource path
- * section of the URI.
- */
- FILTER,
- /**
- * For a value of "allpages", this option indicates that the response to the request MUST include the count of the
- * number of entities in the EntitySet, identified by the resource path section of the URI after all $filter system
- * query options have been applied. For a value of "none", this option indicates that the response to the request MUST
- * NOT include the count value.
- */
- INLINECOUNT,
- /**
- * Search expressions are used within the $search system query option to request entities matching the specified
- * expression.
- */
- SEARCH;
-
- @Override
- public String toString() {
- return name().toLowerCase();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/SegmentType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/SegmentType.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/SegmentType.java
deleted file mode 100644
index e3121b9..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/SegmentType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.uri;
-
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * URI Segment types.
- */
-public enum SegmentType {
-
- ENTITY("$entity"),
- ENTITYSET,
- SINGLETON,
- KEY,
- KEY_AS_SEGMENT,
- PROPERTY,
- NAVIGATION,
- DERIVED_ENTITY_TYPE,
- VALUE("$value"),
- BOUND_OPERATION,
- UNBOUND_OPERATION,
- METADATA("$metadata"),
- BATCH("$batch"),
- LINKS("$links"),
- REF("$ref"),
- CROSS_JOIN("$crossjoin"),
- ALL("$all"),
- /**
- * For query options like as $count that needs to stay in their own segment, right after service root.
- *
- * @see QueryOption#COUNT
- */
- ROOT_QUERY_OPTION,
- SERVICEROOT;
-
- private final String value;
-
- private SegmentType() {
- this.value = StringUtils.EMPTY;
- }
-
- private SegmentType(final String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/URIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/URIBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/URIBuilder.java
deleted file mode 100644
index bf23b7d..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/URIBuilder.java
+++ /dev/null
@@ -1,224 +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.api.uri;
-
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-import java.net.URI;
-import java.util.Map;
-
-/**
- * OData URI builder.
- */
-public interface URIBuilder<UB extends URIBuilder<?>> {
-
- /**
- * Adds the specified query option to the URI.
- *
- * @param option query option.
- * @param value query option value.
- * @return current URIBuilder instance
- */
- UB addQueryOption(QueryOption option, String value);
-
- /**
- * Adds the specified (custom) query option to the URI.
- *
- * @param option query option.
- * @param value query option value.
- * @return current URIBuilder instance
- */
- UB addQueryOption(String option, String value);
-
- /**
- * Appends EntitySet segment to the URI.
- *
- * @param segmentValue segment value.
- * @return current URIBuilder instance
- */
- UB appendEntitySetSegment(String segmentValue);
-
- /**
- * Appends key segment to the URI.
- *
- * @param val segment value.
- * @return current URIBuilder instance
- */
- UB appendKeySegment(Object val);
-
- /**
- * Appends key segment to the URI, for multiple keys.
- *
- * @param segmentValues segment values.
- * @return current URIBuilder instance
- */
- UB appendKeySegment(Map<String, Object> segmentValues);
-
- /**
- * Appends property segment to the URI.
- *
- * @param segmentValue segment value.
- * @return current URIBuilder instance
- */
- UB appendPropertySegment(String segmentValue);
-
- /**
- * Appends navigation segment to the URI.
- *
- * @param segmentValue segment value.
- * @return current URIBuilder instance
- */
- UB appendNavigationSegment(String segmentValue);
-
- /**
- * Appends derived entity type segment to the URI.
- *
- * @param segmentValue segment value.
- * @return current URIBuilder instance
- */
- UB appendDerivedEntityTypeSegment(String segmentValue);
-
- /**
- * Appends value segment to the URI.
- *
- * @return current URIBuilder instance
- */
- UB appendValueSegment();
-
- /**
- * Appends operation (action or function) segment to the URI.
- *
- * @param operation Operation (action or function) name
- * @param arguments Operation arguments
- * @return current URIBuilder instance
- */
- UB appendOperationCallSegment(String operation, Map<String, Object> arguments);
-
- /**
- * Appends metadata segment to the URI.
- *
- * @return current URIBuilder instance
- */
- UB appendMetadataSegment();
-
- /**
- * Appends batch segment to the URI.
- *
- * @return current URIBuilder instance
- */
- UB appendBatchSegment();
-
- /**
- * Adds count query option.
- *
- * @return current URIBuilder instance
- */
- UB count();
-
- /**
- * Adds expand query option.
- *
- * @param expandItems items to be expanded in-line
- * @return current URIBuilder instance
- * @see QueryOption#EXPAND
- */
- UB expand(String... expandItems);
-
- /**
- * Adds format query option.
- *
- * @param format media type acceptable in a response.
- * @return current URIBuilder instance
- * @see QueryOption#FORMAT
- */
- UB format(String format);
-
- /**
- * Adds filter for filter query option.
- *
- * @param filter filter instance (to be obtained via <tt>ODataFilterFactory</tt>): note that <tt>build()</tt> method
- * will be immediately invoked.
- * @return current URIBuilder instance
- * @see QueryOption#FILTER
- * @see URIFilter
- * @see org.apache.olingo.odata4.client.api.uri.filter.FilterFactory
- */
- UB filter(URIFilter filter);
-
- /**
- * Adds filter query option.
- *
- * @param filter filter string.
- * @return current URIBuilder instance
- * @see QueryOption#FILTER
- */
- UB filter(String filter);
-
- /**
- * Adds select query option.
- *
- * @param selectItems select items
- * @return current URIBuilder instance
- * @see QueryOption#SELECT
- */
- UB select(String... selectItems);
-
- /**
- * Adds orderby query option.
- *
- * @param order order string.
- * @return current URIBuilder instance
- * @see QueryOption#ORDERBY
- */
- UB orderBy(String order);
-
- /**
- * Adds top query option.
- *
- * @param top maximum number of entities to be returned.
- * @return current URIBuilder instance
- * @see QueryOption#TOP
- */
- UB top(int top);
-
- /**
- * Adds skip query option.
- *
- * @param skip number of entities to be skipped into the response.
- * @return current URIBuilder instance
- * @see QueryOption#SKIP
- */
- UB skip(int skip);
-
- /**
- * Adds skiptoken query option.
- *
- * @param skipToken opaque token.
- * @return current URIBuilder instance
- * @see QueryOption#SKIPTOKEN
- */
- UB skipToken(String skipToken);
-
- /**
- * Build OData URI.
- *
- * @return OData URI.
- */
- URI build();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/V3URIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/V3URIBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/V3URIBuilder.java
deleted file mode 100644
index ad0dfe4..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/V3URIBuilder.java
+++ /dev/null
@@ -1,47 +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.api.uri;
-
-public interface V3URIBuilder extends URIBuilder<V3URIBuilder> {
-
- public enum InlineCount {
-
- allpages,
- none
-
- }
-
- /**
- * Appends links segment to the URI.
- *
- * @param segmentValue segment value
- * @return current URIBuilder instance
- */
- V3URIBuilder appendLinksSegment(String segmentValue);
-
- /**
- * Adds inlinecount query option.
- *
- * @param inlineCount value
- * @return current URIBuilder instance
- * @see QueryOption#INLINECOUNT
- */
- V3URIBuilder inlineCount(InlineCount inlineCount);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/V4URIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/V4URIBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/V4URIBuilder.java
deleted file mode 100644
index c865846..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/V4URIBuilder.java
+++ /dev/null
@@ -1,87 +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.api.uri;
-
-public interface V4URIBuilder extends URIBuilder<V4URIBuilder> {
-
- /**
- * Appends Singleton segment to the URI.
- *
- * @param segmentValue segment value.
- * @return current URIBuilder instance
- */
- V4URIBuilder appendSingletonSegment(String segmentValue);
-
- /**
- * Appends entity-id segment to the URI.
- *
- * @param segmentValue segment value
- * @return current URIBuilder instance
- */
- V4URIBuilder appendEntityIdSegment(String segmentValue);
-
- /**
- * Appends ref segment to the URI.
- *
- * @return current URIBuilder instance
- */
- V4URIBuilder appendRefSegment();
-
- /**
- * Appends cross join segment to the URI.
- *
- * @param segmentValues segment values.
- * @return current URIBuilder instance
- */
- V4URIBuilder appendCrossjoinSegment(String... segmentValues);
-
- /**
- * Appends all segment to the URI.
- *
- * @return current URIBuilder instance
- */
- V4URIBuilder appendAllSegment();
-
- /**
- * Adds id query option.
- *
- * @param idValue opaque token.
- * @return current URIBuilder instance
- * @see QueryOption#ID
- */
- V4URIBuilder id(String idValue);
-
- /**
- * Appends count query option.
- *
- * @param value true or false
- * @return current URIBuilder instance
- * @see QueryOption#COUNT
- */
- V4URIBuilder count(boolean value);
-
- /**
- * Appends search query option.
- *
- * @param expression search expression
- * @return current URIBuilder instance
- * @see QueryOption#SEARCH
- */
- V4URIBuilder search(String expression);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterArg.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterArg.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterArg.java
deleted file mode 100644
index 453a264..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterArg.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 org.apache.olingo.odata4.client.api.uri.filter;
-
-/**
- * Interface for any available filter argument.
- */
-public interface FilterArg {
-
- /**
- * @return String representation of this filter argument.
- */
- String build();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterArgFactory.java
deleted file mode 100644
index 0db93e7..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterArgFactory.java
+++ /dev/null
@@ -1,83 +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.api.uri.filter;
-
-public interface FilterArgFactory {
-
- FilterArg _null();
-
- FilterArg add(FilterArg first, FilterArg second);
-
- FilterArg ceiling(FilterArg param);
-
- FilterArg concat(FilterArg first, FilterArg second);
-
- FilterArg day(FilterArg param);
-
- FilterArg div(FilterArg first, FilterArg second);
-
- FilterArg endswith(FilterArg first, FilterArg second);
-
- FilterArg floor(FilterArg param);
-
- FilterArg hour(FilterArg param);
-
- FilterArg indexof(FilterArg first, FilterArg second);
-
- FilterArg isof(FilterArg type);
-
- FilterArg isof(FilterArg expression, FilterArg type);
-
- FilterArg length(FilterArg param);
-
- FilterArg literal(Object value);
-
- FilterArg minute(FilterArg param);
-
- FilterArg mod(FilterArg first, FilterArg second);
-
- FilterArg month(FilterArg param);
-
- FilterArg mul(FilterArg first, FilterArg second);
-
- FilterArg property(String propertyPath);
-
- FilterArg replace(FilterArg first, FilterArg second, FilterArg third);
-
- FilterArg round(FilterArg param);
-
- FilterArg second(FilterArg param);
-
- FilterArg startswith(FilterArg first, FilterArg second);
-
- FilterArg sub(FilterArg first, FilterArg second);
-
- FilterArg substring(FilterArg arg, FilterArg pos);
-
- FilterArg substring(FilterArg arg, FilterArg pos, FilterArg length);
-
- FilterArg tolower(FilterArg param);
-
- FilterArg toupper(FilterArg param);
-
- FilterArg trim(FilterArg param);
-
- FilterArg year(FilterArg param);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterFactory.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterFactory.java
deleted file mode 100644
index 7cab185..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/FilterFactory.java
+++ /dev/null
@@ -1,61 +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.api.uri.filter;
-
-import java.io.Serializable;
-
-/**
- * OData filter factory.
- */
-public interface FilterFactory extends Serializable {
-
- FilterArgFactory getArgFactory();
-
- URIFilter match(FilterArg arg);
-
- URIFilter eq(String key, Object value);
-
- URIFilter eq(FilterArg left, FilterArg right);
-
- URIFilter ne(String key, Object value);
-
- URIFilter ne(FilterArg left, FilterArg right);
-
- URIFilter gt(String key, Object value);
-
- URIFilter gt(FilterArg left, FilterArg right);
-
- URIFilter ge(String key, Object value);
-
- URIFilter ge(FilterArg left, FilterArg right);
-
- URIFilter lt(String key, Object value);
-
- URIFilter lt(FilterArg left, FilterArg right);
-
- URIFilter le(String key, Object value);
-
- URIFilter le(FilterArg left, FilterArg right);
-
- URIFilter and(URIFilter left, URIFilter right);
-
- URIFilter or(URIFilter left, URIFilter right);
-
- URIFilter not(URIFilter filter);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/URIFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/URIFilter.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/URIFilter.java
deleted file mode 100644
index 41c3410..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/URIFilter.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.uri.filter;
-
-/**
- * Interface for any available filter; obtain instances via <tt>FilterFactory</tt>.
- *
- * @see FilterFactory
- */
-public interface URIFilter {
-
- /**
- * @return String representation of this filter.
- */
- String build();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V3FilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V3FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V3FilterArgFactory.java
deleted file mode 100644
index f12a970..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V3FilterArgFactory.java
+++ /dev/null
@@ -1,25 +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.api.uri.filter;
-
-public interface V3FilterArgFactory extends FilterArgFactory {
-
- FilterArg substringof(FilterArg first, FilterArg second);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V3FilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V3FilterFactory.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V3FilterFactory.java
deleted file mode 100644
index 66e7cc5..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V3FilterFactory.java
+++ /dev/null
@@ -1,26 +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.api.uri.filter;
-
-public interface V3FilterFactory extends FilterFactory {
-
- @Override
- V3FilterArgFactory getArgFactory();
-
-}
[18/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotatable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotatable.java
new file mode 100644
index 0000000..1ba20cd
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotatable.java
@@ -0,0 +1,30 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * EdmAnnotatable can be applied to CSDL elements as described in the Conceptual Schema Definition Language.
+ */
+public interface EdmAnnotatable {
+
+ EdmAnnotations getAnnotations();
+
+ // TODO: enhance annotations
+ Object getAnnotation();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotations.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotations.java
new file mode 100644
index 0000000..2aea695
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotations.java
@@ -0,0 +1,24 @@
+/*
+ * 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.commons.api.edm;
+
+//TODO: EDM Annotation Interfaces
+public interface EdmAnnotations {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
new file mode 100644
index 0000000..87c9d34
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
@@ -0,0 +1,48 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * Entity Sets or Singletons can be bound to each other using a navigation property binding so an
+ * {@link EdmBindingTarget} can either be an {@link EdmEntitySet} or an {@link EdmSingleton}.
+ */
+public interface EdmBindingTarget extends EdmNamed {
+
+ /**
+ * Returns the target for a given path.
+ *
+ * @param path
+ * @return {@link EdmBindingTarget}
+ */
+ EdmBindingTarget getRelatedBindingTarget(String path);
+
+ /**
+ * Returns the entity container this target is contained in.
+ *
+ * @return {@link EdmEntityContainer}
+ */
+ EdmEntityContainer getEntityContainer();
+
+ /**
+ * Get the entity type.
+ *
+ * @return {@link EdmEntityType}
+ */
+ EdmEntityType getEntityType();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmComplexType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmComplexType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmComplexType.java
new file mode 100644
index 0000000..56e6e0b
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmComplexType.java
@@ -0,0 +1,31 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * A CSDL ComplexType element.
+ * <br/>
+ * EdmComplexType holds a set of related information like {@link EdmPrimitiveType} properties and EdmComplexType
+ * properties.
+ */
+public interface EdmComplexType extends EdmStructuredType {
+
+ @Override
+ EdmComplexType getBaseType();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmElement.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmElement.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmElement.java
new file mode 100644
index 0000000..3076d22
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmElement.java
@@ -0,0 +1,27 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * An {@link EdmElement} can either be an {@link EdmNavigationProperty}, an {@link EdmProperty} or an
+ * {@link EdmParameter}.
+ */
+public interface EdmElement extends EdmNamed, EdmTyped {
+//Should we introduce an element kind?
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityContainer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityContainer.java
new file mode 100644
index 0000000..d30d700
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityContainer.java
@@ -0,0 +1,66 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * A CSDL EntityContainer element.
+ *
+ * <br/>
+ * EdmEntityContainer hold the information of EntitySets, Singletons, ActionImports and FunctionImports contained
+ */
+public interface EdmEntityContainer extends EdmNamed {
+
+ /**
+ * @return namespace of this entity container
+ */
+ String getNamespace();
+
+ /**
+ * Get contained Singleton by name.
+ *
+ * @param name
+ * @return {@link EdmSingleton}
+ */
+ EdmSingleton getSingleton(String name);
+
+ /**
+ * Get contained EntitySet by name.
+ *
+ * @param name
+ * @return {@link EdmEntitySet}
+ */
+ EdmEntitySet getEntitySet(String name);
+
+ /**
+ * Get contained ActionImport by name.
+ *
+ * @param name
+ * @return {@link EdmActionImport}
+ */
+ EdmActionImport getActionImport(String name);
+
+ /**
+ * Get contained FunctionImport by name.
+ *
+ * @param name
+ * @return {@link EdmFunctionImport}
+ */
+ EdmFunctionImport getFunctionImport(String name);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySet.java
new file mode 100644
index 0000000..3e7b66f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySet.java
@@ -0,0 +1,29 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * A CSDL EntitySet element.
+ * <br/>
+ * EdmEntitySet is the container for entity type instances as described in the OData protocol. It can be the target of a
+ * navigation property binding.
+ */
+public interface EdmEntitySet extends EdmBindingTarget {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySetInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySetInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySetInfo.java
new file mode 100644
index 0000000..fe19708
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySetInfo.java
@@ -0,0 +1,47 @@
+/*
+ * 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.commons.api.edm;
+
+import java.net.URI;
+
+/**
+ * Objects of this class contain information about one entity set inside the EntityDataModel.
+ */
+public interface EdmEntitySetInfo {
+
+ // TODO: Either make this a class or alias info an interface!
+ /**
+ * @return the entity container name which contains this entity set.
+ */
+ String getEntityContainerName();
+
+ /**
+ * @return the entity set name
+ */
+ String getEntitySetName();
+
+ /**
+ * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
+ * toASCIIString() method can be used.
+ *
+ * @return the uri to this entity set e.g. "Employees"
+ */
+ URI getEntitySetUri();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityType.java
new file mode 100644
index 0000000..362215d
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityType.java
@@ -0,0 +1,64 @@
+/*
+ * 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.commons.api.edm;
+
+import java.util.List;
+
+/**
+ * A CSDL EntityType element.
+ */
+public interface EdmEntityType extends EdmStructuredType {
+
+ /**
+ * Gets all key predicate names. In case an alias is defined for a key predicate this will be returned.
+ *
+ * @return collection of key property names of type List<String>
+ */
+ List<String> getKeyPredicateNames();
+
+ /**
+ * Get all key properties references as list of {@link EdmKeyPropertyRef}.
+ *
+ * @return collection of key properties of type List<EdmKeyPropertyRef>
+ */
+ List<EdmKeyPropertyRef> getKeyPropertyRefs();
+
+ /**
+ * Get a key property ref by its name.
+ *
+ * @param keyPredicateName
+ * @return {@link EdmKeyPropertyRef} for given name
+ */
+ EdmKeyPropertyRef getKeyPropertyRef(String keyPredicateName);
+
+ /**
+ * Indicates if the entity type is treated as Media Link Entry with associated Media Resource.
+ *
+ * @return <code>true</code> if the entity type is a Media Link Entry
+ */
+ boolean hasStream();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.olingo.api.edm.EdmStructuralType#getBaseType()
+ */
+ @Override
+ EdmEntityType getBaseType();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEnumType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEnumType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEnumType.java
new file mode 100644
index 0000000..cca20d9
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEnumType.java
@@ -0,0 +1,43 @@
+/*
+ * 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.commons.api.edm;
+
+import java.util.List;
+
+/**
+ * An EdmEnumType represents a set of related values.
+ */
+public interface EdmEnumType extends EdmPrimitiveType {
+
+ /**
+ * @param name
+ * @return {@link EdmMember} for the given name
+ */
+ EdmMember getMember(String name);
+
+ /**
+ * @return member names as a list
+ */
+ List<String> getMemberNames();
+
+ /**
+ * @return the {@link EdmPrimitiveType} this {@link EdmEnumType} is based upon
+ */
+ EdmPrimitiveType getUnderlyingType();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmException.java
new file mode 100644
index 0000000..bf3f119
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmException.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.commons.api.edm;
+
+public class EdmException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ public EdmException(final Exception cause) {
+ super(cause);
+ }
+
+ public EdmException(final String msg) {
+ super(msg);
+ }
+
+ public EdmException(final String string, final Exception cause) {
+ super(string, cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunction.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunction.java
new file mode 100644
index 0000000..c7d01b0
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunction.java
@@ -0,0 +1,31 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * An EdmFunction as described in the OData specification
+ */
+public interface EdmFunction extends EdmOperation {
+
+ /**
+ * @return true if this function is composable
+ */
+ boolean isComposable();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImport.java
new file mode 100644
index 0000000..31b1c2c
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImport.java
@@ -0,0 +1,30 @@
+/*
+ * 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.commons.api.edm;
+
+import java.util.List;
+
+/**
+ * A CSDL FunctionImport element
+ */
+public interface EdmFunctionImport extends EdmOperationImport {
+
+ EdmFunction getFunction(List<String> parameterNames);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImportInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImportInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImportInfo.java
new file mode 100644
index 0000000..104a756
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImportInfo.java
@@ -0,0 +1,40 @@
+/*
+ * 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.commons.api.edm;
+
+import java.net.URI;
+
+/**
+ * Objects of this class contain information about one function import inside the EntityDataModel.
+ */
+public interface EdmFunctionImportInfo extends EdmOperationImportInfo {
+
+ /**
+ * @return the function import name
+ */
+ String getFunctionImportName();
+
+ /**
+ * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
+ * toASCIIString() method can be used.
+ *
+ * @return the uri to this function import
+ */
+ URI getFunctionImportUri();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmKeyPropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmKeyPropertyRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmKeyPropertyRef.java
new file mode 100644
index 0000000..18cbd9b
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmKeyPropertyRef.java
@@ -0,0 +1,43 @@
+/*
+ * 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.commons.api.edm;
+
+public interface EdmKeyPropertyRef {
+
+ /**
+ * @return name of the key predicate
+ */
+ String getKeyPropertyName();
+
+ /**
+ * @return alias of this reference or null if not set
+ */
+ String getAlias();
+
+ /**
+ * @return path to the property
+ */
+ String getPath();
+
+ /**
+ * @return the property this property ref points to
+ */
+ EdmProperty getProperty();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java
new file mode 100644
index 0000000..d53b847
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java
@@ -0,0 +1,32 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * EdmMappable can be applied to CSDL elements to associate additional information.
+ */
+public interface EdmMappable {
+
+ /**
+ * Get mapping information applied to an EDM element
+ *
+ * @return {@link EdmMapping}
+ */
+ EdmMapping getMapping();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java
new file mode 100644
index 0000000..7c59540
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.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.commons.api.edm;
+
+/**
+ * EdmMapping holds custom mapping information which can be applied to a CSDL element.
+ */
+public interface EdmMapping {
+
+ /**
+ * Get the mapping value
+ *
+ * @return mapping name as String
+ */
+ String getInternalName();
+
+ /**
+ * Get the set object for this mapping
+ *
+ * @return {@link Object} object
+ */
+ Object getObject();
+
+ /**
+ * Gets the key under which the resource source value can be found in the data map.
+ *
+ * @return the key of the media resource source
+ */
+ String getMediaResourceSourceKey();
+
+ /**
+ * Gets the key under which the resource mime type can be found in the data map.
+ *
+ * @return the key of the media resource type
+ */
+ String getMediaResourceMimeTypeKey();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMember.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMember.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMember.java
new file mode 100644
index 0000000..888fe77
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMember.java
@@ -0,0 +1,30 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * An {@link EdmEnumType} member element.
+ */
+public interface EdmMember extends EdmNamed {
+
+ /**
+ * @return value of this member as string
+ */
+ String getValue();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNamed.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNamed.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNamed.java
new file mode 100644
index 0000000..503d881
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNamed.java
@@ -0,0 +1,30 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * EdmNamed is the base interface for nearly all CSDL constructs.
+ */
+public interface EdmNamed {
+
+ /**
+ * @return name as String
+ */
+ String getName();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java
new file mode 100644
index 0000000..52c645f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java
@@ -0,0 +1,40 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * A CSDL NavigationProperty element
+ * <br/>
+ * EdmNavigationProperty allows navigation from one entity type to another via a relationship.
+ */
+public interface EdmNavigationProperty extends EdmElement {
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the partner navigation property
+ */
+ EdmNavigationProperty getPartner();
+
+ String getReferencingPropertyName(String referencedPropertyName);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperation.java
new file mode 100644
index 0000000..c653411
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperation.java
@@ -0,0 +1,57 @@
+/*
+ * 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.commons.api.edm;
+
+import java.util.List;
+
+/**
+ * A EdmOperation can either be an {@link EdmAction} or an {@link EdmFunction}.
+ */
+public interface EdmOperation extends EdmType {
+
+ /**
+ * @param name
+ * @return {@link EdmParameter} for this name
+ */
+ EdmParameter getParameter(String name);
+
+ /**
+ * @return a list of all parameter names
+ */
+ List<String> getParameterNames();
+
+ /**
+ * @param bindingParameterEntitySet
+ * @return {@link EdmEntitySet} for this binding
+ */
+ EdmEntitySet getReturnedEntitySet(EdmEntitySet bindingParameterEntitySet);
+
+ /**
+ * @return {@link EdmReturnType} of this operation
+ */
+ EdmReturnType getReturnType();
+
+ /**
+ * For more information on bound operations please refer to the OData V4 specification.
+ *
+ * @return true if bound
+ */
+ boolean isBound();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImport.java
new file mode 100644
index 0000000..84f2859
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImport.java
@@ -0,0 +1,36 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * An EdmOperationImport can be an EdmActionImport or an EdmFunctionImport.
+ */
+public interface EdmOperationImport extends EdmNamed {
+
+ /**
+ * @return {@link EdmEntitySet} of this OperationImport
+ */
+ EdmEntitySet getReturnedEntitySet();
+
+ /**
+ * @return {@link EdmEntityContainer} of this EdmOperationImport
+ */
+ EdmEntityContainer getEntityContainer();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImportInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImportInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImportInfo.java
new file mode 100644
index 0000000..0b96113
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImportInfo.java
@@ -0,0 +1,31 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * Objects of this class contain information about one action or function import inside the EntityDataModel.
+ */
+public interface EdmOperationImportInfo {
+
+ /**
+ * @return the entity container name which contains this function import.
+ */
+ String getEntityContainerName();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java
new file mode 100644
index 0000000..a0cfe67
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java
@@ -0,0 +1,45 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * A CSDL parameter element
+ */
+public interface EdmParameter extends EdmElement, EdmMappable {
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveType.java
new file mode 100644
index 0000000..7ce5c9a
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveType.java
@@ -0,0 +1,166 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * EdmPrimitiveType is a primitive type as defined in the Entity Data Model (EDM).
+ * <br/>
+ * There are methods to convert EDM primitive types from and to Java objects, respectively. The following Java types are
+ * supported:
+ * <table frame="hsides" rules="groups">
+ * <thead>
+ * <tr><th>EDM primitive type</th><th>Java types</th></tr>
+ * </thead>
+ * <tbody>
+ * <tr><td>Binary</td><td>byte[], {@link Byte}[]</td></tr>
+ * <tr><td>Boolean</td><td>{@link Boolean}</td></tr>
+ * <tr><td>Byte</td><td>{@link Short}, {@link Byte}, {@link Integer}, {@link Long}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>Date</td><td>{@link java.util.Calendar}, {@link java.util.Date}, {@link Long}</td></tr>
+ * <tr><td>DateTimeOffset</td><td>{@link java.util.Calendar}, {@link java.util.Date}, {@link Long}</td></tr>
+ * <tr><td>Decimal</td><td>{@link java.math.BigDecimal}, {@link java.math.BigInteger}, {@link Double}, {@link Float},
+ * {@link Byte}, {@link Short}, {@link Integer}, {@link Long}</td></tr>
+ * <tr><td>Double</td><td>{@link Double}, {@link Float}, {@link java.math.BigDecimal}, {@link Byte}, {@link Short},
+ * {@link Integer}, {@link Long}</td></tr>
+ * <tr><td>Duration</td><td>{@link java.math.BigDecimal}, {@link java.math.BigInteger}, {@link Double}, {@link Float},
+ * {@link Byte}, {@link Short}, {@link Integer}, {@link Long}</td></tr>
+ * <tr><td>Guid</td><td>{@link java.util.UUID}</td></tr>
+ * <tr><td>Int16</td><td>{@link Short}, {@link Byte}, {@link Integer}, {@link Long}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>Int32</td><td>{@link Integer}, {@link Byte}, {@link Short}, {@link Long}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>Int64</td><td>{@link Long}, {@link Byte}, {@link Short}, {@link Integer}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>SByte</td><td>{@link Byte}, {@link Short}, {@link Integer}, {@link Long}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>Single</td><td>{@link Float}, {@link Double}, {@link java.math.BigDecimal}, {@link Byte}, {@link Short},
+ * {@link Integer}, {@link Long}</td></tr>
+ * <tr><td>String</td><td>{@link String}</td></tr>
+ * <tr><td>TimeOfDay</td><td>{@link java.util.Calendar}, {@link java.util.Date}, {@link Long}</td></tr>
+ * </tbody>
+ * </table>
+ * <p>
+ * The first Java type is the default type for the respective EDM primitive type.
+ * </p>
+ * <p>
+ * For all EDM primitive types, the <code>Nullable</code> facet is taken into account. For <code>Binary</code> and
+ * <code>String</code>, <code>MaxLength</code> is also applicable. For <code>String</code>, the facet
+ * <code>Unicode</code> is considered additionally. The EDM primitive types <code>DateTimeOffset</code>,
+ * <code>Decimal</code>, <code>Duration</code>, and <code>TimeOfDay</code> can have a <code>Precision</code> facet.
+ * Additionally, <code>Decimal</code> can have the facet <code>Scale</code>.
+ * </p>
+ */
+public interface EdmPrimitiveType extends EdmType {
+
+ static final String EDM_NAMESPACE = "Edm";
+
+ static final String SYSTEM_NAMESPACE = "System";
+
+ /**
+ * Checks type compatibility.
+ *
+ * @param primitiveType the {@link EdmPrimitiveType} to be tested for compatibility
+ * @return <code>true</code> if the provided type is compatible to this type
+ */
+ boolean isCompatible(EdmPrimitiveType primitiveType);
+
+ /**
+ * Returns the default Java type for this EDM primitive type as described in the documentation of
+ * {@link EdmPrimitiveType}.
+ *
+ * @return the default Java type
+ */
+ Class<?> getDefaultType();
+
+ /**
+ * Validates literal value.
+ *
+ * @param value the literal value
+ * @param isNullable whether the <code>null</code> value is allowed
+ * @param maxLength the maximum length
+ * @param precision the precision
+ * @param scale the scale
+ * @param isUnicode whether non-ASCII characters are allowed (relevant only for Edm.String)
+ * @return <code>true</code> if the validation is successful
+ */
+ boolean validate(String value,
+ Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode);
+
+ /**
+ * Converts literal representation of value to system data type.
+ *
+ * @param value the literal representation of value
+ * @param isNullable whether the <code>null</code> value is allowed
+ * @param maxLength the maximum length
+ * @param precision the precision
+ * @param scale the scale
+ * @param isUnicode whether non-ASCII characters are allowed (relevant only for Edm.String)
+ * @param returnType the class of the returned value; it must be one of the list in the documentation of
+ * {@link EdmPrimitiveType}
+ * @throws EdmPrimitiveTypeException
+ * @return the value as an instance of the class the parameter <code>returnType</code> indicates
+ */
+ <T> T valueOfString(String value,
+ Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode,
+ Class<T> returnType) throws EdmPrimitiveTypeException;
+
+ /**
+ * Converts system data type to literal representation of value.
+ * <p>
+ * Returns <code>null</code> if value is <code>null</code> and <code>null</code> is an allowed value.
+ * </p>
+ *
+ * @param value the Java value as Object; its type must be one of the list in the documentation of
+ * {@link EdmPrimitiveType}
+ * @param isNullable whether the <code>null</code> value is allowed
+ * @param maxLength the maximum length
+ * @param precision the precision
+ * @param scale the scale
+ * @param isUnicode whether non-ASCII characters are allowed (relevant only for Edm.String)
+ * @throws EdmPrimitiveTypeException
+ * @return literal representation as String
+ */
+ String valueToString(Object value,
+ Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode)
+ throws EdmPrimitiveTypeException;
+
+ /**
+ * Converts default literal representation to URI literal representation.
+ * <p>
+ * Returns <code>null</code> if the literal is <code>null</code>. Does not perform any validation.
+ * </p>
+ *
+ * @param literal the literal in default representation
+ * @return URI literal representation as String
+ */
+ String toUriLiteral(String literal);
+
+ /**
+ * Converts URI literal representation to default literal representation.
+ * <p>
+ * Returns <code>null</code> if the literal is <code>null</code>. Checks the presence of a required prefix and of
+ * required surrounding quotation marks but does not perform any further validation.
+ * </p>
+ *
+ * @param literal the literal in URI representation
+ * @return default literal representation as String
+ * @throws EdmPrimitiveTypeException if a required prefix or required surrounding quotation marks are missing
+ */
+ String fromUriLiteral(String literal) throws EdmPrimitiveTypeException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
new file mode 100644
index 0000000..d9edae5
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
@@ -0,0 +1,32 @@
+/*
+ * 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.commons.api.edm;
+
+public class EdmPrimitiveTypeException extends Exception {
+
+ private static final long serialVersionUID = -93578822384514620L;
+
+ public EdmPrimitiveTypeException(final String msg) {
+ super(msg);
+ }
+
+ public EdmPrimitiveTypeException(final String msg, final Exception cause) {
+ super(msg, cause);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java
new file mode 100644
index 0000000..fdaf67e
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java
@@ -0,0 +1,71 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * A CSDL Property element.
+ * <br/>
+ * EdmProperty defines a simple type or a complex type.
+ */
+public interface EdmProperty extends EdmElement, EdmMappable {
+
+ /**
+ * Gets the related MIME type for the property.
+ *
+ * @return MIME type as String
+ */
+ String getMimeType();
+
+ /**
+ * Gets the info if the property is a primitive property.
+ *
+ * @return true, if it is a primitive property
+ */
+ boolean isPrimitive();
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+
+ /**
+ * @return true if unicode or null if not specified
+ */
+ Boolean isUnicode();
+
+ /**
+ * @return the default value as a String or null if not specified
+ */
+ String getDefaultValue();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java
new file mode 100644
index 0000000..9bb849f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java
@@ -0,0 +1,45 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * An {@link EdmReturnType} of an {@link EdmOperation}.
+ */
+public interface EdmReturnType extends EdmTyped {
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmServiceMetadata.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmServiceMetadata.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmServiceMetadata.java
new file mode 100644
index 0000000..b186fdd
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmServiceMetadata.java
@@ -0,0 +1,59 @@
+/*
+ * 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.commons.api.edm;
+
+import java.io.InputStream;
+import java.util.List;
+
+/**
+ * This interface gives access to the metadata of a service, the calculated Data Service Version and an info list of all
+ * entity sets, singletons, and function imports inside this EntityDataModel.
+ */
+public interface EdmServiceMetadata {
+
+ /**
+ * @return {@link InputStream} containing the metadata document
+ */
+ InputStream getMetadata();
+
+ /**
+ * @return <b>String</b> data service version of this service
+ */
+ String getDataServiceVersion();
+
+ /**
+ * @return a list of {@link EdmEntitySetInfo} objects inside the data model
+ */
+ List<EdmEntitySetInfo> getEntitySetInfos();
+
+ /**
+ * @return a list of {@link EdmSingletonInfo} objects inside the data model
+ */
+ List<EdmSingletonInfo> getSingletonInfos();
+
+ /**
+ * @return a list of {@link EdmActionImportInfo} objects inside the data model
+ */
+ List<EdmActionImportInfo> getActionImportInfos();
+
+ /**
+ * @return a list of {@link EdmFunctionImportInfo} objects inside the data model
+ */
+ List<EdmFunctionImportInfo> getFunctionImportInfos();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingleton.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingleton.java
new file mode 100644
index 0000000..135f189
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingleton.java
@@ -0,0 +1,26 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * An {@link EdmSingleton} represents a single entity inside the entity model.
+ */
+public interface EdmSingleton extends EdmBindingTarget {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingletonInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingletonInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingletonInfo.java
new file mode 100644
index 0000000..faf3835
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingletonInfo.java
@@ -0,0 +1,45 @@
+/*
+ * 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.commons.api.edm;
+
+import java.net.URI;
+
+/**
+ * Objects of this class contain information about one singleton inside the EntityDataModel.
+ */
+public interface EdmSingletonInfo {
+
+ /**
+ * @return the entity container name which contains this singleton.
+ */
+ String getEntityContainerName();
+
+ /**
+ * @return the singleton name
+ */
+ String getSingletonName();
+
+ /**
+ * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
+ * toASCIIString() method can be used.
+ *
+ * @return the uri to this singleton e.g. "EmployeeOfTheMonth"
+ */
+ URI getEntitySetUri();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmStructuredType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmStructuredType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmStructuredType.java
new file mode 100644
index 0000000..3c823dc
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmStructuredType.java
@@ -0,0 +1,82 @@
+/*
+ * 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.commons.api.edm;
+
+import java.util.List;
+
+/**
+ * EdmStructuralType is the base for a complex type or an entity type.
+ *
+ * Complex types and entity types are described in the Conceptual Schema Definition of the OData protocol.
+ */
+public interface EdmStructuredType extends EdmType {
+
+ /**
+ * Get property by name
+ *
+ * @param name
+ * @return simple, complex or navigation property as {@link EdmTyped}
+ */
+ EdmElement getProperty(String name);
+
+ /**
+ * Get all simple and complex property names.
+ *
+ * @return property names as type List<String>
+ */
+ List<String> getPropertyNames();
+
+ /**
+ * Get structural property by name.
+ *
+ * @param name
+ * @return simple or complex property as {@link EdmTyped}
+ */
+ EdmProperty getStructuralProperty(String name);
+
+ /**
+ * Get navigation property by name.
+ *
+ * @param name
+ * @return navigation property as {@link EdmTyped}
+ */
+ EdmNavigationProperty getNavigationProperty(String name);
+
+ /**
+ * Get all navigation property names.
+ *
+ * @return navigation property names as type List<String>
+ */
+ List<String> getNavigationPropertyNames();
+
+ /**
+ * Base types are described in the OData protocol specification.
+ *
+ * @return {@link EdmStructuredType}
+ */
+ EdmStructuredType getBaseType();
+
+ /**
+ * Checks if this type is convertible to parameter {@link targetType}
+ *
+ * @param targetType
+ * @return true if this type is compatible to the testType ( i.e. this type is a subtype of targetType )
+ */
+ boolean compatibleTo(EdmType targetType);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTerm.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTerm.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTerm.java
new file mode 100644
index 0000000..25a2459
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTerm.java
@@ -0,0 +1,50 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * An {@link EdmTerm} defines a term in a vocabulary.
+ */
+public interface EdmTerm extends EdmNamed {
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+
+ /**
+ * @return the default value as a String or null if not specified
+ */
+ String getDefaultValue();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmType.java
new file mode 100644
index 0000000..985e101
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmType.java
@@ -0,0 +1,40 @@
+/*
+ * 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.commons.api.edm;
+
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+/**
+ * EdmType holds the namespace of a given type and its type as {@link EdmTypeKind}.
+ */
+public interface EdmType extends EdmNamed {
+
+ /**
+ * Namespace of this {@link EdmType}.
+ *
+ * @return namespace as String
+ */
+ String getNamespace();
+
+ /**
+ * @return {@link EdmTypeKind} of this {@link EdmType}
+ */
+ EdmTypeKind getKind();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTypeDefinition.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTypeDefinition.java
new file mode 100644
index 0000000..c16ed85
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTypeDefinition.java
@@ -0,0 +1,52 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * An {@link EdmTypeDefinition} defines a specialization of one of the possible primitive types.
+ * <br/>
+ * For more information on primitive types refer to {@link EdmPrimitiveType}.
+ */
+public interface EdmTypeDefinition extends EdmPrimitiveType {
+
+ /**
+ * @return {@link EdmPrimitiveType} this type definition is based upon
+ */
+ EdmPrimitiveType getUnderlyingType();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+
+ /**
+ * @return true if unicode or null if not specified
+ */
+ Boolean isUnicode();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTyped.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTyped.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTyped.java
new file mode 100644
index 0000000..366e359
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTyped.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.commons.api.edm;
+
+/**
+ * EdmTyped indicates if an EDM element is of a special type and holds the multiplicity of that type.
+ */
+public interface EdmTyped {
+
+ /**
+ * See {@link EdmType} for more information about possible types.
+ *
+ * @return {@link EdmType}
+ */
+ EdmType getType();
+
+ /**
+ * @return true if this typed element is a collection
+ */
+ boolean isCollection();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
new file mode 100644
index 0000000..f993c23
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
@@ -0,0 +1,84 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * A full qualified name of any element in the EDM consists of a name and a namespace.
+ */
+public class FullQualifiedName {
+
+ private final String namespace;
+
+ private final String name;
+
+ private final String fqn;
+
+ /**
+ * @param namespace
+ * @param name
+ */
+ public FullQualifiedName(final String namespace, final String name) {
+ this.namespace = namespace;
+ this.name = name;
+ fqn = namespace + "." + name;
+ }
+
+ /**
+ * @return namespace
+ */
+ public String getNamespace() {
+ return namespace;
+ }
+
+ /**
+ * @return name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return namespace.name
+ */
+ public String getFullQualifiedNameAsString() {
+ return fqn;
+ }
+
+ @Override
+ public int hashCode() {
+ return toString().hashCode();
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if ((obj == null) || !(obj instanceof FullQualifiedName)) {
+ return false;
+ }
+ final FullQualifiedName other = (FullQualifiedName) obj;
+ return namespace.equals(other.getNamespace()) && name.equals(other.getName());
+ }
+
+ @Override
+ public String toString() {
+ return fqn;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java
new file mode 100644
index 0000000..3bee0bd
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java
@@ -0,0 +1,71 @@
+/*
+ * 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.commons.api.edm;
+
+public class Target {
+
+ private String targetName;
+
+ private FullQualifiedName entityContainer;
+
+ public static class Builder {
+
+ private final Target instance;
+
+ public Builder(final String target, final EdmEntityContainer defaultContainer) {
+ final String[] bindingTargetParts = target.split("/");
+
+ instance = new Target();
+ if (bindingTargetParts.length == 1) {
+ instance.
+ setEntityContainer(new FullQualifiedName(defaultContainer.getNamespace(), defaultContainer.getName())).
+ setTargetName(bindingTargetParts[0]);
+ } else {
+ final int idx = bindingTargetParts[0].lastIndexOf('.');
+ instance.
+ setEntityContainer(new FullQualifiedName(
+ bindingTargetParts[0].substring(0, idx), bindingTargetParts[0].substring(idx))).
+ setTargetName(bindingTargetParts[1]);
+ }
+ }
+
+ public Target build() {
+ return instance;
+ }
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public Target setTargetName(final String targetPathName) {
+ targetName = targetPathName;
+ return this;
+ }
+
+ public FullQualifiedName getEntityContainer() {
+ return entityContainer;
+ }
+
+ public Target setEntityContainer(final FullQualifiedName entityContainer) {
+ this.entityContainer = entityContainer;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ConcurrencyMode.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ConcurrencyMode.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ConcurrencyMode.java
new file mode 100644
index 0000000..73f5c38
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ConcurrencyMode.java
@@ -0,0 +1,26 @@
+/*
+ * 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.commons.api.edm.constants;
+
+public enum ConcurrencyMode {
+
+ None,
+ Fixed
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmContentKind.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmContentKind.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmContentKind.java
new file mode 100644
index 0000000..9331f89
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmContentKind.java
@@ -0,0 +1,30 @@
+/*
+ * 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.commons.api.edm.constants;
+
+/**
+ * Specifies the content type of the value of the property being mapped via a customizable feed mapping.
+ */
+public enum EdmContentKind {
+
+ text,
+ html,
+ xhtml;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmOnDelete.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmOnDelete.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmOnDelete.java
new file mode 100644
index 0000000..8f9eba2
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmOnDelete.java
@@ -0,0 +1,25 @@
+/*
+ * 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.commons.api.edm.constants;
+
+public enum EdmOnDelete {
+
+ Cascade, None, SetNull, SetDefault;
+
+}
[05/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/MethodCall.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/MethodCall.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/MethodCall.java
deleted file mode 100644
index 8b072ba..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/MethodCall.java
+++ /dev/null
@@ -1,29 +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.server.api.uri.queryoption.expression;
-
-import java.util.List;
-
-public interface MethodCall extends Expression {
-
- public MethodCallKind getMethod();
-
- public List<Expression> getParameters();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/MethodCallKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/MethodCallKind.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/MethodCallKind.java
deleted file mode 100644
index ae2b637..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/MethodCallKind.java
+++ /dev/null
@@ -1,58 +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.server.api.uri.queryoption.expression;
-
-public enum MethodCallKind {
- CONTAINS("contains"), STARTSWITH("startswith"), ENDSWITH("endswith"), LENGTH("length"),
- INDEXOF("indexof"), SUBSTRING("substring"), TOLOWER("tolower"), TOUPPER("toupper"), TRIM("trim"),
- CONCAT("concat"),
-
- YEAR("year"), MONTH("month"), DAY("day"), HOUR("hour"), MINUTE("minute"), SECOND("second"),
- FRACTIONALSECONDS("fractionalseconds"), TOTALSECONDS("totalseconds"), DATE("date"), TIME("time"),
- TOTALOFFSETMINUTES("totaloffsetminutes"), MINDATETIME("mindatetime"), MAXDATETIME("maxdatetime"), NOW("now"),
-
- ROUND("round"), FLOOR("floor"),
-
- CEILING("ceiling"), GEODISTANCE("geo.distance"), GEOLENGTH("geo.length"), GEOINTERSECTS("geo.intersects"),
- CAST("cast"),
- ISOF("isof");
-
- private String syntax;
-
- private MethodCallKind(final String syntax) {
- this.syntax = syntax;
- }
-
- @Override
- public String toString() {
- return syntax;
- }
-
-
- public static MethodCallKind get(final String method) {
- for (MethodCallKind op : MethodCallKind.values()) {
-
- if (op.toString().equals(method)) {
- return op;
- }
- }
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/TypeLiteral.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/TypeLiteral.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/TypeLiteral.java
deleted file mode 100644
index 8114198..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/TypeLiteral.java
+++ /dev/null
@@ -1,27 +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.server.api.uri.queryoption.expression;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-
-public interface TypeLiteral extends Expression {
-
- public EdmType getType();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/UnaryOperator.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/UnaryOperator.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/UnaryOperator.java
deleted file mode 100644
index cf409b2..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/UnaryOperator.java
+++ /dev/null
@@ -1,27 +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.server.api.uri.queryoption.expression;
-
-public interface UnaryOperator extends Expression {
-
- public Expression getOperand();
-
- public UnaryOperatorKind getOperator();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/UnaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/UnaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/UnaryOperatorKind.java
deleted file mode 100644
index 181fd59..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/UnaryOperatorKind.java
+++ /dev/null
@@ -1,44 +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.server.api.uri.queryoption.expression;
-
-public enum UnaryOperatorKind {
- MINUS("-"), NOT("not");
-
- private String syntax;
-
- private UnaryOperatorKind(final String syntax) {
- this.syntax = syntax;
- }
-
- @Override
- public String toString() {
- return syntax;
- }
-
- public static UnaryOperatorKind get(final String operator) {
- for (UnaryOperatorKind op : UnaryOperatorKind.values()) {
- if (op.toString().equals(operator)) {
- return op;
- }
- }
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/VisitableExression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/VisitableExression.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/VisitableExression.java
deleted file mode 100644
index b8a04f8..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/VisitableExression.java
+++ /dev/null
@@ -1,47 +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.server.api.uri.queryoption.expression;
-
-import org.apache.olingo.odata4.commons.api.ODataApplicationException;
-
-public interface VisitableExression {
-
- /**
- * Method {@link #accept(ExpressionVisitor)} is called when traversing the expression tree. This method is invoked on
- * each expression used as node in an expression tree. The implementations should
- * behave as follows:
- * <li>Call accept on all sub nodes and store the returned Objects which are of the generic type T
- * <li>Call the appropriate method on the {@link ExpressionVisitor} instance and provide the stored return objects
- * to that instance
- * <li>Return the object which should be passed to the processing algorithm of the parent expression node
- * <br>
- * <br>
- * @param visitor
- * Object (implementing {@link ExpressionVisitor}) whose methods are called during traversing a
- * expression node of the expression tree.
- * @return
- * Object of type T which should be passed to the processing algorithm of the parent expression node
- * @throws ExpressionVisitException
- * Exception occurred the OData library while traversing the tree
- * @throws ODataApplicationException
- * Exception thrown by the application who implemented the visitor
- */
- <T> T accept(ExpressionVisitor<T> visitor) throws ExpressionVisitException, ODataApplicationException;
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchBinary.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchBinary.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchBinary.java
deleted file mode 100644
index f702eff..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchBinary.java
+++ /dev/null
@@ -1,29 +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.server.api.uri.queryoption.search;
-
-public interface SearchBinary extends SearchExpression {
-
- SearchBinaryOperatorKind getOperator();
-
- SearchExpression getLeftOperand();
-
- SearchExpression getRightOperand();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
deleted file mode 100644
index 1ce795c..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
+++ /dev/null
@@ -1,45 +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.server.api.uri.queryoption.search;
-
-public enum SearchBinaryOperatorKind {
- // and/or
- AND("and"), OR("or");
-
- private String syntax;
-
- private SearchBinaryOperatorKind(final String syntax) {
- this.syntax = syntax;
- }
-
- @Override
- public String toString() {
- return syntax;
- }
-
- public static SearchBinaryOperatorKind get(final String operator) {
- for (SearchBinaryOperatorKind op : SearchBinaryOperatorKind.values()) {
- if (op.toString().equals(operator)) {
- return op;
- }
- }
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchExpression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchExpression.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchExpression.java
deleted file mode 100644
index 1f14154..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchExpression.java
+++ /dev/null
@@ -1,23 +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.server.api.uri.queryoption.search;
-
-public interface SearchExpression {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchTerm.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchTerm.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchTerm.java
deleted file mode 100644
index 1c0939a..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchTerm.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption.search;
-
-public interface SearchTerm extends SearchExpression {
-
- String getSearchTerm();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchUnary.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchUnary.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchUnary.java
deleted file mode 100644
index 63757d6..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchUnary.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption.search;
-
-public interface SearchUnary {
-
- SearchExpression getOperand();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
deleted file mode 100644
index 4f3efff..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/search/SearchUnaryOperatorKind.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.server.api.uri.queryoption.search;
-
-public enum SearchUnaryOperatorKind {
- NOT("not");
-
- private String syntax;
-
- private SearchUnaryOperatorKind(final String syntax) {
- this.syntax = syntax;
- }
-
- @Override
- public String toString() {
- return syntax;
- }
-
- public static SearchUnaryOperatorKind get(final String operator) {
- for (SearchUnaryOperatorKind op : SearchUnaryOperatorKind.values()) {
- if (op.toString().equals(operator)) {
- return op;
- }
- }
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Action.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Action.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Action.java
new file mode 100644
index 0000000..e040a70
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Action.java
@@ -0,0 +1,54 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+public class Action extends Operation {
+
+ @Override
+ public Action setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public Action setBound(final boolean isBound) {
+ this.isBound = isBound;
+ return this;
+ }
+
+ @Override
+ public Action setEntitySetPath(final EntitySetPath entitySetPath) {
+ this.entitySetPath = entitySetPath;
+ return this;
+ }
+
+ @Override
+ public Action setParameters(final List<Parameter> parameters) {
+ this.parameters = parameters;
+ return this;
+ }
+
+ @Override
+ public Action setReturnType(final ReturnType returnType) {
+ this.returnType = returnType;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ActionImport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ActionImport.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ActionImport.java
new file mode 100644
index 0000000..c7e44b9
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ActionImport.java
@@ -0,0 +1,48 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.Target;
+
+public class ActionImport extends OperationImport {
+
+ private FullQualifiedName action;
+
+ @Override
+ public ActionImport setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public ActionImport setEntitySet(final Target entitySet) {
+ this.entitySet = entitySet;
+ return this;
+ }
+
+ public FullQualifiedName getAction() {
+ return action;
+ }
+
+ public ActionImport setAction(final FullQualifiedName action) {
+ this.action = action;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/AliasInfo.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/AliasInfo.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/AliasInfo.java
new file mode 100644
index 0000000..ec7a753
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/AliasInfo.java
@@ -0,0 +1,45 @@
+/*
+ * 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.server.api.edm.provider;
+
+public class AliasInfo {
+
+ private String namespace;
+
+ private String alias;
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public AliasInfo setNamespace(final String namespace) {
+ this.namespace = namespace;
+ return this;
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public AliasInfo setAlias(final String alias) {
+ this.alias = alias;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Annotation.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Annotation.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Annotation.java
new file mode 100644
index 0000000..6498190
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Annotation.java
@@ -0,0 +1,72 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class Annotation {
+
+ private FullQualifiedName term;
+
+ // Target should be a target path
+// private String targetPath;
+ private String qualifier;
+
+ private Expression expression;
+
+ private List<Annotation> annotation;
+
+ public FullQualifiedName getTerm() {
+ return term;
+ }
+
+ public Annotation setTerm(final FullQualifiedName term) {
+ this.term = term;
+ return this;
+ }
+
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public Annotation setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ return this;
+ }
+
+ public Expression getExpression() {
+ return expression;
+ }
+
+ public Annotation setExpression(final Expression expression) {
+ this.expression = expression;
+ return this;
+ }
+
+ public List<Annotation> getAnnotation() {
+ return annotation;
+ }
+
+ public Annotation setAnnotation(final List<Annotation> annotation) {
+ this.annotation = annotation;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/BindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/BindingTarget.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/BindingTarget.java
new file mode 100644
index 0000000..876164c
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/BindingTarget.java
@@ -0,0 +1,60 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public abstract class BindingTarget {
+
+ protected String name;
+
+ protected FullQualifiedName type;
+
+ protected List<NavigationPropertyBinding> navigationPropertyBindings;
+
+ public String getName() {
+ return name;
+ }
+
+ public BindingTarget setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public FullQualifiedName getType() {
+ return type;
+ }
+
+ public BindingTarget setType(final FullQualifiedName type) {
+ this.type = type;
+ return this;
+ }
+
+ public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
+ return navigationPropertyBindings;
+ }
+
+ public BindingTarget setNavigationPropertyBindings(final List<NavigationPropertyBinding> navigationPropertyBindings) {
+ this.navigationPropertyBindings = navigationPropertyBindings;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ComplexType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ComplexType.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ComplexType.java
new file mode 100644
index 0000000..c164ab4
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/ComplexType.java
@@ -0,0 +1,62 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class ComplexType extends StructuredType {
+
+ @Override
+ public ComplexType setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public ComplexType setOpenType(final boolean isOpenType) {
+ this.isOpenType = isOpenType;
+ return this;
+ }
+
+ @Override
+ public ComplexType setBaseType(final FullQualifiedName baseType) {
+ this.baseType = baseType;
+ return this;
+ }
+
+ @Override
+ public ComplexType setAbstract(final boolean isAbstract) {
+ this.isAbstract = isAbstract;
+ return this;
+ }
+
+ @Override
+ public ComplexType setProperties(final List<Property> properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ @Override
+ public ComplexType setNavigationProperties(final List<NavigationProperty> navigationProperties) {
+ this.navigationProperties = navigationProperties;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EdmProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EdmProvider.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EdmProvider.java
new file mode 100644
index 0000000..ae58c52
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EdmProvider.java
@@ -0,0 +1,182 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public abstract class EdmProvider {
+
+ /**
+ * This method should return an {@link EnumType} or <b>null</b> if nothing is found
+ *
+ * @param enumTypeName
+ * @return {@link EnumType} for given name
+ * @throws ODataException
+ */
+ public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return an {@link TypeDefinition} or <b>null</b> if nothing is found
+ *
+ * @param typeDefinitionName
+ * @return {@link TypeDefinition} for given name
+ * @throws ODataException
+ */
+ public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return an {@link EntityType} or <b>null</b> if nothing is found
+ *
+ * @param entityTypeName
+ * @return {@link EntityType} for the given name
+ * @throws ODataException
+ */
+ public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return a {@link ComplexType} or <b>null</b> if nothing is found
+ *
+ * @param complexTypeName
+ * @return {@link StructuralType} for the given name
+ * @throws ODataException
+ */
+ public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return a list of all {@link Action} for the FullQualifiedname or <b>null</b> if nothing is found
+ *
+ * @param actionName
+ * @return List of {@link Action} or null
+ * @throws ODataException
+ */
+ public List<Action> getActions(final FullQualifiedName actionName) throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return a list of all {@link Function} for the FullQualifiedname or <b>null</b> if nothing is
+ * found
+ *
+ * @param functionName
+ * @return List of {@link Function} or null
+ * @throws ODataException
+ */
+ public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
+ return null;
+ }
+
+ // TODO: document
+ public Term getTerm(final FullQualifiedName termName) throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return an {@link EntitySet} or <b>null</b> if nothing is found
+ *
+ * @param entityContainer this EntitySet is contained in
+ * @param entitySetName
+ * @return {@link EntitySet} for the given container and entityset name
+ * @throws ODataException
+ */
+ public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
+ throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return an {@link Singleton} or <b>null</b> if nothing is found
+ *
+ * @param entityContainer this Singleton is contained in
+ * @param singletonName
+ * @return {@link Singleton} for given container and singleton name
+ * @throws ODataException
+ */
+ public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
+ throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return an {@link ActionImport} or <b>null</b> if nothing is found
+ *
+ * @param entityContainer this ActionImport is contained in
+ * @param actionImportName
+ * @return {@link ActionImport} for the given container and ActionImport name
+ * @throws ODataException
+ */
+ public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
+ throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return a {@link FunctionImport} or <b>null</b> if nothing is found
+ *
+ * @param entityContainer this FunctionImport is contained in
+ * @param functionImportName
+ * @return {@link FunctionImport} for the given container name and function import name
+ * @throws ODataException
+ */
+ public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
+ throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return an {@link EntityContainerInfo} or <b>null</b> if nothing is found
+ *
+ * @param entityContainerName (null for default container)
+ * @return {@link EntityContainerInfo} for the given name
+ * @throws ODataException
+ */
+ public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return a list of all namespaces which have an alias
+ *
+ * @return List of alias info
+ * @throws ODataException
+ */
+ public List<AliasInfo> getAliasInfos() throws ODataException {
+ return null;
+ }
+
+ /**
+ * This method should return a collection of all {@link Schema}
+ *
+ * @return List<{@link Schema}>
+ * @throws ODataException
+ */
+ public List<Schema> getSchemas() throws ODataException {
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainer.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainer.java
new file mode 100644
index 0000000..43e41e3
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainer.java
@@ -0,0 +1,93 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class EntityContainer {
+
+ private String name;
+
+ private FullQualifiedName extendsContainer;
+
+ private List<EntitySet> entitySets;
+
+ private List<ActionImport> actionImports;
+
+ private List<FunctionImport> functionImports;
+
+ private List<Singleton> singletons;
+
+ // Annotations
+ public String getName() {
+ return name;
+ }
+
+ public EntityContainer setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public FullQualifiedName getExtendsContainer() {
+ return extendsContainer;
+ }
+
+ public EntityContainer setExtendsContainer(final FullQualifiedName extendsContainer) {
+ this.extendsContainer = extendsContainer;
+ return this;
+ }
+
+ public List<EntitySet> getEntitySets() {
+ return entitySets;
+ }
+
+ public EntityContainer setEntitySets(final List<EntitySet> entitySets) {
+ this.entitySets = entitySets;
+ return this;
+ }
+
+ public List<ActionImport> getActionImports() {
+ return actionImports;
+ }
+
+ public EntityContainer setActionImports(final List<ActionImport> actionImports) {
+ this.actionImports = actionImports;
+ return this;
+ }
+
+ public List<FunctionImport> getFunctionImports() {
+ return functionImports;
+ }
+
+ public EntityContainer setFunctionImports(final List<FunctionImport> functionImports) {
+ this.functionImports = functionImports;
+ return this;
+ }
+
+ public List<Singleton> getSingletons() {
+ return singletons;
+ }
+
+ public EntityContainer setSingletons(final List<Singleton> singletons) {
+ this.singletons = singletons;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainerInfo.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainerInfo.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainerInfo.java
new file mode 100644
index 0000000..f46401e
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityContainerInfo.java
@@ -0,0 +1,47 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class EntityContainerInfo {
+
+ private FullQualifiedName containerName;
+
+ private FullQualifiedName extendsContainer;
+
+ public FullQualifiedName getContainerName() {
+ return containerName;
+ }
+
+ public EntityContainerInfo setContainerName(final FullQualifiedName containerName) {
+ this.containerName = containerName;
+ return this;
+ }
+
+ public FullQualifiedName getExtendsContainer() {
+ return extendsContainer;
+ }
+
+ public EntityContainerInfo setExtendsContainer(final FullQualifiedName extendsContainer) {
+ this.extendsContainer = extendsContainer;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySet.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySet.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySet.java
new file mode 100644
index 0000000..f02633b
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySet.java
@@ -0,0 +1,55 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class EntitySet extends BindingTarget {
+
+ private boolean includeInServiceDocument;
+
+ @Override
+ public EntitySet setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public EntitySet setNavigationPropertyBindings(final List<NavigationPropertyBinding> navigationPropertyBindings) {
+ this.navigationPropertyBindings = navigationPropertyBindings;
+ return this;
+ }
+
+ @Override
+ public EntitySet setType(final FullQualifiedName entityType) {
+ type = entityType;
+ return this;
+ }
+
+ public boolean isIncludeInServiceDocument() {
+ return includeInServiceDocument;
+ }
+
+ public EntitySet setIncludeInServiceDocument(final boolean includeInServiceDocument) {
+ this.includeInServiceDocument = includeInServiceDocument;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySetPath.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySetPath.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySetPath.java
new file mode 100644
index 0000000..d9380a9
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntitySetPath.java
@@ -0,0 +1,45 @@
+/*
+ * 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.server.api.edm.provider;
+
+//TODO: Do we really need this class?
+public class EntitySetPath {
+
+ private String bindingParameter;
+
+ private String path;
+
+ public String getBindingParameter() {
+ return bindingParameter;
+ }
+
+ public EntitySetPath setBindingParameter(final String bindingParameter) {
+ this.bindingParameter = bindingParameter;
+ return this;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public EntitySetPath setPath(final String path) {
+ this.path = path;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityType.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityType.java
new file mode 100644
index 0000000..84888e5
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EntityType.java
@@ -0,0 +1,84 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class EntityType extends StructuredType {
+
+ private List<PropertyRef> key;
+
+ private boolean hasStream;
+
+ public boolean hasStream() {
+ return hasStream;
+ }
+
+ public EntityType setHasStream(final boolean hasStream) {
+ this.hasStream = hasStream;
+ return this;
+ }
+
+ public List<PropertyRef> getKey() {
+ return key;
+ }
+
+ public EntityType setKey(final List<PropertyRef> key) {
+ this.key = key;
+ return this;
+ }
+
+ @Override
+ public EntityType setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public EntityType setOpenType(final boolean isOpenType) {
+ this.isOpenType = isOpenType;
+ return this;
+ }
+
+ @Override
+ public EntityType setBaseType(final FullQualifiedName baseType) {
+ this.baseType = baseType;
+ return this;
+ }
+
+ @Override
+ public EntityType setAbstract(final boolean isAbstract) {
+ this.isAbstract = isAbstract;
+ return this;
+ }
+
+ @Override
+ public EntityType setProperties(final List<Property> properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ @Override
+ public EntityType setNavigationProperties(final List<NavigationProperty> navigationProperties) {
+ this.navigationProperties = navigationProperties;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumMember.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumMember.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumMember.java
new file mode 100644
index 0000000..5bd9445
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumMember.java
@@ -0,0 +1,49 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.EdmMember;
+
+public class EnumMember implements EdmMember {
+
+ private String name;
+
+ private String value;
+
+ // Annotations?
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public EnumMember setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ public EnumMember setValue(final String value) {
+ this.value = value;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumType.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumType.java
new file mode 100644
index 0000000..0d48cc0
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/EnumType.java
@@ -0,0 +1,73 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class EnumType {
+
+ private String name;
+
+ private boolean isFlags;
+
+ // Underlying Type can only be primitve...
+ private FullQualifiedName underlyingType;
+
+ private List<EnumMember> members;
+
+ // Facets
+ // Annotations?
+ public String getName() {
+ return name;
+ }
+
+ public EnumType setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public boolean isFlags() {
+ return isFlags;
+ }
+
+ public EnumType setFlags(final boolean isFlags) {
+ this.isFlags = isFlags;
+ return this;
+ }
+
+ public FullQualifiedName getUnderlyingType() {
+ return underlyingType;
+ }
+
+ public EnumType setUnderlyingType(final FullQualifiedName underlyingType) {
+ this.underlyingType = underlyingType;
+ return this;
+ }
+
+ public List<EnumMember> getMembers() {
+ return members;
+ }
+
+ public EnumType setMembers(final List<EnumMember> members) {
+ this.members = members;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Expression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Expression.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Expression.java
new file mode 100644
index 0000000..c225467
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Expression.java
@@ -0,0 +1,24 @@
+/*
+ * 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.server.api.edm.provider;
+
+//TODO: Expression implementation
+public class Expression {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Function.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Function.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Function.java
new file mode 100644
index 0000000..0166562
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Function.java
@@ -0,0 +1,65 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+public class Function extends Operation {
+
+ private boolean isComposable;
+
+ public boolean isComposable() {
+ return isComposable;
+ }
+
+ public Function setComposable(final boolean isComposable) {
+ this.isComposable = isComposable;
+ return this;
+ }
+
+ @Override
+ public Function setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public Function setBound(final boolean isBound) {
+ this.isBound = isBound;
+ return this;
+ }
+
+ @Override
+ public Function setEntitySetPath(final EntitySetPath entitySetPath) {
+ this.entitySetPath = entitySetPath;
+ return this;
+ }
+
+ @Override
+ public Function setParameters(final List<Parameter> parameters) {
+ this.parameters = parameters;
+ return this;
+ }
+
+ @Override
+ public Function setReturnType(final ReturnType returnType) {
+ this.returnType = returnType;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/FunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/FunctionImport.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/FunctionImport.java
new file mode 100644
index 0000000..f9e4217
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/FunctionImport.java
@@ -0,0 +1,64 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.Target;
+
+public class FunctionImport extends OperationImport {
+
+ private FullQualifiedName function;
+
+ private boolean includeInServiceDocument;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public FunctionImport setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public FunctionImport setEntitySet(final Target entitySet) {
+ this.entitySet = entitySet;
+ return this;
+ }
+
+ public FullQualifiedName getFunction() {
+ return function;
+ }
+
+ public FunctionImport setFunction(final FullQualifiedName function) {
+ this.function = function;
+ return this;
+ }
+
+ public boolean isIncludeInServiceDocument() {
+ return includeInServiceDocument;
+ }
+
+ public FunctionImport setIncludeInServiceDocument(final boolean includeInServiceDocument) {
+ this.includeInServiceDocument = includeInServiceDocument;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Mapping.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Mapping.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Mapping.java
new file mode 100644
index 0000000..7d23e9b
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Mapping.java
@@ -0,0 +1,96 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.EdmMapping;
+
+public class Mapping implements EdmMapping {
+
+ private String value;
+
+ private Object object;
+
+ private String mediaResourceSourceKey;
+
+ private String mediaResourceMimeTypeKey;
+
+ @Override
+ public String getInternalName() {
+ return value;
+ }
+
+ @Override
+ public Object getObject() {
+ return object;
+ }
+
+ @Override
+ public String getMediaResourceSourceKey() {
+ return mediaResourceSourceKey;
+ }
+
+ @Override
+ public String getMediaResourceMimeTypeKey() {
+ return mediaResourceMimeTypeKey;
+ }
+
+ /**
+ * Sets the value for this {@link Mapping}.
+ *
+ * @param value
+ * @return {@link Mapping} for method chaining
+ */
+ public Mapping setInternalName(final String value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Sets an object. This method can be used by a provider to set whatever it wants to associate with this.
+ *
+ * @param object
+ * @return {@link Mapping} for method chaining
+ */
+ public Mapping setObject(final Object object) {
+ this.object = object;
+ return this;
+ }
+
+ /**
+ * Sets the key for the resource source key which is used for the lookup in the data map
+ *
+ * @param mediaResourceSourceKey under which the source can be found in the data map
+ * @return {@link Mapping} for method chaining
+ */
+ public Mapping setMediaResourceSourceKey(final String mediaResourceSourceKey) {
+ this.mediaResourceSourceKey = mediaResourceSourceKey;
+ return this;
+ }
+
+ /**
+ * Sets the key for the resource mime type key which is used for the lookup in the data map
+ *
+ * @param mediaResourceMimeTypeKey under which the mime type can be found in the data map
+ * @return {@link Mapping} for method chaining
+ */
+ public Mapping setMediaResourceMimeTypeKey(final String mediaResourceMimeTypeKey) {
+ this.mediaResourceMimeTypeKey = mediaResourceMimeTypeKey;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationProperty.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationProperty.java
new file mode 100644
index 0000000..4e3a824
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationProperty.java
@@ -0,0 +1,118 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmOnDelete;
+
+public class NavigationProperty {
+
+ private String name;
+
+ private FullQualifiedName type;
+
+ private boolean isCollection;
+
+ private String partner;
+
+ private boolean containsTarget;
+
+ private List<ReferentialConstraint> referentialConstraints;
+
+ // Facets
+ private Boolean nullable;
+
+ // Refactor this onDelete
+ private EdmOnDelete onDelete;
+
+//Annotations?
+ public String getName() {
+ return name;
+ }
+
+ public boolean isCollection() {
+ return isCollection;
+ }
+
+ public NavigationProperty setCollection(final boolean isCollection) {
+ this.isCollection = isCollection;
+ return this;
+ }
+
+ public NavigationProperty setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public FullQualifiedName getType() {
+ return type;
+ }
+
+ public NavigationProperty setType(final FullQualifiedName type) {
+ this.type = type;
+ return this;
+ }
+
+ public String getPartner() {
+ return partner;
+ }
+
+ public NavigationProperty setPartner(final String partner) {
+ this.partner = partner;
+ return this;
+ }
+
+ public boolean isContainsTarget() {
+ return containsTarget;
+ }
+
+ public NavigationProperty setContainsTarget(final boolean containsTarget) {
+ this.containsTarget = containsTarget;
+ return this;
+ }
+
+ public List<ReferentialConstraint> getReferentialConstraints() {
+ return referentialConstraints;
+ }
+
+ public NavigationProperty setReferentialConstraints(final List<ReferentialConstraint> referentialConstraints) {
+ this.referentialConstraints = referentialConstraints;
+ return this;
+ }
+
+ public Boolean getNullable() {
+ return nullable;
+ }
+
+ public NavigationProperty setNullable(final Boolean nullable) {
+ this.nullable = nullable;
+ return this;
+ }
+
+ public EdmOnDelete getOnDelete() {
+ return onDelete;
+ }
+
+ public NavigationProperty setOnDelete(final EdmOnDelete onDelete) {
+ this.onDelete = onDelete;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationPropertyBinding.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationPropertyBinding.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationPropertyBinding.java
new file mode 100644
index 0000000..9195ea4
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/NavigationPropertyBinding.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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.Target;
+
+public class NavigationPropertyBinding {
+
+ private String path;
+
+ private Target target;
+
+ public String getPath() {
+ return path;
+ }
+
+ public NavigationPropertyBinding setPath(final String path) {
+ this.path = path;
+ return this;
+ }
+
+ public Target getTarget() {
+ return target;
+ }
+
+ public NavigationPropertyBinding setTarget(final Target target) {
+ this.target = target;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Operation.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Operation.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Operation.java
new file mode 100644
index 0000000..6235b2f
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Operation.java
@@ -0,0 +1,81 @@
+/*
+ * 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.server.api.edm.provider;
+
+import java.util.List;
+
+public abstract class Operation {
+
+ protected String name;
+
+ protected boolean isBound;
+
+ // Do we need EntitySetPath as a class?
+ protected EntitySetPath entitySetPath;
+
+ protected List<Parameter> parameters;
+
+ protected ReturnType returnType;
+
+ // Annotations?
+ public String getName() {
+ return name;
+ }
+
+ public Operation setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public boolean isBound() {
+ return isBound;
+ }
+
+ public Operation setBound(final boolean isBound) {
+ this.isBound = isBound;
+ return this;
+ }
+
+ public EntitySetPath getEntitySetPath() {
+ return entitySetPath;
+ }
+
+ public Operation setEntitySetPath(final EntitySetPath entitySetPath) {
+ this.entitySetPath = entitySetPath;
+ return this;
+ }
+
+ public List<Parameter> getParameters() {
+ return parameters;
+ }
+
+ public Operation setParameters(final List<Parameter> parameters) {
+ this.parameters = parameters;
+ return this;
+ }
+
+ public ReturnType getReturnType() {
+ return returnType;
+ }
+
+ public Operation setReturnType(final ReturnType returnType) {
+ this.returnType = returnType;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/OperationImport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/OperationImport.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/OperationImport.java
new file mode 100644
index 0000000..dfa7e04
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/OperationImport.java
@@ -0,0 +1,47 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.Target;
+
+public abstract class OperationImport {
+
+ protected String name;
+
+ protected Target entitySet;
+
+ // Annotations?
+ public String getName() {
+ return name;
+ }
+
+ public OperationImport setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Target getEntitySet() {
+ return entitySet;
+ }
+
+ public OperationImport setEntitySet(final Target entitySet) {
+ this.entitySet = entitySet;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Parameter.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Parameter.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Parameter.java
new file mode 100644
index 0000000..c972cb8
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Parameter.java
@@ -0,0 +1,113 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class Parameter {
+
+ private String name;
+
+ private FullQualifiedName type;
+
+ private boolean isCollection;
+
+ private Mapping mapping;
+
+ // Facets?
+ private Boolean nullable;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ public String getName() {
+ return name;
+ }
+
+ public Parameter setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public FullQualifiedName getType() {
+ return type;
+ }
+
+ public Parameter setType(final FullQualifiedName type) {
+ this.type = type;
+ return this;
+ }
+
+ public boolean isCollection() {
+ return isCollection;
+ }
+
+ public Parameter setCollection(final boolean isCollection) {
+ this.isCollection = isCollection;
+ return this;
+ }
+
+ public Boolean getNullable() {
+ return nullable;
+ }
+
+ public Parameter setNullable(final Boolean nullable) {
+ this.nullable = nullable;
+ return this;
+ }
+
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public Parameter setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ return this;
+ }
+
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public Parameter setPrecision(final Integer precision) {
+ this.precision = precision;
+ return this;
+ }
+
+ public Integer getScale() {
+ return scale;
+ }
+
+ public Parameter setScale(final Integer scale) {
+ this.scale = scale;
+ return this;
+ }
+
+ public Mapping getMapping() {
+ return mapping;
+ }
+
+ public Parameter setMapping(final Mapping mapping) {
+ this.mapping = mapping;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Property.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Property.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Property.java
new file mode 100644
index 0000000..68ec702
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/edm/provider/Property.java
@@ -0,0 +1,148 @@
+/*
+ * 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.server.api.edm.provider;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class Property {
+
+ private String name;
+
+ // Can be simple or complex
+ private FullQualifiedName type;
+
+ private boolean collection;
+
+ // TODO: Mimetype and mapping what here
+ private String mimeType;
+
+ private Mapping mapping;
+
+ // Facets
+ private String defaultValue;
+
+ private Boolean nullable;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private Boolean unicode;
+
+ public String getName() {
+ return name;
+ }
+
+ public Property setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ public FullQualifiedName getType() {
+ return type;
+ }
+
+ public Property setType(final FullQualifiedName type) {
+ this.type = type;
+ return this;
+ }
+
+ public boolean isCollection() {
+ return collection;
+ }
+
+ public Property setCollection(final boolean isCollection) {
+ collection = isCollection;
+ return this;
+ }
+
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ public Property setDefaultValue(final String defaultValue) {
+ this.defaultValue = defaultValue;
+ return this;
+ }
+
+ public Boolean getNullable() {
+ return nullable;
+ }
+
+ public Property setNullable(final Boolean nullable) {
+ this.nullable = nullable;
+ return this;
+ }
+
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public Property setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ return this;
+ }
+
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public Property setPrecision(final Integer precision) {
+ this.precision = precision;
+ return this;
+ }
+
+ public Integer getScale() {
+ return scale;
+ }
+
+ public Property setScale(final Integer scale) {
+ this.scale = scale;
+ return this;
+ }
+
+ public Boolean isUnicode() {
+ return unicode;
+ }
+
+ public Property setUnicode(final Boolean isUnicode) {
+ unicode = isUnicode;
+ return this;
+ }
+
+ public String getMimeType() {
+ return mimeType;
+ }
+
+ public Property setMimeType(final String mimeType) {
+ this.mimeType = mimeType;
+ return this;
+ }
+
+ public Mapping getMapping() {
+ return mapping;
+ }
+
+ public Property setMapping(final Mapping mapping) {
+ this.mapping = mapping;
+ return this;
+ }
+}
[14/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimal.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimal.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimal.java
new file mode 100644
index 0000000..0f04eb2
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimal.java
@@ -0,0 +1,200 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Decimal.
+ */
+public final class EdmDecimal extends SingletonPrimitiveType {
+
+ private static final Pattern PATTERN = Pattern.compile("(?:\\+|-)?(?:0*(\\p{Digit}+?))(?:\\.(\\p{Digit}+?)0*)?");
+
+ private static final EdmDecimal INSTANCE = new EdmDecimal();
+
+ public static EdmDecimal getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return primitiveType instanceof Uint7
+ || primitiveType instanceof EdmByte
+ || primitiveType instanceof EdmSByte
+ || primitiveType instanceof EdmInt16
+ || primitiveType instanceof EdmInt32
+ || primitiveType instanceof EdmInt64
+ || primitiveType instanceof EdmSingle
+ || primitiveType instanceof EdmDouble
+ || primitiveType instanceof EdmDecimal;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return BigDecimal.class;
+ }
+
+ @Override
+ public boolean validate(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) {
+
+ return value == null
+ ? isNullable == null || isNullable
+ : validateLiteral(value) && validatePrecisionAndScale(value, precision, scale);
+ }
+
+ private static boolean validateLiteral(final String value) {
+ return PATTERN.matcher(value).matches();
+ }
+
+ private static final boolean validatePrecisionAndScale(final String value, final Integer precision,
+ final Integer scale) {
+
+ final Matcher matcher = PATTERN.matcher(value);
+ matcher.matches();
+ final int significantIntegerDigits = matcher.group(1).equals("0") ? 0 : matcher.group(1).length();
+ final int decimals = matcher.group(2) == null ? 0 : matcher.group(2).length();
+ return (precision == null || precision >= significantIntegerDigits + decimals)
+ && (decimals <= (scale == null ? 0 : scale));
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ if (!validateLiteral(value)) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+ if (!validatePrecisionAndScale(value, precision, scale)) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+
+ try {
+ return convertDecimal(new BigDecimal(value), returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ /**
+ * Converts a {@link BigDecimal} value into the requested return type if possible.
+ *
+ * @param value the value
+ * @param returnType the class of the returned value; it must be one of {@link BigDecimal}, {@link Double},
+ * {@link Float}, {@link BigInteger}, {@link Long}, {@link Integer}, {@link Short}, or {@link Byte}
+ * @return the converted value
+ * @throws IllegalArgumentException if the conversion is not possible or would lead to loss of data
+ * @throws ClassCastException if the return type is not allowed
+ */
+ protected static <T> T convertDecimal(final BigDecimal value, final Class<T> returnType)
+ throws IllegalArgumentException, ClassCastException {
+
+ if (returnType.isAssignableFrom(BigDecimal.class)) {
+ return returnType.cast(value);
+ } else if (returnType.isAssignableFrom(Double.class)) {
+ final double doubleValue = value.doubleValue();
+ if (BigDecimal.valueOf(doubleValue).compareTo(value) == 0) {
+ return returnType.cast(doubleValue);
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } else if (returnType.isAssignableFrom(Float.class)) {
+ final Float floatValue = value.floatValue();
+ if (BigDecimal.valueOf(floatValue).compareTo(value) == 0) {
+ return returnType.cast(floatValue);
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } else {
+ try {
+ if (returnType.isAssignableFrom(BigInteger.class)) {
+ return returnType.cast(value.toBigIntegerExact());
+ } else if (returnType.isAssignableFrom(Long.class)) {
+ return returnType.cast(value.longValueExact());
+ } else if (returnType.isAssignableFrom(Integer.class)) {
+ return returnType.cast(value.intValueExact());
+ } else if (returnType.isAssignableFrom(Short.class)) {
+ return returnType.cast(value.shortValueExact());
+ } else if (returnType.isAssignableFrom(Byte.class)) {
+ return returnType.cast(value.byteValueExact());
+ } else {
+ throw new ClassCastException("unsupported return type " + returnType.getSimpleName());
+ }
+ } catch (final ArithmeticException e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ String result;
+ if (value instanceof Long || value instanceof Integer || value instanceof Short
+ || value instanceof Byte || value instanceof BigInteger) {
+ result = value.toString();
+ final int digits = result.startsWith("-") ? result.length() - 1 : result.length();
+ if (precision != null && precision < digits) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+
+ } else if (value instanceof Double || value instanceof Float || value instanceof BigDecimal) {
+ BigDecimal bigDecimalValue;
+ try {
+ bigDecimalValue = value instanceof Double ? BigDecimal.valueOf((Double) value)
+ : value instanceof Float ? BigDecimal.valueOf((Float) value) : (BigDecimal) value;
+ } catch (final NumberFormatException e) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)", e);
+ }
+
+ final int digits = bigDecimalValue.scale() >= 0
+ ? Math.max(bigDecimalValue.precision(), bigDecimalValue.scale())
+ : bigDecimalValue.precision() - bigDecimalValue.scale();
+ if ((precision == null || precision >= digits) && (bigDecimalValue.scale() <= (scale == null ? 0 : scale))) {
+ result = bigDecimalValue.toPlainString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDouble.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDouble.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDouble.java
new file mode 100644
index 0000000..f38790a
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDouble.java
@@ -0,0 +1,146 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.math.BigDecimal;
+import java.util.regex.Pattern;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Double.
+ */
+public final class EdmDouble extends SingletonPrimitiveType {
+
+ protected static final String NEGATIVE_INFINITY = "-INF";
+
+ protected static final String POSITIVE_INFINITY = "INF";
+
+ protected static final String NaN = "NaN";
+
+ private static final Pattern PATTERN = Pattern.compile(
+ "(?:\\+|-)?\\p{Digit}{1,17}(?:\\.\\p{Digit}{1,17})?(?:(?:E|e)(?:\\+|-)?\\p{Digit}{1,3})?");
+
+ private static final EdmDouble INSTANCE = new EdmDouble();
+
+ public static EdmDouble getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return primitiveType instanceof Uint7
+ || primitiveType instanceof EdmByte
+ || primitiveType instanceof EdmSByte
+ || primitiveType instanceof EdmInt16
+ || primitiveType instanceof EdmInt32
+ || primitiveType instanceof EdmInt64
+ || primitiveType instanceof EdmSingle
+ || primitiveType instanceof EdmDouble;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Double.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ Double result = null;
+ BigDecimal bigDecimalValue = null;
+ // Handle special values first.
+ if (value.equals(NEGATIVE_INFINITY)) {
+ result = Double.NEGATIVE_INFINITY;
+ } else if (value.equals(POSITIVE_INFINITY)) {
+ result = Double.POSITIVE_INFINITY;
+ } else if (value.equals(NaN)) {
+ result = Double.NaN;
+ } else {
+ // Now only "normal" numbers remain.
+ if (!PATTERN.matcher(value).matches()) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+
+ // The number format is checked above, so we don't have to catch NumberFormatException.
+ bigDecimalValue = new BigDecimal(value);
+ result = bigDecimalValue.doubleValue();
+ // "Real" infinite values have been treated already above, so we can throw an exception
+ // if the conversion to a double results in an infinite value.
+ if (result.isInfinite() || BigDecimal.valueOf(result).compareTo(bigDecimalValue) != 0) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+ }
+
+ if (returnType.isAssignableFrom(Double.class)) {
+ return returnType.cast(result);
+ } else if (result.isInfinite() || result.isNaN()) {
+ if (returnType.isAssignableFrom(Float.class)) {
+ return returnType.cast(result.floatValue());
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType)");
+ }
+ } else {
+ try {
+ return EdmDecimal.convertDecimal(bigDecimalValue, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+ if (value instanceof Long) {
+ if (Math.abs((Long) value) < 1L << 51) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else if (value instanceof Integer || value instanceof Short || value instanceof Byte) {
+ return value.toString();
+ } else if (value instanceof Double) {
+ return (Double) value == Double.NEGATIVE_INFINITY ? NEGATIVE_INFINITY
+ : (Double) value == Double.POSITIVE_INFINITY ? POSITIVE_INFINITY : value.toString();
+ } else if (value instanceof Float) {
+ return (Float) value == Float.NEGATIVE_INFINITY ? NEGATIVE_INFINITY
+ : (Float) value == Float.POSITIVE_INFINITY ? POSITIVE_INFINITY : value.toString();
+ } else if (value instanceof BigDecimal) {
+ final double doubleValue = ((BigDecimal) value).doubleValue();
+ if (!Double.isInfinite(doubleValue) && BigDecimal.valueOf(doubleValue).compareTo((BigDecimal) value) == 0) {
+ return ((BigDecimal) value).toString();
+ } else {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDuration.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDuration.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDuration.java
new file mode 100644
index 0000000..fab05a7
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDuration.java
@@ -0,0 +1,140 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+public final class EdmDuration extends SingletonPrimitiveType {
+
+ private static final Pattern PATTERN = Pattern.compile(
+ "[-+]?P(?:(\\p{Digit}+)D)?(?:T(?:(\\p{Digit}+)H)?(?:(\\p{Digit}+)M)?"
+ + "(?:(\\p{Digit}+(?:\\.(?:\\p{Digit}+?)0*)?)S)?)?");
+
+ private static final EdmDuration INSTANCE = new EdmDuration();
+
+ {
+ uriPrefix = "duration'";
+ uriSuffix = "'";
+ }
+
+ public static EdmDuration getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return BigDecimal.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+ final Matcher matcher = PATTERN.matcher(value);
+ if (!matcher.matches()
+ || matcher.group(1) == null && matcher.group(2) == null && matcher.group(3) == null
+ && matcher.group(4) == null) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(literal)");
+ }
+
+ BigDecimal result = (matcher.group(1) == null ? BigDecimal.ZERO
+ : new BigDecimal(matcher.group(1)).multiply(BigDecimal.valueOf(24 * 60 * 60))).
+ add(matcher.group(2) == null ? BigDecimal.ZERO
+ : new BigDecimal(matcher.group(2)).multiply(BigDecimal.valueOf(60 * 60))).
+ add(matcher.group(3) == null ? BigDecimal.ZERO
+ : new BigDecimal(matcher.group(3)).multiply(BigDecimal.valueOf(60))).
+ add(matcher.group(4) == null ? BigDecimal.ZERO : new BigDecimal(matcher.group(4)));
+
+ if (result.scale() <= (precision == null ? 0 : precision)) {
+ result = value.startsWith("-") ? result.negate() : result;
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(literal, facets)");
+ }
+
+ try {
+ return EdmDecimal.convertDecimal(result, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ BigDecimal valueDecimal;
+ if (value instanceof BigDecimal) {
+ valueDecimal = (BigDecimal) value;
+ } else if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) {
+ valueDecimal = BigDecimal.valueOf(((Number) value).longValue());
+ } else if (value instanceof BigInteger) {
+ valueDecimal = new BigDecimal((BigInteger) value);
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+
+ if (valueDecimal.scale() > (precision == null ? 0 : precision)) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+
+ final StringBuilder result = new StringBuilder();
+ if (valueDecimal.signum() == -1) {
+ result.append('-');
+ valueDecimal = valueDecimal.negate();
+ }
+ result.append('P');
+ BigInteger seconds = valueDecimal.toBigInteger();
+ final BigInteger days = seconds.divide(BigInteger.valueOf(24 * 60 * 60));
+ if (!days.equals(BigInteger.ZERO)) {
+ result.append(days.toString());
+ result.append('D');
+ }
+ result.append('T');
+ seconds = seconds.subtract(days.multiply(BigInteger.valueOf(24 * 60 * 60)));
+ final BigInteger hours = seconds.divide(BigInteger.valueOf(60 * 60));
+ if (!hours.equals(BigInteger.ZERO)) {
+ result.append(hours.toString());
+ result.append('H');
+ }
+ seconds = seconds.subtract(hours.multiply(BigInteger.valueOf(60 * 60)));
+ final BigInteger minutes = seconds.divide(BigInteger.valueOf(60));
+ if (!minutes.equals(BigInteger.ZERO)) {
+ result.append(minutes.toString());
+ result.append('M');
+ }
+ result.append(valueDecimal.remainder(BigDecimal.valueOf(60)).toPlainString());
+ result.append('S');
+
+ return result.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuid.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuid.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuid.java
new file mode 100644
index 0000000..3072795
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuid.java
@@ -0,0 +1,88 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.util.UUID;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Guid.
+ */
+public final class EdmGuid extends SingletonPrimitiveType {
+
+ private static final String PATTERN = "\\p{XDigit}{8}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{12}";
+
+ private static final EdmGuid INSTANCE = new EdmGuid();
+
+ public static EdmGuid getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return UUID.class;
+ }
+
+ @Override
+ public boolean validate(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) {
+ return value == null ? isNullable == null || isNullable : validateLiteral(value);
+ }
+
+ private boolean validateLiteral(final String value) {
+ return value.matches(PATTERN);
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode,
+ final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ UUID result;
+ if (validateLiteral(value)) {
+ result = UUID.fromString(value);
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+
+ if (returnType.isAssignableFrom(UUID.class)) {
+ return returnType.cast(result);
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ if (value instanceof UUID) {
+ return ((UUID) value).toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16.java
new file mode 100644
index 0000000..e389da6
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16.java
@@ -0,0 +1,99 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Int16.
+ */
+public final class EdmInt16 extends SingletonPrimitiveType {
+
+ private static final EdmInt16 INSTANCE = new EdmInt16();
+
+ public static EdmInt16 getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return primitiveType instanceof Uint7
+ || primitiveType instanceof EdmByte
+ || primitiveType instanceof EdmSByte
+ || primitiveType instanceof EdmInt16;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Short.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+ Short valueShort;
+ try {
+ valueShort = Short.parseShort(value);
+ } catch (final NumberFormatException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+ }
+
+ try {
+ return EdmInt64.convertNumber(valueShort, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+ if (value instanceof Byte || value instanceof Short) {
+ return value.toString();
+ } else if (value instanceof Integer || value instanceof Long) {
+ if (((Number) value).longValue() >= Short.MIN_VALUE
+ && ((Number) value).longValue() <= Short.MAX_VALUE) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else if (value instanceof BigInteger) {
+ if (((BigInteger) value).bitLength() < Short.SIZE) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32.java
new file mode 100644
index 0000000..768aa33
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32.java
@@ -0,0 +1,100 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Int32.
+ */
+public final class EdmInt32 extends SingletonPrimitiveType {
+
+ private static final EdmInt32 INSTANCE = new EdmInt32();
+
+ public static EdmInt32 getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return primitiveType instanceof Uint7
+ || primitiveType instanceof EdmByte
+ || primitiveType instanceof EdmSByte
+ || primitiveType instanceof EdmInt16
+ || primitiveType instanceof EdmInt32;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Integer.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ Integer valueInteger;
+ try {
+ valueInteger = Integer.parseInt(value);
+ } catch (final NumberFormatException e) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+ }
+
+ try {
+ return EdmInt64.convertNumber(valueInteger, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ if (value instanceof Byte || value instanceof Short || value instanceof Integer) {
+ return value.toString();
+ } else if (value instanceof Long) {
+ if ((Long) value >= Integer.MIN_VALUE && (Long) value <= Integer.MAX_VALUE) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else if (value instanceof BigInteger) {
+ if (((BigInteger) value).bitLength() < Integer.SIZE) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64.java
new file mode 100644
index 0000000..308202d
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64.java
@@ -0,0 +1,135 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Int64.
+ */
+public final class EdmInt64 extends SingletonPrimitiveType {
+
+ private static final EdmInt64 INSTANCE = new EdmInt64();
+
+ public static EdmInt64 getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return primitiveType instanceof Uint7
+ || primitiveType instanceof EdmByte
+ || primitiveType instanceof EdmSByte
+ || primitiveType instanceof EdmInt16
+ || primitiveType instanceof EdmInt32
+ || primitiveType instanceof EdmInt64;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Long.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ Long valueLong;
+ try {
+ valueLong = Long.parseLong(value);
+ } catch (final NumberFormatException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+ }
+
+ try {
+ return convertNumber(valueLong, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ /**
+ * Converts a whole {@link Number} value into the requested return type if possible.
+ *
+ * @param value the value
+ * @param returnType the class of the returned value; it must be one of {@link BigInteger}, {@link Long},
+ * {@link Integer}, {@link Short}, or {@link Byte}
+ * @return the converted value
+ * @throws IllegalArgumentException if the conversion is not possible
+ * @throws ClassCastException if the return type is not allowed
+ */
+ public static <T> T convertNumber(final Number value, final Class<T> returnType)
+ throws IllegalArgumentException, ClassCastException {
+
+ if (returnType.isAssignableFrom(Long.class)) {
+ return returnType.cast(value.longValue());
+ } else if (returnType.isAssignableFrom(BigInteger.class)) {
+ return returnType.cast(BigInteger.valueOf(value.longValue()));
+ } else if (returnType.isAssignableFrom(Byte.class)) {
+ if (value.longValue() >= Byte.MIN_VALUE && value.longValue() <= Byte.MAX_VALUE) {
+ return returnType.cast(value.byteValue());
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } else if (returnType.isAssignableFrom(Short.class)) {
+ if (value.longValue() >= Short.MIN_VALUE && value.longValue() <= Short.MAX_VALUE) {
+ return returnType.cast(value.shortValue());
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } else if (returnType.isAssignableFrom(Integer.class)) {
+ if (value.longValue() >= Integer.MIN_VALUE && value.longValue() <= Integer.MAX_VALUE) {
+ return returnType.cast(value.intValue());
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } else {
+ throw new ClassCastException("unsupported return type " + returnType.getSimpleName());
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) {
+ return value.toString();
+ } else if (value instanceof BigInteger) {
+ if (((BigInteger) value).bitLength() < Long.SIZE) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmNull.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmNull.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmNull.java
new file mode 100644
index 0000000..57b1218
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmNull.java
@@ -0,0 +1,75 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+//TODO: Is this class still necessary?
+/**
+ * Implementation of the simple type Null.
+ */
+public final class EdmNull extends SingletonPrimitiveType {
+
+ private static final EdmNull INSTANCE = new EdmNull();
+
+ public static EdmNull getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return this == obj || obj == null;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return null;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ return null;
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ return null;
+ }
+
+ @Override
+ public String toUriLiteral(final String literal) {
+ return "null";
+ }
+
+ @Override
+ public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmPrimitiveTypeKind.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmPrimitiveTypeKind.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmPrimitiveTypeKind.java
new file mode 100644
index 0000000..b0deeef
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmPrimitiveTypeKind.java
@@ -0,0 +1,98 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+//TODO: Should we delete this typekind and use a facade?
+public enum EdmPrimitiveTypeKind {
+
+ Binary, Boolean, Byte, Date, DateTimeOffset, Decimal, Double, Duration, Guid,
+ Int16, Int32, Int64, SByte, Single, String, TimeOfDay;
+
+ /**
+ * Returns the {@link FullQualifiedName} for this type kind.
+ *
+ * @return {@link FullQualifiedName}
+ */
+ public FullQualifiedName getFullQualifiedName() {
+ return new FullQualifiedName(EdmPrimitiveType.EDM_NAMESPACE, toString());
+ }
+
+ /**
+ * Returns an instance for this {@link EdmPrimitiveTypeKind} in the form of {@link EdmPrimitiveType}.
+ *
+ * @return {@link EdmPrimitiveType} instance
+ */
+ public EdmPrimitiveType getEdmPrimitiveTypeInstance() {
+ switch (this) {
+ case Binary:
+ return EdmBinary.getInstance();
+ case Boolean:
+ return EdmBoolean.getInstance();
+ case Byte:
+ return EdmByte.getInstance();
+ case Date:
+ return EdmDate.getInstance();
+ case DateTimeOffset:
+ return EdmDateTimeOffset.getInstance();
+ case Decimal:
+ return EdmDecimal.getInstance();
+ case Double:
+ return EdmDouble.getInstance();
+ case Duration:
+ return EdmDuration.getInstance();
+ case Guid:
+ return EdmGuid.getInstance();
+ case Int16:
+ return EdmInt16.getInstance();
+ case Int32:
+ return EdmInt32.getInstance();
+ case Int64:
+ return EdmInt64.getInstance();
+ case SByte:
+ return EdmSByte.getInstance();
+ case Single:
+ return EdmSingle.getInstance();
+ case String:
+ return EdmString.getInstance();
+ case TimeOfDay:
+ return EdmTimeOfDay.getInstance();
+ default:
+ throw new RuntimeException("Wrong type:" + this);
+ }
+ }
+
+ /**
+ * Gets <tt>EdmPrimitiveTypeKind</tt> from a full string (e.g. 'Edm.Int32').
+ *
+ * @param value string value type.
+ * @return <tt>EdmPrimitiveTypeKind</tt> object.
+ */
+ public static EdmPrimitiveTypeKind fromString(final String value) {
+ final String noNsValue = value.substring(4);
+ for (EdmPrimitiveTypeKind edmSimpleType : EdmPrimitiveTypeKind.values()) {
+ if (edmSimpleType.name().equals(noNsValue)) {
+ return edmSimpleType;
+ }
+ }
+ throw new IllegalArgumentException(value);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByte.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByte.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByte.java
new file mode 100644
index 0000000..e855b53
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByte.java
@@ -0,0 +1,95 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type SByte.
+ */
+public final class EdmSByte extends SingletonPrimitiveType {
+
+ private static final EdmSByte INSTANCE = new EdmSByte();
+
+ public static EdmSByte getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return primitiveType instanceof Uint7
+ || primitiveType instanceof EdmSByte;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Byte.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ Byte valueByte;
+ try {
+ valueByte = Byte.parseByte(value);
+ } catch (final NumberFormatException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+ }
+
+ try {
+ return EdmInt64.convertNumber(valueByte, returnType);
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ if (value instanceof Byte) {
+ return value.toString();
+ } else if (value instanceof Short || value instanceof Integer || value instanceof Long) {
+ if (((Number) value).longValue() >= Byte.MIN_VALUE && ((Number) value).longValue() <= Byte.MAX_VALUE) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else if (value instanceof BigInteger) {
+ if (((BigInteger) value).bitLength() < Byte.SIZE) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSingle.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSingle.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSingle.java
new file mode 100644
index 0000000..3ec2fd4
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSingle.java
@@ -0,0 +1,148 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.math.BigDecimal;
+import java.util.regex.Pattern;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Single.
+ */
+public final class EdmSingle extends SingletonPrimitiveType {
+
+ private static final Pattern PATTERN = Pattern.compile(
+ "(?:\\+|-)?\\p{Digit}{1,9}(?:\\.\\p{Digit}{1,9})?(?:(?:E|e)(?:\\+|-)?\\p{Digit}{1,2})?");
+
+ private static final EdmSingle INSTANCE = new EdmSingle();
+
+ public static EdmSingle getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return primitiveType instanceof Uint7
+ || primitiveType instanceof EdmByte
+ || primitiveType instanceof EdmSByte
+ || primitiveType instanceof EdmInt16
+ || primitiveType instanceof EdmInt32
+ || primitiveType instanceof EdmInt64
+ || primitiveType instanceof EdmSingle;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Float.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ Float result = null;
+ BigDecimal bigDecimalValue = null;
+ // Handle special values first.
+ if (value.equals(EdmDouble.NEGATIVE_INFINITY)) {
+ result = Float.NEGATIVE_INFINITY;
+ } else if (value.equals(EdmDouble.POSITIVE_INFINITY)) {
+ result = Float.POSITIVE_INFINITY;
+ } else if (value.equals(EdmDouble.NaN)) {
+ result = Float.NaN;
+ } else {
+ // Now only "normal" numbers remain.
+ if (!PATTERN.matcher(value).matches()) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+
+ // The number format is checked above, so we don't have to catch NumberFormatException.
+ bigDecimalValue = new BigDecimal(value);
+ result = bigDecimalValue.floatValue();
+ // "Real" infinite values have been treated already above, so we can throw an exception
+ // if the conversion to a float results in an infinite value.
+ if (result.isInfinite() || bigDecimalValue.compareTo(new BigDecimal(result.toString())) != 0) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+ }
+
+ if (returnType.isAssignableFrom(Float.class)) {
+ return returnType.cast(result);
+ } else if (result.isInfinite() || result.isNaN()) {
+ if (returnType.isAssignableFrom(Double.class)) {
+ return returnType.cast(result.doubleValue());
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType)");
+ }
+ } else {
+ try {
+ return EdmDecimal.convertDecimal(bigDecimalValue, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ if (value instanceof Long || value instanceof Integer) {
+ if (Math.abs(((Number) value).longValue()) < 1L << 22) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else if (value instanceof Short || value instanceof Byte) {
+ return value.toString();
+ } else if (value instanceof Double) {
+ if (((Double) value).isInfinite()) {
+ return (Double) value == Double.NEGATIVE_INFINITY ? EdmDouble.NEGATIVE_INFINITY : EdmDouble.POSITIVE_INFINITY;
+ } else {
+ final String floatString = Float.toString(((Double) value).floatValue());
+ if (floatString.equals(((Double) value).toString())) {
+ return floatString;
+ } else {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ }
+ } else if (value instanceof Float) {
+ return (Float) value == Float.NEGATIVE_INFINITY ? EdmDouble.NEGATIVE_INFINITY
+ : (Float) value == Float.POSITIVE_INFINITY ? EdmDouble.POSITIVE_INFINITY : value.toString();
+ } else if (value instanceof BigDecimal) {
+ final float floatValue = ((BigDecimal) value).floatValue();
+ if (!Float.isInfinite(floatValue) && BigDecimal.valueOf(floatValue).compareTo((BigDecimal) value) == 0) {
+ return ((BigDecimal) value).toString();
+ } else {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
new file mode 100644
index 0000000..4defe91
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java
@@ -0,0 +1,108 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.util.regex.Pattern;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type String.
+ */
+public final class EdmString extends SingletonPrimitiveType {
+
+ private static final Pattern PATTERN_ASCII = Pattern.compile("\\p{ASCII}*");
+
+ private static final EdmString INSTANCE = new EdmString();
+
+ {
+ uriPrefix = "'";
+ uriSuffix = "'";
+ }
+
+ public static EdmString getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return String.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ if (isUnicode != null && !isUnicode && !PATTERN_ASCII.matcher(value).matches()
+ || maxLength != null && maxLength < value.length()) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+
+ if (returnType.isAssignableFrom(String.class)) {
+ return returnType.cast(value);
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ final String result = value instanceof String ? (String) value : String.valueOf(value);
+
+ if (isUnicode != null && !isUnicode && !PATTERN_ASCII.matcher(result).matches()
+ || maxLength != null && maxLength < result.length()) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+
+ return result;
+ }
+
+ @Override
+ public String toUriLiteral(final String literal) {
+ if (literal == null) {
+ return null;
+ }
+
+ final int length = literal.length();
+
+ final StringBuilder uriLiteral = new StringBuilder(length + 2);
+ uriLiteral.append(uriPrefix);
+ for (int i = 0; i < length; i++) {
+ final char c = literal.charAt(i);
+ if (c == '\'') {
+ uriLiteral.append(c);
+ }
+ uriLiteral.append(c);
+ }
+ uriLiteral.append(uriSuffix);
+ return uriLiteral.toString();
+ }
+
+ @Override
+ public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
+ return literal == null ? null : super.fromUriLiteral(literal).replace("''", "'");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmTimeOfDay.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmTimeOfDay.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmTimeOfDay.java
new file mode 100644
index 0000000..7d8cf9e
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmTimeOfDay.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.commons.core.edm.primitivetype;
+
+import java.util.Calendar;
+import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+public final class EdmTimeOfDay extends SingletonPrimitiveType {
+
+ private static final Pattern PATTERN = Pattern.compile(
+ "(\\p{Digit}{2}):(\\p{Digit}{2})(?::(\\p{Digit}{2})(\\.(\\p{Digit}{0,3}?)0*)?)?");
+
+ private static final EdmTimeOfDay INSTANCE = new EdmTimeOfDay();
+
+ public static EdmTimeOfDay getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Calendar.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ final Matcher matcher = PATTERN.matcher(value);
+ if (!matcher.matches()) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+
+ final Calendar dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
+ dateTimeValue.clear();
+ dateTimeValue.set(Calendar.HOUR_OF_DAY, Byte.parseByte(matcher.group(1)));
+ dateTimeValue.set(Calendar.MINUTE, Byte.parseByte(matcher.group(2)));
+ dateTimeValue.set(Calendar.SECOND, matcher.group(3) == null ? 0 : Byte.parseByte(matcher.group(3)));
+
+ if (matcher.group(4) != null) {
+ if (matcher.group(4).length() == 1 || matcher.group(4).length() > 13) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+ final String decimals = matcher.group(5);
+ if (decimals.length() > (precision == null ? 0 : precision)) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+ final String milliSeconds = decimals + "000".substring(decimals.length());
+ dateTimeValue.set(Calendar.MILLISECOND, Short.parseShort(milliSeconds));
+ }
+
+ try {
+ return EdmDateTimeOffset.convertDateTime(dateTimeValue, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ final Calendar dateTimeValue = EdmDateTimeOffset.createDateTime(value);
+
+ final StringBuilder result = new StringBuilder(8); // Eight characters are enough for "normal" times.
+ EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.HOUR_OF_DAY));
+ result.append(':');
+ EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.MINUTE));
+ result.append(':');
+ EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.SECOND));
+
+ try {
+ EdmDateTimeOffset.appendMilliseconds(result, dateTimeValue.get(Calendar.MILLISECOND), precision);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets), e");
+ }
+
+ return result.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/SingletonPrimitiveType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/SingletonPrimitiveType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/SingletonPrimitiveType.java
new file mode 100644
index 0000000..48e4972
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/SingletonPrimitiveType.java
@@ -0,0 +1,52 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+/**
+ * Abstract singleton implementation of the EDM primitive-type interface.
+ */
+public abstract class SingletonPrimitiveType extends AbstractPrimitiveType {
+
+ @Override
+ public boolean equals(final Object obj) {
+ return this == obj || obj != null && getClass() == obj.getClass();
+ }
+
+ @Override
+ public int hashCode() {
+ return getClass().hashCode();
+ }
+
+ @Override
+ public String getNamespace() {
+ return EDM_NAMESPACE;
+ }
+
+ @Override
+ public String getName() {
+ return getClass().getSimpleName().substring(3);
+ }
+
+ @Override
+ public EdmTypeKind getKind() {
+ return EdmTypeKind.PRIMITIVE;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/Uint7.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/Uint7.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/Uint7.java
new file mode 100644
index 0000000..850ee0c
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/Uint7.java
@@ -0,0 +1,66 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the internal primitive type "unsigned 7-bit integer".
+ */
+public final class Uint7 extends SingletonPrimitiveType {
+
+ private static final Uint7 INSTANCE = new Uint7();
+
+ public static Uint7 getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public String getNamespace() {
+ return SYSTEM_NAMESPACE;
+ }
+
+ @Override
+ public String getName() {
+ return getClass().getSimpleName();
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Byte.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ return EdmSByte.getInstance().internalValueOfString(
+ value, isNullable, maxLength, precision, scale, isUnicode, returnType);
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ return EdmSByte.getInstance().internalValueToString(
+ value, isNullable, maxLength, precision, scale, isUnicode);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmBindingTarget.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmBindingTarget.java
deleted file mode 100644
index 6e9df56..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmBindingTarget.java
+++ /dev/null
@@ -1,55 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmBindingTarget;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public abstract class AbstractEdmBindingTarget extends EdmNamedImpl implements EdmBindingTarget {
-
- protected final EdmEntityContainer container;
-
- private final FullQualifiedName type;
-
- public AbstractEdmBindingTarget(final Edm edm, final EdmEntityContainer container,
- final String name, final FullQualifiedName type) {
-
- super(edm, name);
- this.container = container;
- this.type = type;
- }
-
- @Override
- public EdmEntityContainer getEntityContainer() {
- return container;
- }
-
- @Override
- public EdmEntityType getEntityType() {
- final EdmEntityType entityType = edm.getEntityType(this.type);
- if (entityType == null) {
- throw new EdmException("Can´t find entity type: " + type + " for entity set or singleton: " + getName());
- }
- return entityType;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmComplexType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmComplexType.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmComplexType.java
deleted file mode 100644
index db52f2e..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmComplexType.java
+++ /dev/null
@@ -1,50 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmStructuredType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public abstract class AbstractEdmComplexType extends AbstractEdmStructuredType implements EdmComplexType {
-
- public AbstractEdmComplexType(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName) {
- super(edm, fqn, EdmTypeKind.COMPLEX, baseTypeName);
- }
-
- @Override
- protected EdmStructuredType buildBaseType(final FullQualifiedName baseTypeName) {
- EdmComplexType baseType = null;
- if (baseTypeName != null) {
- baseType = edm.getComplexType(baseTypeName);
- if (baseType == null) {
- throw new EdmException("Can't find base type with name: " + baseTypeName + " for complex type: " + getName());
- }
- }
- return baseType;
- }
-
- @Override
- public EdmComplexType getBaseType() {
- return (EdmComplexType) baseType;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEntityContainer.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEntityContainer.java
deleted file mode 100644
index d183972..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEntityContainer.java
+++ /dev/null
@@ -1,101 +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.commons.core.edm;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmSingleton;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public abstract class AbstractEdmEntityContainer extends EdmNamedImpl implements EdmEntityContainer {
-
- protected final FullQualifiedName entityContainerName;
-
- private final Map<String, EdmSingleton> singletons = new HashMap<String, EdmSingleton>();
-
- private final Map<String, EdmEntitySet> entitySets = new HashMap<String, EdmEntitySet>();
-
- private final Map<String, EdmActionImport> actionImports = new HashMap<String, EdmActionImport>();
-
- private final Map<String, EdmFunctionImport> functionImports = new HashMap<String, EdmFunctionImport>();
-
- public AbstractEdmEntityContainer(final Edm edm, final FullQualifiedName entityContainerName) {
- super(edm, entityContainerName.getName());
- this.entityContainerName = entityContainerName;
- }
-
- @Override
- public String getNamespace() {
- return entityContainerName.getNamespace();
- }
-
- protected abstract EdmSingleton createSingleton(String singletonName);
-
- @Override
- public EdmSingleton getSingleton(final String singletonName) {
- EdmSingleton singleton = singletons.get(singletonName);
- if (singleton == null) {
- singleton = createSingleton(singletonName);
- singletons.put(singletonName, singleton);
- }
- return singleton;
- }
-
- protected abstract EdmEntitySet createEntitySet(String entitySetName);
-
- @Override
- public EdmEntitySet getEntitySet(final String entitySetName) {
- EdmEntitySet entitySet = entitySets.get(entitySetName);
- if (entitySet == null) {
- entitySet = createEntitySet(entitySetName);
- entitySets.put(entitySetName, entitySet);
- }
- return entitySet;
- }
-
- protected abstract EdmActionImport createActionImport(String actionImportName);
-
- @Override
- public EdmActionImport getActionImport(final String actionImportName) {
- EdmActionImport actionImport = actionImports.get(actionImportName);
- if (actionImport == null) {
- actionImport = createActionImport(actionImportName);
- actionImports.put(actionImportName, actionImport);
- }
- return actionImport;
- }
-
- protected abstract EdmFunctionImport createFunctionImport(String functionImportName);
-
- @Override
- public EdmFunctionImport getFunctionImport(final String functionImportName) {
- EdmFunctionImport functionImport = functionImports.get(functionImportName);
- if (functionImport == null) {
- functionImport = createFunctionImport(functionImportName);
- functionImports.put(functionImportName, functionImport);
- }
- return functionImport;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEntityType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEntityType.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEntityType.java
deleted file mode 100644
index 75f982f..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEntityType.java
+++ /dev/null
@@ -1,113 +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.commons.core.edm;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmKeyPropertyRef;
-import org.apache.olingo.odata4.commons.api.edm.EdmStructuredType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public abstract class AbstractEdmEntityType extends AbstractEdmStructuredType implements EdmEntityType {
-
- private final boolean hasStream;
-
- protected EdmEntityType entityBaseType;
-
- private final List<String> keyPredicateNames = new ArrayList<String>();
-
- private final Map<String, EdmKeyPropertyRef> keyPropertyRefs = new LinkedHashMap<String, EdmKeyPropertyRef>();
-
- private List<EdmKeyPropertyRef> keyPropertyRefsList;
-
- protected AbstractEdmEntityType(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName,
- final boolean hashStream) {
-
- super(edm, fqn, EdmTypeKind.ENTITY, baseTypeName);
- this.hasStream = hashStream;
- }
-
- protected void setEdmKeyPropertyRef(final List<EdmKeyPropertyRef> edmKey) {
- for (EdmKeyPropertyRef ref : edmKey) {
- if (ref.getAlias() == null) {
- keyPredicateNames.add(ref.getKeyPropertyName());
- keyPropertyRefs.put(ref.getKeyPropertyName(), ref);
- } else {
- keyPredicateNames.add(ref.getAlias());
- keyPropertyRefs.put(ref.getAlias(), ref);
- }
- }
- }
-
- @Override
- protected EdmStructuredType buildBaseType(final FullQualifiedName baseTypeName) {
- EdmEntityType baseType = null;
- if (baseTypeName != null) {
- baseType = edm.getEntityType(baseTypeName);
- if (baseType == null) {
- throw new EdmException("Cannot find base type with name: " + baseTypeName + " for entity type: " + getName());
- }
- }
- return baseType;
- }
-
- @Override
- public EdmEntityType getBaseType() {
- return entityBaseType;
- }
-
- @Override
- public List<String> getKeyPredicateNames() {
- if (keyPredicateNames.isEmpty() && baseType != null) {
- return entityBaseType.getKeyPredicateNames();
- }
- return keyPredicateNames;
- }
-
- @Override
- public List<EdmKeyPropertyRef> getKeyPropertyRefs() {
- if (keyPropertyRefsList == null) {
- keyPropertyRefsList = new ArrayList<EdmKeyPropertyRef>(keyPropertyRefs.values());
- }
- if (keyPropertyRefsList.isEmpty() && entityBaseType != null) {
- return entityBaseType.getKeyPropertyRefs();
- }
- return keyPropertyRefsList;
- }
-
- @Override
- public EdmKeyPropertyRef getKeyPropertyRef(final String keyPredicateName) {
- final EdmKeyPropertyRef edmKeyPropertyRef = keyPropertyRefs.get(keyPredicateName);
- if (edmKeyPropertyRef == null && entityBaseType != null) {
- return entityBaseType.getKeyPropertyRef(keyPredicateName);
- }
- return edmKeyPropertyRef;
- }
-
- @Override
- public boolean hasStream() {
- return hasStream;
- }
-}
[31/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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/edm/EdmKeyPropertyRefImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmKeyPropertyRefImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmKeyPropertyRefImpl.java
deleted file mode 100644
index 0264c28..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmKeyPropertyRefImpl.java
+++ /dev/null
@@ -1,49 +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.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.PropertyRef;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmKeyPropertyRef;
-
-public class EdmKeyPropertyRefImpl extends AbstractEdmKeyPropertyRef {
-
- private final PropertyRef propertyRef;
-
- public EdmKeyPropertyRefImpl(final EdmEntityType edmEntityType, final PropertyRef propertyRef) {
- super(edmEntityType);
- this.propertyRef = propertyRef;
- }
-
- @Override
- public String getKeyPropertyName() {
- return propertyRef.getName();
- }
-
- @Override
- public String getAlias() {
- return propertyRef.getAlias();
- }
-
- @Override
- public String getPath() {
- throw new UnsupportedOperationException("Not supported in client code.");
- }
-
-}
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/edm/EdmNavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmNavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmNavigationPropertyImpl.java
deleted file mode 100644
index 9d79914..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmNavigationPropertyImpl.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 org.apache.olingo.odata4.client.core.edm;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ReferentialConstraint;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmNavigationProperty;
-
-public class EdmNavigationPropertyImpl extends AbstractEdmNavigationProperty {
-
- private final NavigationProperty navigationProperty;
-
- private final EdmTypeInfo edmTypeInfo;
-
- public EdmNavigationPropertyImpl(final Edm edm, final NavigationProperty navigationProperty) {
- super(edm, navigationProperty.getName());
- this.navigationProperty = navigationProperty;
- this.edmTypeInfo = new EdmTypeInfo(navigationProperty.getType());
- }
-
- @Override
- protected FullQualifiedName getTypeFQN() {
- return edmTypeInfo.getFullQualifiedName();
- }
-
- @Override
- protected String internatGetPartner() {
- return navigationProperty.getPartner();
- }
-
- @Override
- public boolean isCollection() {
- return edmTypeInfo.isCollection();
- }
-
- @Override
- public Boolean isNullable() {
- return navigationProperty.isNullable();
- }
-
- @Override
- public String getReferencingPropertyName(final String referencedPropertyName) {
- final List<? extends ReferentialConstraint> referentialConstraints = navigationProperty.getReferentialConstraints();
- if (referentialConstraints != null) {
- for (ReferentialConstraint constraint : referentialConstraints) {
- if (constraint.getReferencedProperty().equals(referencedPropertyName)) {
- return constraint.getProperty();
- }
- }
- }
- return null;
- }
-
-}
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/edm/EdmOperationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmOperationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmOperationImpl.java
deleted file mode 100644
index 0fac59c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmOperationImpl.java
+++ /dev/null
@@ -1,60 +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.edm;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonParameter;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Action;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmParameter;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmOperation;
-
-public abstract class EdmOperationImpl extends AbstractEdmOperation {
-
- protected final Action operation;
-
- protected static <T extends EdmOperationImpl> T getInstance(final T instance) {
- final List<? extends CommonParameter> parameters = instance.operation.getParameters();
- final List<EdmParameter> _parameters = new ArrayList<EdmParameter>(parameters.size());
- for (CommonParameter parameter : parameters) {
- _parameters.add(EdmParameterImpl.getInstance(instance.edm, parameter));
- }
- instance.setParameters(_parameters);
-
- instance.setEntitySetPath(instance.operation.getEntitySetPath());
-
- instance.setIsBound(instance.operation.isBound());
-
- if (instance.operation.getReturnType() != null) {
- instance.setReturnType(EdmReturnTypeImpl.getInstance(instance.edm, instance.operation.getReturnType()));
- }
-
- return instance;
- }
-
- protected EdmOperationImpl(final Edm edm, final FullQualifiedName name, final Action operation,
- final EdmTypeKind kind) {
-
- super(edm, name, kind);
- this.operation = operation;
- }
-}
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/edm/EdmOperationImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmOperationImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmOperationImportImpl.java
deleted file mode 100644
index d73b8fb..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmOperationImportImpl.java
+++ /dev/null
@@ -1,34 +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.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.Target;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmOperationImport;
-
-public abstract class EdmOperationImportImpl extends AbstractEdmOperationImport {
-
- protected EdmOperationImportImpl(final Edm edm, final EdmEntityContainer container, final String name,
- final String entitySet) {
-
- super(edm, container, name, entitySet == null ? null : new Target.Builder(entitySet, container).build());
- }
-
-}
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/edm/EdmParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmParameterImpl.java
deleted file mode 100644
index 9b3beb4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmParameterImpl.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 org.apache.olingo.odata4.client.core.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.CommonParameter;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmMapping;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmParameter;
-
-public class EdmParameterImpl extends AbstractEdmParameter {
-
- private final CommonParameter parameter;
-
- private final EdmTypeInfo parameterInfo;
-
- public static EdmParameterImpl getInstance(final Edm edm, final CommonParameter parameter) {
- final EdmTypeInfo paramTypeInfo = new EdmTypeInfo(parameter.getType());
- return new EdmParameterImpl(edm, parameter, paramTypeInfo);
- }
-
- private EdmParameterImpl(final Edm edm, final CommonParameter parameter, final EdmTypeInfo parameterInfo) {
- super(edm, parameter.getName(), parameterInfo.getFullQualifiedName());
- this.parameter = parameter;
- this.parameterInfo = parameterInfo;
- }
-
- @Override
- public boolean isCollection() {
- return parameterInfo.isCollection();
- }
-
- @Override
- public EdmMapping getMapping() {
- throw new UnsupportedOperationException("Not supported in client code.");
- }
-
- @Override
- public Boolean isNullable() {
- return parameter.isNullable();
- }
-
- @Override
- public Integer getMaxLength() {
- return parameter.getMaxLength();
- }
-
- @Override
- public Integer getPrecision() {
- return parameter.getPrecision();
- }
-
- @Override
- public Integer getScale() {
- return parameter.getScale();
- }
-
-}
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/edm/EdmPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmPropertyImpl.java
deleted file mode 100644
index 20ffb2c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmPropertyImpl.java
+++ /dev/null
@@ -1,91 +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.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.CommonProperty;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmMapping;
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmProperty;
-
-public class EdmPropertyImpl extends AbstractEdmProperty implements EdmProperty {
-
- private final CommonProperty property;
-
- private final EdmTypeInfo edmTypeInfo;
-
- public EdmPropertyImpl(final Edm edm, final CommonProperty property) {
- super(edm, property.getName());
- this.property = property;
- this.edmTypeInfo = new EdmTypeInfo(property.getType());
- }
-
- @Override
- protected FullQualifiedName getTypeFQN() {
- return edmTypeInfo.getFullQualifiedName();
- }
-
- @Override
- public boolean isCollection() {
- return edmTypeInfo.isCollection();
- }
-
- @Override
- public EdmMapping getMapping() {
- throw new UnsupportedOperationException("Not supported in client code.");
- }
-
- @Override
- public String getMimeType() {
- throw new UnsupportedOperationException("Not supported in client code.");
- }
-
- @Override
- public Boolean isNullable() {
- return property.isNullable();
- }
-
- @Override
- public Integer getMaxLength() {
- return property.getMaxLength();
- }
-
- @Override
- public Integer getPrecision() {
- return property.getPrecision();
- }
-
- @Override
- public Integer getScale() {
- return property.getScale();
- }
-
- @Override
- public Boolean isUnicode() {
- return property.isUnicode();
- }
-
- @Override
- public String getDefaultValue() {
- return property.getDefaultValue();
- }
-
-}
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/edm/EdmReturnTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmReturnTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmReturnTypeImpl.java
deleted file mode 100644
index c17b996..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmReturnTypeImpl.java
+++ /dev/null
@@ -1,68 +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.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ReturnType;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmReturnType;
-
-public class EdmReturnTypeImpl extends AbstractEdmReturnType {
-
- private final ReturnType returnType;
-
- private final EdmTypeInfo returnTypeInfo;
-
- public static EdmReturnTypeImpl getInstance(final Edm edm, final ReturnType returnType) {
- final EdmTypeInfo returnTypeInfo = new EdmTypeInfo(returnType.getType());
- return new EdmReturnTypeImpl(edm, returnType, returnTypeInfo);
- }
-
- private EdmReturnTypeImpl(final Edm edm, final ReturnType returnType, final EdmTypeInfo returnTypeInfo) {
- super(edm, returnTypeInfo.getFullQualifiedName());
- this.returnType = returnType;
- this.returnTypeInfo = returnTypeInfo;
- }
-
- @Override
- public Boolean isNullable() {
- return returnType.isNullable();
- }
-
- @Override
- public Integer getMaxLength() {
- return returnType.getMaxLength();
- }
-
- @Override
- public Integer getPrecision() {
- return returnType.getPrecision();
- }
-
- @Override
- public Integer getScale() {
- return returnType.getScale();
- }
-
- @Override
- public boolean isCollection() {
- return returnTypeInfo.isCollection();
- }
-
-}
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/edm/EdmSingletonImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmSingletonImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmSingletonImpl.java
deleted file mode 100644
index 6d14154..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmSingletonImpl.java
+++ /dev/null
@@ -1,35 +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.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Singleton;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmSingleton;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class EdmSingletonImpl extends EdmBindingTargetImpl implements EdmSingleton {
-
- public EdmSingletonImpl(final Edm edm, final EdmEntityContainer container, final String name,
- final FullQualifiedName type, final Singleton singleton) {
-
- super(edm, container, name, type, singleton);
- }
-
-}
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/edm/EdmStructuredTypeHelperImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmStructuredTypeHelperImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmStructuredTypeHelperImpl.java
deleted file mode 100644
index 28ba1f0..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmStructuredTypeHelperImpl.java
+++ /dev/null
@@ -1,71 +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.edm;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonNavigationProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.ComplexType;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationProperty;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-import org.apache.olingo.odata4.commons.core.edm.EdmStructuredTypeHelper;
-
-public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
-
- private final Edm edm;
-
- private final ComplexType complexType;
-
- private Map<String, EdmProperty> properties;
-
- private Map<String, EdmNavigationProperty> navigationProperties;
-
- public EdmStructuredTypeHelperImpl(final Edm edm, final ComplexType complexType) {
- this.edm = edm;
- this.complexType = complexType;
- }
-
- @Override
- public Map<String, EdmProperty> getProperties() {
- if (properties == null) {
- properties = new LinkedHashMap<String, EdmProperty>();
- for (CommonProperty property : complexType.getProperties()) {
- properties.put(property.getName(), new EdmPropertyImpl(edm, property));
- }
- }
- return properties;
- }
-
- @Override
- public Map<String, EdmNavigationProperty> getNavigationProperties() {
- if (navigationProperties == null) {
- navigationProperties = new LinkedHashMap<String, EdmNavigationProperty>();
- for (CommonNavigationProperty navigationProperty : complexType.getNavigationProperties()) {
- if (navigationProperty instanceof NavigationProperty) {
- navigationProperties.put(navigationProperty.getName(),
- new EdmNavigationPropertyImpl(edm, (NavigationProperty) navigationProperty));
- }
- }
- }
- return navigationProperties;
- }
-}
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/edm/EdmTypeDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmTypeDefinitionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmTypeDefinitionImpl.java
deleted file mode 100644
index 43a5455..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmTypeDefinitionImpl.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 org.apache.olingo.odata4.client.core.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.TypeDefinition;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmTypeDefinition;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmTypeDefinition;
-import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
-
-public class EdmTypeDefinitionImpl extends AbstractEdmTypeDefinition implements EdmTypeDefinition {
-
- private TypeDefinition typeDefinition;
-
- private EdmPrimitiveType edmPrimitiveTypeInstance;
-
- public EdmTypeDefinitionImpl(final Edm edm, final FullQualifiedName typeDefinitionName,
- final TypeDefinition typeDefinition) {
-
- super(edm, typeDefinitionName);
- this.typeDefinition = typeDefinition;
- // TODO: Should we check for edmNamespace in the underlying type name?
- try {
- edmPrimitiveTypeInstance = EdmPrimitiveTypeKind.fromString(
- typeDefinition.getUnderlyingType()).getEdmPrimitiveTypeInstance();
- } catch (IllegalArgumentException e) {
- throw new EdmException("Invalid underlying type: " + typeDefinition.getUnderlyingType(), e);
- }
- }
-
- @Override
- public EdmPrimitiveType getUnderlyingType() {
- return edmPrimitiveTypeInstance;
- }
-
- @Override
- public Integer getMaxLength() {
- return typeDefinition.getMaxLength();
- }
-
- @Override
- public Integer getPrecision() {
- return typeDefinition.getPrecision();
- }
-
- @Override
- public Integer getScale() {
- return typeDefinition.getScale();
- }
-
- @Override
- public Boolean isUnicode() {
- return typeDefinition.isUnicode();
- }
-}
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/edm/v3/EdmActionImportProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmActionImportProxy.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmActionImportProxy.java
deleted file mode 100644
index ddf1b7c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmActionImportProxy.java
+++ /dev/null
@@ -1,45 +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.edm.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.client.core.edm.EdmOperationImportImpl;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-
-public class EdmActionImportProxy extends EdmOperationImportImpl implements EdmActionImport {
-
- private final FunctionImport functionImport;
-
- public EdmActionImportProxy(final Edm edm, final EdmEntityContainer container, final String name,
- final FunctionImport functionImport) {
-
- super(edm, container, name, functionImport.getEntitySet());
- this.functionImport = functionImport;
- }
-
- @Override
- public EdmAction getAction() {
- return edm.getAction(
- new EdmTypeInfo(functionImport.getName(), container.getNamespace()).getFullQualifiedName(), null, null);
- }
-}
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/edm/v3/EdmActionProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmActionProxy.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmActionProxy.java
deleted file mode 100644
index 9bb0ac7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmActionProxy.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public class EdmActionProxy extends EdmOperationProxy implements EdmAction {
-
- public static EdmActionProxy getInstance(final Edm edm, final FullQualifiedName name,
- final FunctionImport functionImport) {
-
- return EdmActionProxy.getInstance(new EdmActionProxy(edm, name, functionImport));
- }
-
- private EdmActionProxy(final Edm edm, final FullQualifiedName name, final FunctionImport functionImport) {
- super(edm, name, functionImport, EdmTypeKind.ACTION);
- }
-
-}
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/edm/v3/EdmEntitySetProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmEntitySetProxy.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmEntitySetProxy.java
deleted file mode 100644
index 518eb6e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmEntitySetProxy.java
+++ /dev/null
@@ -1,101 +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.edm.v3;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Association;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.AssociationSet;
-import org.apache.olingo.odata4.client.core.edm.xml.v3.EntityContainerImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmBindingTarget;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmBindingTarget;
-
-public class EdmEntitySetProxy extends AbstractEdmBindingTarget implements EdmEntitySet {
-
- private final XMLMetadata xmlMetadata;
-
- public EdmEntitySetProxy(final Edm edm, final EdmEntityContainer container, final String name,
- final FullQualifiedName type, final XMLMetadata xmlMetadata) {
-
- super(edm, container, name, type);
- this.xmlMetadata = xmlMetadata;
- }
-
- @Override
- public EdmBindingTarget getRelatedBindingTarget(final String path) {
- final List<AssociationSet> candidateAssociationSets = new ArrayList<AssociationSet>();
- for (Schema schema : xmlMetadata.getSchemas()) {
- for (EntityContainer _entityContainer : schema.getEntityContainers()) {
- final EntityContainerImpl entityContainer = (EntityContainerImpl) _entityContainer;
- for (AssociationSet associationSet : entityContainer.getAssociationSets()) {
- if (getName().equals(associationSet.getEnds().get(0).getEntitySet())
- || getName().equals(associationSet.getEnds().get(1).getEntitySet())) {
-
- candidateAssociationSets.add(associationSet);
- }
- }
- }
- }
- if (candidateAssociationSets.isEmpty()) {
- throw new EdmException("Cannot find any AssociationSet with first End: " + getName());
- }
-
- Schema targetSchema = null;
- String targetEntitySet = null;
- for (AssociationSet associationSet : candidateAssociationSets) {
- for (Schema schema : xmlMetadata.getSchemas()) {
- for (Association association : ((SchemaImpl) schema).getAssociations()) {
- final FullQualifiedName associationName = new FullQualifiedName(schema.getNamespace(), association.getName());
- if (associationName.getFullQualifiedNameAsString().equals(associationSet.getAssociation())
- && (path.equals(association.getEnds().get(0).getRole())
- || path.equals(association.getEnds().get(1).getRole()))) {
-
- targetSchema = schema;
- if (getName().equals(associationSet.getEnds().get(0).getEntitySet())) {
- targetEntitySet = associationSet.getEnds().get(1).getEntitySet();
- } else {
- targetEntitySet = associationSet.getEnds().get(0).getEntitySet();
- }
- }
- }
- }
- }
- if (targetSchema == null || targetEntitySet == null) {
- throw new EdmException("Cannot find Association for candidate AssociationSets and given Role");
- }
-
- final FullQualifiedName relatedFQN = new FullQualifiedName(targetSchema.getNamespace(), targetEntitySet);
- final EdmEntityContainer entityContainer = edm.getEntityContainer(relatedFQN);
- if (entityContainer == null) {
- throw new EdmException("Cannot find EntityContainer with name: " + relatedFQN);
- }
-
- return entityContainer.getEntitySet(targetEntitySet);
- }
-
-}
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/edm/v3/EdmFunctionImportProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmFunctionImportProxy.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmFunctionImportProxy.java
deleted file mode 100644
index 345dd6d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmFunctionImportProxy.java
+++ /dev/null
@@ -1,47 +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.edm.v3;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.client.core.edm.EdmOperationImportImpl;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImport;
-
-public class EdmFunctionImportProxy extends EdmOperationImportImpl implements EdmFunctionImport {
-
- private final FunctionImport functionImport;
-
- public EdmFunctionImportProxy(final Edm edm, final EdmEntityContainer container, final String name,
- final FunctionImport functionImport) {
-
- super(edm, container, name, functionImport.getEntitySet());
- this.functionImport = functionImport;
- }
-
- @Override
- public EdmFunction getFunction(final List<String> parameterNames) {
- return edm.getFunction(
- new EdmTypeInfo(functionImport.getName(), container.getNamespace()).getFullQualifiedName(),
- null, null, parameterNames);
- }
-}
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/edm/v3/EdmFunctionProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmFunctionProxy.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmFunctionProxy.java
deleted file mode 100644
index db130a5..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmFunctionProxy.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.edm.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public class EdmFunctionProxy extends EdmOperationProxy implements EdmFunction {
-
- public static EdmFunctionProxy getInstance(final Edm edm, final FullQualifiedName name,
- final FunctionImport functionImport) {
-
- return EdmFunctionProxy.getInstance(new EdmFunctionProxy(edm, name, functionImport));
- }
-
- private EdmFunctionProxy(final Edm edm, final FullQualifiedName name, final FunctionImport functionImport) {
- super(edm, name, functionImport, EdmTypeKind.FUNCTION);
- }
-
- @Override
- public boolean isComposable() {
- return functionImport.isComposable();
- }
-}
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/edm/v3/EdmOperationProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmOperationProxy.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmOperationProxy.java
deleted file mode 100644
index c81d6a9..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmOperationProxy.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.v3;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonParameter;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Parameter;
-import org.apache.olingo.odata4.client.core.edm.EdmParameterImpl;
-import org.apache.olingo.odata4.client.core.edm.EdmReturnTypeImpl;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmParameter;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmOperation;
-
-public class EdmOperationProxy extends AbstractEdmOperation {
-
- protected final FunctionImport functionImport;
-
- protected static <T extends EdmOperationProxy> T getInstance(final T instance) {
- final List<Parameter> parameters = instance.functionImport.getParameters();
- final List<EdmParameter> _parameters = new ArrayList<EdmParameter>(parameters.size());
- for (CommonParameter parameter : parameters) {
- _parameters.add(EdmParameterImpl.getInstance(instance.edm, parameter));
- }
- instance.setParameters(_parameters);
-
- instance.setEntitySetPath(instance.functionImport.getEntitySetPath());
-
- instance.setIsBound(instance.functionImport.isBindable());
-
- if (instance.functionImport.getReturnType() != null) {
- instance.setReturnType(EdmReturnTypeImpl.getInstance(instance.edm, new ReturnTypeProxy(instance.functionImport)));
- }
-
- return instance;
- }
-
- protected EdmOperationProxy(final Edm edm, final FullQualifiedName fqn, final FunctionImport functionImport,
- final EdmTypeKind kind) {
-
- super(edm, fqn, kind);
- this.functionImport = functionImport;
- }
-
-}
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/edm/v3/EdmServiceMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmServiceMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmServiceMetadataImpl.java
deleted file mode 100644
index e377d78..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/EdmServiceMetadataImpl.java
+++ /dev/null
@@ -1,97 +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.edm.v3;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.UnsupportedInV3Exception;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonFunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.core.edm.AbstractEdmServiceMetadataImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v3.XMLMetadataImpl;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImportInfo;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImportInfo;
-import org.apache.olingo.odata4.commons.api.edm.EdmSingletonInfo;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.olingo.odata4.commons.core.edm.EdmActionImportInfoImpl;
-import org.apache.olingo.odata4.commons.core.edm.EdmFunctionImportInfoImpl;
-
-public class EdmServiceMetadataImpl extends AbstractEdmServiceMetadataImpl {
-
- private static final ODataServiceVersion SERVICE_VERSION = ODataServiceVersion.V30;
-
- public EdmServiceMetadataImpl(final XMLMetadataImpl xmlMetadata) {
- super(xmlMetadata);
- }
-
- @Override
- public String getDataServiceVersion() {
- return SERVICE_VERSION.toString();
- }
-
- @Override
- public List<EdmSingletonInfo> getSingletonInfos() {
- throw new UnsupportedInV3Exception();
- }
-
- @Override
- public List<EdmFunctionImportInfo> getFunctionImportInfos() {
- synchronized (this) {
- if (functionImportInfos == null) {
- functionImportInfos = new ArrayList<EdmFunctionImportInfo>();
- for (Schema schema : xmlMetadata.getSchemas()) {
- for (EntityContainer entityContainer : schema.getEntityContainers()) {
- for (CommonFunctionImport functionImport : entityContainer.getFunctionImports()) {
- final FunctionImport _funFunctionImport = (FunctionImport) functionImport;
- if (V3FunctionImportUtils.canProxyFunction(_funFunctionImport)) {
- functionImportInfos.add(
- new EdmFunctionImportInfoImpl(entityContainer.getName(), functionImport.getName()));
- }
- }
- }
- }
- }
- return functionImportInfos;
- }
- }
-
- @Override
- public List<EdmActionImportInfo> getActionImportInfos() {
- synchronized (this) {
- if (actionImportInfos == null) {
- actionImportInfos = new ArrayList<EdmActionImportInfo>();
- for (Schema schema : xmlMetadata.getSchemas()) {
- for (EntityContainer entityContainer : schema.getEntityContainers()) {
- for (CommonFunctionImport functionImport : entityContainer.getFunctionImports()) {
- final FunctionImport _funFunctionImport = (FunctionImport) functionImport;
- if (!V3FunctionImportUtils.canProxyFunction(_funFunctionImport)) {
- actionImportInfos.add(
- new EdmActionImportInfoImpl(entityContainer.getName(), functionImport.getName()));
- }
- }
- }
- }
- }
- return actionImportInfos;
- }
- }
-
-}
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/edm/v3/ReturnTypeProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/ReturnTypeProxy.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/ReturnTypeProxy.java
deleted file mode 100644
index b212e86..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/ReturnTypeProxy.java
+++ /dev/null
@@ -1,62 +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.edm.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ReturnType;
-
-public class ReturnTypeProxy implements ReturnType {
-
- private final FunctionImport functionImport;
-
- public ReturnTypeProxy(final FunctionImport functionImport) {
- this.functionImport = functionImport;
- }
-
- @Override
- public Integer getMaxLength() {
- return null;
- }
-
- @Override
- public Integer getPrecision() {
- return null;
- }
-
- @Override
- public Integer getScale() {
- return null;
- }
-
- @Override
- public String getSrid() {
- return null;
- }
-
- @Override
- public String getType() {
- return functionImport.getReturnType();
- }
-
- @Override
- public boolean isNullable() {
- return false;
- }
-
-}
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/edm/v3/V3FunctionImportUtils.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/V3FunctionImportUtils.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/V3FunctionImportUtils.java
deleted file mode 100644
index c8d352a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v3/V3FunctionImportUtils.java
+++ /dev/null
@@ -1,36 +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.edm.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.api.http.HttpMethod;
-
-public final class V3FunctionImportUtils {
-
- public static boolean canProxyFunction(final FunctionImport functionImport) {
- return functionImport.getHttpMethod() == null
- ? !functionImport.isSideEffecting()
- : HttpMethod.GET.name().equals(functionImport.getHttpMethod());
- }
-
- private V3FunctionImportUtils() {
- // empty 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/edm/v4/EdmServiceMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmServiceMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmServiceMetadataImpl.java
deleted file mode 100644
index e077e3a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmServiceMetadataImpl.java
+++ /dev/null
@@ -1,104 +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.edm.v4;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonFunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ActionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Singleton;
-import org.apache.olingo.odata4.client.core.edm.AbstractEdmServiceMetadataImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.XMLMetadataImpl;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImportInfo;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImportInfo;
-import org.apache.olingo.odata4.commons.api.edm.EdmSingletonInfo;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.olingo.odata4.commons.core.edm.EdmActionImportInfoImpl;
-import org.apache.olingo.odata4.commons.core.edm.EdmFunctionImportInfoImpl;
-import org.apache.olingo.odata4.commons.core.edm.EdmSingletonInfoImpl;
-
-public class EdmServiceMetadataImpl extends AbstractEdmServiceMetadataImpl {
-
- private static final ODataServiceVersion SERVICE_VERSION = ODataServiceVersion.V40;
-
- private List<EdmSingletonInfo> singletonInfos;
-
- private List<EdmActionImportInfo> actionImportInfos;
-
- public EdmServiceMetadataImpl(final XMLMetadataImpl xmlMetadata) {
- super(xmlMetadata);
- }
-
- @Override
- public String getDataServiceVersion() {
- return SERVICE_VERSION.toString();
- }
-
- @Override
- public List<EdmSingletonInfo> getSingletonInfos() {
- synchronized (this) {
- if (singletonInfos == null) {
- singletonInfos = new ArrayList<EdmSingletonInfo>();
- for (Schema schema : ((XMLMetadataImpl) xmlMetadata).getSchemas()) {
- final EntityContainer entityContainer = (EntityContainer) schema.getDefaultEntityContainer();
- for (Singleton singleton : entityContainer.getSingletons()) {
- singletonInfos.add(new EdmSingletonInfoImpl(entityContainer.getName(), singleton.getName()));
- }
- }
- }
- return singletonInfos;
- }
- }
-
- @Override
- public List<EdmFunctionImportInfo> getFunctionImportInfos() {
- synchronized (this) {
- if (functionImportInfos == null) {
- functionImportInfos = new ArrayList<EdmFunctionImportInfo>();
- for (Schema schema : ((XMLMetadataImpl) xmlMetadata).getSchemas()) {
- for (EntityContainer entityContainer : schema.getEntityContainers()) {
- for (CommonFunctionImport functionImport : entityContainer.getFunctionImports()) {
- functionImportInfos.add(
- new EdmFunctionImportInfoImpl(entityContainer.getName(), functionImport.getName()));
- }
- }
- }
- }
- }
- return functionImportInfos;
- }
-
- @Override
- public List<EdmActionImportInfo> getActionImportInfos() {
- synchronized (this) {
- if (actionImportInfos == null) {
- actionImportInfos = new ArrayList<EdmActionImportInfo>();
- for (Schema schema : ((XMLMetadataImpl) xmlMetadata).getSchemas()) {
- final EntityContainer entityContainer = (EntityContainer) schema.getDefaultEntityContainer();
- for (ActionImport actionImport : entityContainer.getActionImports()) {
- actionImportInfos.add(new EdmActionImportInfoImpl(entityContainer.getName(), actionImport.getName()));
- }
- }
- }
- return actionImportInfos;
- }
- }
-}
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/edm/xml/AbstractAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractAnnotations.java
deleted file mode 100644
index 33c8ac8..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractAnnotations.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public abstract class AbstractAnnotations extends AbstractEdmItem
- implements org.apache.olingo.odata4.client.api.edm.xml.CommonAnnotations {
-
- private static final long serialVersionUID = 4926640428016042620L;
-
- @JsonProperty(value = "Target", required = true)
- private String target;
-
- @JsonProperty("Qualifier")
- private String qualifier;
-
- @Override
- public String getTarget() {
- return target;
- }
-
- public void setTarget(final String target) {
- this.target = target;
- }
-
- @Override
- public String getQualifier() {
- return qualifier;
- }
-
- public void setQualifier(final String qualifier) {
- this.qualifier = qualifier;
- }
-}
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/edm/xml/AbstractComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractComplexType.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractComplexType.java
deleted file mode 100644
index 158fb05..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractComplexType.java
+++ /dev/null
@@ -1,52 +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.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.ComplexType;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonNavigationProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonProperty;
-import org.apache.olingo.odata4.client.core.op.impl.ComplexTypeDeserializer;
-
-@JsonDeserialize(using = ComplexTypeDeserializer.class)
-public abstract class AbstractComplexType extends AbstractEdmItem implements ComplexType {
-
- private static final long serialVersionUID = -4765071294433482957L;
-
- private String name;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public CommonProperty getProperty(final String name) {
- return getOneByName(name, getProperties());
- }
-
- @Override
- public CommonNavigationProperty getNavigationProperty(final String name) {
- return getOneByName(name, getNavigationProperties());
- }
-}
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/edm/xml/AbstractDataServices.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractDataServices.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractDataServices.java
deleted file mode 100644
index e905b5f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractDataServices.java
+++ /dev/null
@@ -1,50 +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.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.DataServices;
-
-@JsonDeserialize(using = DataServicesDeserializer.class)
-public abstract class AbstractDataServices extends AbstractEdmItem implements DataServices {
-
- private static final long serialVersionUID = -9126377222393876166L;
-
- private String dataServiceVersion;
-
- private String maxDataServiceVersion;
-
- @Override
- public String getDataServiceVersion() {
- return dataServiceVersion;
- }
-
- public void setDataServiceVersion(final String version) {
- this.dataServiceVersion = version;
- }
-
- @Override
- public String getMaxDataServiceVersion() {
- return maxDataServiceVersion;
- }
-
- public void setMaxDataServiceVersion(final String version) {
- this.maxDataServiceVersion = version;
- }
-}
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/edm/xml/AbstractEdmItem.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmItem.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmItem.java
deleted file mode 100644
index eaa21cc..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmItem.java
+++ /dev/null
@@ -1,61 +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.edm.xml;
-
-import java.util.ArrayList;
-import java.util.Collection;
-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.edm.xml.Named;
-
-public abstract class AbstractEdmItem {
-
- protected <T extends Named> T getOneByName(final String name, final Collection<T> items) {
- final List<T> result = getAllByName(name, items);
- return result.isEmpty() ? null : result.get(0);
- }
-
- protected <T extends Named> List<T> getAllByName(final String name, final Collection<T> items) {
- final List<T> result = new ArrayList<T>();
- for (T type : items) {
- if (name.equals(type.getName())) {
- result.add(type);
- }
- }
- return result;
- }
-
- @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/edm/xml/AbstractEdmx.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmx.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmx.java
deleted file mode 100644
index 5a067e1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmx.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.DataServices;
-import org.apache.olingo.odata4.client.api.edm.xml.Edmx;
-
-@JsonDeserialize(using = EdmxDeserializer.class)
-public abstract class AbstractEdmx extends AbstractEdmItem implements Edmx {
-
- private static final long serialVersionUID = -5480835122183091469L;
-
- private String version;
-
- private DataServices dataServices;
-
- @Override
- public String getVersion() {
- return version;
- }
-
- public void setVersion(final String version) {
- this.version = version;
- }
-
- @Override
- public DataServices getDataServices() {
- return dataServices;
- }
-
- public void setDataServices(final DataServices dataServices) {
- this.dataServices = dataServices;
- }
-}
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/edm/xml/AbstractEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEntityContainer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEntityContainer.java
deleted file mode 100644
index 285095d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEntityContainer.java
+++ /dev/null
@@ -1,103 +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.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.EntitySet;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonFunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityContainer;
-import org.apache.olingo.odata4.client.core.op.impl.EntityContainerDeserializer;
-
-@JsonDeserialize(using = EntityContainerDeserializer.class)
-public abstract class AbstractEntityContainer extends AbstractEdmItem implements EntityContainer {
-
- private static final long serialVersionUID = 4121974387552855032L;
-
- private String name;
-
- private String _extends;
-
- private boolean lazyLoadingEnabled;
-
- private boolean defaultEntityContainer;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getExtends() {
- return _extends;
- }
-
- public void setExtends(final String _extends) {
- this._extends = _extends;
- }
-
- @Override
- public boolean isLazyLoadingEnabled() {
- return lazyLoadingEnabled;
- }
-
- public void setLazyLoadingEnabled(final boolean lazyLoadingEnabled) {
- this.lazyLoadingEnabled = lazyLoadingEnabled;
- }
-
- @Override
- public boolean isDefaultEntityContainer() {
- return defaultEntityContainer;
- }
-
- public void setDefaultEntityContainer(final boolean defaultEntityContainer) {
- this.defaultEntityContainer = defaultEntityContainer;
- }
-
- @Override
- public EntitySet getEntitySet(final String name) {
- return getOneByName(name, getEntitySets());
- }
-
- /**
- * Gets the first function import with given name.
- *
- * @param name name.
- * @return function import.
- */
- @Override
- public CommonFunctionImport getFunctionImport(final String name) {
- return getOneByName(name, getFunctionImports());
- }
-
- /**
- * Gets all function imports with given name.
- *
- * @param name name.
- * @return function imports.
- */
- @Override
- public List<? extends CommonFunctionImport> getFunctionImports(final String name) {
- return getAllByName(name, getFunctionImports());
- }
-}
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/edm/xml/AbstractEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEntitySet.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEntitySet.java
deleted file mode 100644
index eba7c81..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEntitySet.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.EntitySet;
-import org.apache.olingo.odata4.client.core.op.impl.EntitySetDeserializer;
-
-@JsonDeserialize(using = EntitySetDeserializer.class)
-public abstract class AbstractEntitySet extends AbstractEdmItem implements EntitySet {
-
- private static final long serialVersionUID = -6577263439520376420L;
-
- private String name;
-
- private String entityType;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getEntityType() {
- return entityType;
- }
-
- public void setEntityType(final String entityType) {
- this.entityType = entityType;
- }
-}
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/edm/xml/AbstractEntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEntityType.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEntityType.java
deleted file mode 100644
index e5490de..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEntityType.java
+++ /dev/null
@@ -1,86 +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.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityKey;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityType;
-import org.apache.olingo.odata4.client.core.op.impl.EntityTypeDeserializer;
-
-@JsonDeserialize(using = EntityTypeDeserializer.class)
-public abstract class AbstractEntityType extends AbstractComplexType implements EntityType {
-
- private static final long serialVersionUID = -1579462552966168139L;
-
- private boolean abstractEntityType = false;
-
- private String baseType;
-
- private boolean openType = false;
-
- private boolean hasStream = false;
-
- private EntityKeyImpl key;
-
- @Override
- public boolean isAbstractEntityType() {
- return abstractEntityType;
- }
-
- public void setAbstractEntityType(final boolean abstractEntityType) {
- this.abstractEntityType = abstractEntityType;
- }
-
- @Override
- public String getBaseType() {
- return baseType;
- }
-
- public void setBaseType(final String baseType) {
- this.baseType = baseType;
- }
-
- @Override
- public boolean isOpenType() {
- return openType;
- }
-
- public void setOpenType(final boolean openType) {
- this.openType = openType;
- }
-
- @Override
- public EntityKeyImpl getKey() {
- return key;
- }
-
- public void setKey(final EntityKey key) {
- this.key = (EntityKeyImpl) key;
- }
-
- @Override
- public boolean isHasStream() {
- return hasStream;
- }
-
- public void setHasStream(final boolean hasStream) {
- this.hasStream = hasStream;
- }
-
-}
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/edm/xml/AbstractEnumType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEnumType.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEnumType.java
deleted file mode 100644
index 49a1c66..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEnumType.java
+++ /dev/null
@@ -1,95 +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.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.EnumType;
-import org.apache.olingo.odata4.client.api.edm.xml.Member;
-import org.apache.olingo.odata4.client.core.op.impl.EnumTypeDeserializer;
-
-@JsonDeserialize(using = EnumTypeDeserializer.class)
-public abstract class AbstractEnumType extends AbstractEdmItem implements EnumType {
-
- private static final long serialVersionUID = 2688487586103418210L;
-
- private String name;
-
- private String underlyingType;
-
- private boolean flags;
-
- private final List<Member> members = new ArrayList<Member>();
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getUnderlyingType() {
- return underlyingType;
- }
-
- public void setUnderlyingType(final String underlyingType) {
- this.underlyingType = underlyingType;
- }
-
- @Override
- public boolean isFlags() {
- return flags;
- }
-
- public void setFlags(final boolean flags) {
- this.flags = flags;
- }
-
- @Override
- public Member getMember(final String name) {
- Member result = null;
- for (Member member : getMembers()) {
- if (name.equals(member.getName())) {
- result = member;
- }
- }
- return result;
- }
-
- @Override
- public Member getMember(final Integer value) {
- Member result = null;
- for (Member member : getMembers()) {
- if (value.equals(member.getValue())) {
- result = member;
- }
- }
- return result;
- }
-
- @Override
- public List<Member> getMembers() {
- return members;
- }
-
-}
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/edm/xml/AbstractMember.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractMember.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractMember.java
deleted file mode 100644
index 95c4c81..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractMember.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.Member;
-
-public abstract class AbstractMember extends AbstractEdmItem implements Member {
-
- private static final long serialVersionUID = -1852481655317148552L;
-
- @JsonProperty(value = "Name", required = true)
- private String name;
-
- @JsonProperty("Value")
- private String value;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getValue() {
- return value;
- }
-
- public void setValue(final String value) {
- this.value = value;
- }
-}
[34/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4DeserializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4DeserializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4DeserializerImpl.java
new file mode 100644
index 0000000..c2d94e1
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4DeserializerImpl.java
@@ -0,0 +1,71 @@
+/*
+ * 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.op.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.api.edm.xml.v4.XMLMetadata;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.client.api.op.ODataV4Deserializer;
+import org.apache.olingo.client.core.data.v4.JSONServiceDocumentImpl;
+import org.apache.olingo.client.core.data.v4.XMLServiceDocumentImpl;
+import org.apache.olingo.client.core.edm.xml.v4.EdmxImpl;
+import org.apache.olingo.client.core.edm.xml.v4.XMLMetadataImpl;
+import org.apache.olingo.client.core.op.impl.AbstractODataDeserializer;
+
+public class ODataV4DeserializerImpl extends AbstractODataDeserializer implements ODataV4Deserializer {
+
+ private static final long serialVersionUID = 8593081342440470415L;
+
+ public ODataV4DeserializerImpl(final ODataClient client) {
+ super(client);
+ }
+
+ @Override
+ public XMLMetadata toMetadata(final InputStream input) {
+ try {
+ return new XMLMetadataImpl(getXmlMapper().readValue(input, EdmxImpl.class));
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Could not parse as Edmx document", e);
+ }
+ }
+
+ @Override
+ public ServiceDocument toServiceDocument(final InputStream input, final ODataFormat format) {
+ try {
+ return format == ODataFormat.XML
+ ? getXmlMapper().readValue(input, XMLServiceDocumentImpl.class)
+ : getObjectMapper().readValue(input, JSONServiceDocumentImpl.class);
+ } catch (IOException e) {
+ throw new IllegalArgumentException("Could not parse Service Document", e);
+ }
+ }
+
+// @Override
+// protected JSONEntry toJSONEntry(final InputStream input) {
+// try {
+// return getObjectMapper().readValue(input, JSONEntry.class);
+// } catch (IOException e) {
+// throw new IllegalArgumentException("While deserializing JSON entry", e);
+// }
+// }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4ReaderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4ReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4ReaderImpl.java
new file mode 100644
index 0000000..c006d85
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4ReaderImpl.java
@@ -0,0 +1,48 @@
+/*
+ * 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.op.impl;
+
+import java.io.InputStream;
+
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.client.core.ODataV4ClientImpl;
+import org.apache.olingo.client.core.edm.EdmClientImpl;
+import org.apache.olingo.client.core.op.impl.AbstractODataReader;
+import org.apache.olingo.commons.api.edm.Edm;
+
+public class ODataV4ReaderImpl extends AbstractODataReader {
+
+ private static final long serialVersionUID = -2481293269536406956L;
+
+ public ODataV4ReaderImpl(final ODataV4ClientImpl client) {
+ super(client);
+ }
+
+ @Override
+ public Edm readMetadata(final InputStream input) {
+ return new EdmClientImpl(client.getDeserializer().toMetadata(input));
+ }
+
+ @Override
+ public ODataServiceDocument readServiceDocument(final InputStream input, final ODataFormat format) {
+ return ((ODataV4ClientImpl) client).getBinder().getODataServiceDocument(
+ ((ODataV4ClientImpl) client).getDeserializer().toServiceDocument(input, format));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4SerializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4SerializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4SerializerImpl.java
new file mode 100644
index 0000000..5549a45
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/ODataV4SerializerImpl.java
@@ -0,0 +1,32 @@
+/*
+ * 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.op.impl;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.core.op.impl.AbstractODataSerializer;
+
+public class ODataV4SerializerImpl extends AbstractODataSerializer {
+
+ private static final long serialVersionUID = 7587265188399685309L;
+
+ public ODataV4SerializerImpl(final ODataClient client) {
+ super(client);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/SchemaDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/SchemaDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/SchemaDeserializer.java
new file mode 100644
index 0000000..ca7eeea
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/SchemaDeserializer.java
@@ -0,0 +1,149 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractSchema;
+import org.apache.olingo.client.core.edm.xml.v3.AssociationImpl;
+import org.apache.olingo.client.core.edm.xml.v3.UsingImpl;
+import org.apache.olingo.client.core.edm.xml.v3.ValueTermImpl;
+import org.apache.olingo.client.core.edm.xml.v4.ActionImpl;
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.edm.xml.v4.FunctionImpl;
+import org.apache.olingo.client.core.edm.xml.v4.TypeDefinitionImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+@SuppressWarnings("rawtypes")
+public class SchemaDeserializer extends AbstractEdmDeserializer<AbstractSchema> {
+
+ @Override
+ protected AbstractSchema doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractSchema schema = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.SchemaImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.SchemaImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Namespace".equals(jp.getCurrentName())) {
+ schema.setNamespace(jp.nextTextValue());
+ } else if ("Alias".equals(jp.getCurrentName())) {
+ schema.setAlias(jp.nextTextValue());
+ } else if ("Using".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getUsings().add(jp.readValueAs( UsingImpl.class));
+ } else if ("Association".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getAssociations().add(jp.readValueAs( AssociationImpl.class));
+ } else if ("ComplexType".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getComplexTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ getComplexTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl.class));
+ }
+ } else if ("EntityType".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getEntityTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ getEntityTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl.class));
+ }
+ } else if ("EnumType".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getEnumTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ getEnumTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl.class));
+ }
+ } else if ("ValueTerm".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getValueTerms().add(jp.readValueAs( ValueTermImpl.class));
+ } else if ("EntityContainer".equals(jp.getCurrentName())) {
+ jp.nextToken();
+
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getEntityContainers().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl.class));
+ } else {
+ org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl entityContainer
+ = jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl.class);
+ entityContainer.setDefaultEntityContainer(true);
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ setEntityContainer(entityContainer);
+ }
+ } else if ("Annotations".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).getAnnotationsList().
+ add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.AnnotationsImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotationsList().
+ add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.AnnotationsImpl.class));
+ }
+ } else if ("Action".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getActions().
+ add(jp.readValueAs( ActionImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotations().
+ add(jp.readValueAs( AnnotationImpl.class));
+ } else if ("Function".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getFunctions().
+ add(jp.readValueAs( FunctionImpl.class));
+ } else if ("TypeDefinition".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ getTypeDefinitions().add(jp.readValueAs( TypeDefinitionImpl.class));
+ }
+ }
+ }
+
+ return schema;
+ }
+}
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/AbstractURIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/AbstractURIBuilder.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/AbstractURIBuilder.java
new file mode 100644
index 0000000..d635579
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/AbstractURIBuilder.java
@@ -0,0 +1,274 @@
+/*
+ * 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;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.uri.QueryOption;
+import org.apache.olingo.client.api.uri.SegmentType;
+import org.apache.olingo.client.api.uri.URIBuilder;
+import org.apache.olingo.client.api.uri.filter.URIFilter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractURIBuilder<UB extends URIBuilder<?>> implements URIBuilder<UB> {
+
+ private static final long serialVersionUID = -3267515371720408124L;
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(URIBuilder.class);
+
+ protected static class Segment {
+
+ private final SegmentType type;
+
+ private final String value;
+
+ public Segment(final SegmentType type, final String value) {
+ this.type = type;
+ this.value = value;
+ }
+
+ public SegmentType getType() {
+ return type;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ }
+
+ protected final List<Segment> segments = new ArrayList<Segment>();
+
+ /**
+ * Insertion-order map of query options.
+ */
+ protected final Map<String, String> queryOptions = new LinkedHashMap<String, String>();
+
+ /**
+ * Constructor.
+ *
+ * @param serviceRoot absolute URL (schema, host and port included) representing the location of the root of the data
+ * service.
+ */
+ protected AbstractURIBuilder(final String serviceRoot) {
+ segments.add(new Segment(SegmentType.SERVICEROOT, serviceRoot));
+ }
+
+ protected abstract UB getThis();
+
+ @Override
+ public UB addQueryOption(final QueryOption option, final String value) {
+ return addQueryOption(option.toString(), value);
+ }
+
+ @Override
+ public UB addQueryOption(final String option, final String value) {
+ queryOptions.put(option, value);
+ return getThis();
+ }
+
+ @Override
+ public UB appendEntitySetSegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.ENTITYSET, segmentValue));
+ return getThis();
+ }
+
+ @Override
+ public UB appendKeySegment(final Object val) {
+ final String segValue = URIUtils.escape(val);
+
+ segments.add(new Segment(SegmentType.KEY, "(" + segValue + ")"));
+ return getThis();
+ }
+
+ protected abstract String noKeysWrapper();
+
+ @Override
+ public UB appendKeySegment(final Map<String, Object> segmentValues) {
+ if (segmentValues == null || segmentValues.isEmpty()) {
+ segments.add(new Segment(SegmentType.KEY, noKeysWrapper()));
+ } else {
+ final StringBuilder keyBuilder = new StringBuilder().append('(');
+ for (Map.Entry<String, Object> entry : segmentValues.entrySet()) {
+ keyBuilder.append(entry.getKey()).append('=').append(URIUtils.escape(entry.getValue()));
+ keyBuilder.append(',');
+ }
+ keyBuilder.deleteCharAt(keyBuilder.length() - 1).append(')');
+
+ segments.add(new Segment(SegmentType.KEY, keyBuilder.toString()));
+ }
+
+ return getThis();
+ }
+
+ @Override
+ public UB appendPropertySegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.PROPERTY, segmentValue));
+ return getThis();
+
+ }
+
+ @Override
+ public UB appendNavigationSegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.NAVIGATION, segmentValue));
+ return getThis();
+ }
+
+ @Override
+ public UB appendDerivedEntityTypeSegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.DERIVED_ENTITY_TYPE, segmentValue));
+ return getThis();
+ }
+
+ @Override
+ public UB appendValueSegment() {
+ segments.add(new Segment(SegmentType.VALUE, SegmentType.VALUE.getValue()));
+ return getThis();
+ }
+
+ @Override
+ public UB appendOperationCallSegment(final String operation, final Map<String, Object> arguments) {
+ segments.add(new Segment(
+ segments.size() == 1 ? SegmentType.UNBOUND_OPERATION : SegmentType.BOUND_OPERATION, operation));
+ return appendKeySegment(arguments);
+ }
+
+ @Override
+ public UB appendMetadataSegment() {
+ segments.add(new Segment(SegmentType.METADATA, SegmentType.METADATA.getValue()));
+ return getThis();
+ }
+
+ @Override
+ public UB appendBatchSegment() {
+ segments.add(new Segment(SegmentType.BATCH, SegmentType.BATCH.getValue()));
+ return getThis();
+ }
+
+ @Override
+ public UB count() {
+ segments.add(new Segment(SegmentType.ROOT_QUERY_OPTION, "$" + QueryOption.COUNT.toString()));
+ return getThis();
+ }
+
+ @Override
+ public UB expand(final String... expandItems) {
+ return addQueryOption(QueryOption.EXPAND, StringUtils.join(expandItems, ","));
+ }
+
+ @Override
+ public UB format(final String format) {
+ return addQueryOption(QueryOption.FORMAT, format);
+ }
+
+ @Override
+ public UB filter(final URIFilter filter) {
+ return addQueryOption(QueryOption.FILTER, filter.build());
+ }
+
+ @Override
+ public UB filter(final String filter) {
+ return addQueryOption(QueryOption.FILTER, filter);
+ }
+
+ @Override
+ public UB select(final String... selectItems) {
+ return addQueryOption(QueryOption.SELECT, StringUtils.join(selectItems, ","));
+ }
+
+ @Override
+ public UB orderBy(final String order) {
+ return addQueryOption(QueryOption.ORDERBY, order);
+ }
+
+ @Override
+ public UB top(final int top) {
+ return addQueryOption(QueryOption.TOP, String.valueOf(top));
+ }
+
+ @Override
+ public UB skip(final int skip) {
+ return addQueryOption(QueryOption.SKIP, String.valueOf(skip));
+ }
+
+ @Override
+ public UB skipToken(final String skipToken) {
+ return addQueryOption(QueryOption.SKIPTOKEN, skipToken);
+ }
+
+ protected abstract char getBoundOperationSeparator();
+
+ protected abstract char getDerivedEntityTypeSeparator();
+
+ @Override
+ public URI build() {
+ final StringBuilder segmentsBuilder = new StringBuilder();
+ for (Segment seg : segments) {
+ if (segmentsBuilder.length() > 0 && seg.getType() != SegmentType.KEY) {
+ switch (seg.getType()) {
+ case BOUND_OPERATION:
+ segmentsBuilder.append(getBoundOperationSeparator());
+ break;
+
+ case DERIVED_ENTITY_TYPE:
+ segmentsBuilder.append(getDerivedEntityTypeSeparator());
+ break;
+
+ default:
+ segmentsBuilder.append('/');
+ }
+ }
+
+ if (seg.getType() == SegmentType.ENTITY) {
+ segmentsBuilder.append(seg.getType().getValue());
+ } else {
+ segmentsBuilder.append(seg.getValue());
+ }
+ }
+
+ try {
+ final org.apache.http.client.utils.URIBuilder builder =
+ new org.apache.http.client.utils.URIBuilder(segmentsBuilder.toString());
+
+ for (Map.Entry<String, String> option : queryOptions.entrySet()) {
+ builder.addParameter("$" + option.getKey(), option.getValue());
+ }
+
+ return builder.build().normalize();
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Could not build valid URI", e);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return build().toASCIIString();
+ }
+
+}
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/URIUtils.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java
new file mode 100644
index 0000000..49940eb
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java
@@ -0,0 +1,196 @@
+/*
+ * 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;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.net.URI;
+import java.net.URLEncoder;
+import java.text.DecimalFormat;
+import java.util.UUID;
+
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.io.IOUtils;
+import org.apache.http.entity.InputStreamEntity;
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.ODataConstants;
+import org.apache.olingo.client.api.domain.EdmSimpleType;
+import org.apache.olingo.client.api.domain.ODataDuration;
+import org.apache.olingo.client.api.domain.ODataTimestamp;
+import org.apache.olingo.client.api.edm.xml.CommonFunctionImport;
+import org.apache.olingo.client.api.edm.xml.EntityContainer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * URI utilities.
+ */
+public final class URIUtils {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(URIUtils.class);
+
+ private URIUtils() {
+ // Empty private constructor for static utility classes
+ }
+
+ /**
+ * Build URI starting from the given base and href.
+ * <br/>
+ * If href is absolute or base is null then base will be ignored.
+ *
+ * @param base URI prefix.
+ * @param href URI suffix.
+ * @return built URI.
+ */
+ public static URI getURI(final String base, final String href) {
+ if (href == null) {
+ throw new IllegalArgumentException("Null link provided");
+ }
+
+ URI uri = URI.create(href);
+
+ if (!uri.isAbsolute() && base != null) {
+ uri = URI.create(base + "/" + href);
+ }
+
+ return uri.normalize();
+ }
+
+ /**
+ * Build URI starting from the given base and href.
+ * <br/>
+ * If href is absolute or base is null then base will be ignored.
+ *
+ * @param base URI prefix.
+ * @param href URI suffix.
+ * @return built URI.
+ */
+ public static URI getURI(final URI base, final URI href) {
+ if (href == null) {
+ throw new IllegalArgumentException("Null link provided");
+ }
+ return getURI(base, href.toASCIIString());
+ }
+
+ /**
+ * Build URI starting from the given base and href.
+ * <br/>
+ * If href is absolute or base is null then base will be ignored.
+ *
+ * @param base URI prefix.
+ * @param href URI suffix.
+ * @return built URI.
+ */
+ public static URI getURI(final URI base, final String href) {
+ if (href == null) {
+ throw new IllegalArgumentException("Null link provided");
+ }
+
+ URI uri = URI.create(href);
+
+ if (!uri.isAbsolute() && base != null) {
+ uri = URI.create(base.toASCIIString() + "/" + href);
+ }
+
+ return uri.normalize();
+ }
+
+ /**
+ * Gets function import URI segment.
+ *
+ * @param entityContainer entity container.
+ * @param functionImport function import.
+ * @return URI segment.
+ */
+ public static String rootFunctionImportURISegment(
+ final EntityContainer entityContainer, final CommonFunctionImport functionImport) {
+
+ final StringBuilder result = new StringBuilder();
+ if (!entityContainer.isDefaultEntityContainer()) {
+ result.append(entityContainer.getName()).append('.');
+ }
+ result.append(functionImport.getName());
+
+ return result.toString();
+ }
+
+ /**
+ * Turns primitive values into their respective URI representation.
+ *
+ * @param obj primitive value
+ * @return URI representation
+ */
+ public static String escape(final Object obj) {
+ String value;
+
+ try {
+ value = (obj instanceof UUID)
+ ? "guid'" + obj.toString() + "'"
+ : (obj instanceof byte[])
+ ? "X'" + Hex.encodeHexString((byte[]) obj) + "'"
+ : ((obj instanceof ODataTimestamp) && ((ODataTimestamp) obj).getTimezone() == null)
+ ? "datetime'" + URLEncoder.encode(((ODataTimestamp) obj).toString(), ODataConstants.UTF8) + "'"
+ : ((obj instanceof ODataTimestamp) && ((ODataTimestamp) obj).getTimezone() != null)
+ ? "datetimeoffset'" + URLEncoder.encode(((ODataTimestamp) obj).toString(), ODataConstants.UTF8)
+ + "'"
+ : (obj instanceof ODataDuration)
+ ? "time'" + ((ODataDuration) obj).toString() + "'"
+ : (obj instanceof BigDecimal)
+ ? new DecimalFormat(EdmSimpleType.Decimal.pattern()).format((BigDecimal) obj) + "M"
+ : (obj instanceof Double)
+ ? new DecimalFormat(EdmSimpleType.Double.pattern()).format((Double) obj) + "D"
+ : (obj instanceof Float)
+ ? new DecimalFormat(EdmSimpleType.Single.pattern()).format((Float) obj) + "f"
+ : (obj instanceof Long)
+ ? ((Long) obj).toString() + "L"
+ : (obj instanceof String)
+ ? "'" + URLEncoder.encode((String) obj, ODataConstants.UTF8) + "'"
+ : obj.toString();
+ } catch (Exception e) {
+ LOG.warn("While escaping '{}', using toString()", obj, e);
+ value = obj.toString();
+ }
+
+ return value;
+ }
+
+ public static InputStreamEntity buildInputStreamEntity(final ODataClient client, final InputStream input) {
+ InputStreamEntity entity;
+ if (client.getConfiguration().isUseChuncked()) {
+ entity = new InputStreamEntity(input, -1);
+ } else {
+ byte[] bytes = new byte[0];
+ try {
+ bytes = IOUtils.toByteArray(input);
+ } catch (IOException e) {
+ LOG.error("While reading input for not chunked encoding", e);
+ }
+
+ entity = new InputStreamEntity(new ByteArrayInputStream(bytes), bytes.length);
+ }
+ entity.setChunked(client.getConfiguration().isUseChuncked());
+
+ return entity;
+ }
+}
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/V3URIBuilderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V3URIBuilderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V3URIBuilderImpl.java
new file mode 100644
index 0000000..8bd31ad
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V3URIBuilderImpl.java
@@ -0,0 +1,94 @@
+/*
+ * 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;
+
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.V3Configuration;
+import org.apache.olingo.client.api.uri.QueryOption;
+import org.apache.olingo.client.api.uri.SegmentType;
+import org.apache.olingo.client.api.uri.V3URIBuilder;
+
+public class V3URIBuilderImpl extends AbstractURIBuilder<V3URIBuilder> implements V3URIBuilder {
+
+ private static final long serialVersionUID = -3506851722447870532L;
+
+ private final V3Configuration configuration;
+
+ public V3URIBuilderImpl(final V3Configuration configuration, final String serviceRoot) {
+ super(serviceRoot);
+ this.configuration = configuration;
+ }
+
+ @Override
+ protected V3URIBuilder getThis() {
+ return this;
+ }
+
+ @Override
+ protected char getBoundOperationSeparator() {
+ return '/';
+ }
+
+ @Override
+ protected char getDerivedEntityTypeSeparator() {
+ return '/';
+ }
+
+ @Override
+ public V3URIBuilder appendLinksSegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.LINKS, SegmentType.LINKS.getValue()));
+ segments.add(new Segment(SegmentType.ENTITYSET, segmentValue));
+
+ return getThis();
+ }
+
+ @Override
+ protected String noKeysWrapper() {
+ return StringUtils.EMPTY;
+ }
+
+ @Override
+ public V3URIBuilder appendKeySegment(final Object val) {
+ if (configuration.isKeyAsSegment()) {
+ final String segValue = URIUtils.escape(val);
+ segments.add(new Segment(SegmentType.KEY_AS_SEGMENT, segValue));
+ } else {
+ super.appendKeySegment(val);
+ }
+
+ return getThis();
+ }
+
+ @Override
+ public V3URIBuilder appendKeySegment(final Map<String, Object> segmentValues) {
+ if (!configuration.isKeyAsSegment()) {
+ super.appendKeySegment(segmentValues);
+ }
+
+ return getThis();
+ }
+
+ @Override
+ public V3URIBuilder inlineCount(final InlineCount inlineCount) {
+ return addQueryOption(QueryOption.INLINECOUNT, inlineCount.name());
+ }
+
+}
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/V4URIBuilderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V4URIBuilderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V4URIBuilderImpl.java
new file mode 100644
index 0000000..d24df81
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V4URIBuilderImpl.java
@@ -0,0 +1,101 @@
+/*
+ * 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;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.uri.QueryOption;
+import org.apache.olingo.client.api.uri.SegmentType;
+import org.apache.olingo.client.api.uri.V4URIBuilder;
+
+public class V4URIBuilderImpl extends AbstractURIBuilder<V4URIBuilder> implements V4URIBuilder {
+
+ private static final long serialVersionUID = -3506851722447870532L;
+
+ public V4URIBuilderImpl(final String serviceRoot) {
+ super(serviceRoot);
+ }
+
+ @Override
+ protected V4URIBuilder getThis() {
+ return this;
+ }
+
+ @Override
+ protected String noKeysWrapper() {
+ return "()";
+ }
+
+ @Override
+ protected char getBoundOperationSeparator() {
+ return '.';
+ }
+
+ @Override
+ protected char getDerivedEntityTypeSeparator() {
+ return '.';
+ }
+
+ @Override
+ public V4URIBuilder appendSingletonSegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.SINGLETON, segmentValue));
+ return getThis();
+ }
+
+ @Override
+ public V4URIBuilder appendEntityIdSegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.ENTITY, null));
+ return addQueryOption(QueryOption.ID, segmentValue);
+ }
+
+ @Override
+ public V4URIBuilder appendRefSegment() {
+ segments.add(new Segment(SegmentType.REF, SegmentType.REF.getValue()));
+ return getThis();
+ }
+
+ @Override
+ public V4URIBuilder appendCrossjoinSegment(final String... segmentValues) {
+ StringBuilder segValue = new StringBuilder(SegmentType.CROSS_JOIN.getValue()).
+ append('(').append(StringUtils.join(segmentValues, ",")).append(')');
+ segments.add(new Segment(SegmentType.CROSS_JOIN, segValue.toString()));
+ return getThis();
+ }
+
+ @Override
+ public V4URIBuilder count(final boolean value) {
+ return addQueryOption(QueryOption.COUNT, Boolean.toString(value));
+ }
+
+ @Override
+ public V4URIBuilder appendAllSegment() {
+ segments.add(new Segment(SegmentType.ALL, SegmentType.ALL.getValue()));
+ return getThis();
+ }
+
+ @Override
+ public V4URIBuilder id(final String idValue) {
+ return addQueryOption(QueryOption.ID, idValue);
+ }
+
+ @Override
+ public V4URIBuilder search(final String expression) {
+ return addQueryOption(QueryOption.SEARCH, 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/AbstractComparingFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractComparingFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractComparingFilter.java
new file mode 100644
index 0000000..702128e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractComparingFilter.java
@@ -0,0 +1,45 @@
+/*
+ * 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;
+
+abstract class AbstractComparingFilter implements URIFilter {
+
+ private final FilterArg left;
+
+ private final FilterArg right;
+
+ AbstractComparingFilter(final FilterArg left, final FilterArg right) {
+ this.left = left;
+ this.right = right;
+ }
+
+ protected abstract String getOp();
+
+ @Override
+ public String build() {
+ return new StringBuilder().
+ append('(').append(left.build()).
+ append(' ').append(getOp()).append(' ').
+ append(right.build()).append(')').
+ toString();
+ }
+}
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/AbstractFilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterArgFactory.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterArgFactory.java
new file mode 100644
index 0000000..96d8fb0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterArgFactory.java
@@ -0,0 +1,178 @@
+/*
+ * 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.FilterArgFactory;
+
+/**
+ * OData filter arguments factory.
+ */
+abstract class AbstractFilterArgFactory implements FilterArgFactory {
+
+ @Override
+ public FilterArg _null() {
+ return new FilterConst("null");
+ }
+
+ @Override
+ public FilterArg property(final String propertyPath) {
+ return new FilterProperty(propertyPath);
+ }
+
+ @Override
+ public FilterArg literal(final Object value) {
+ return new FilterLiteral(value);
+ }
+
+ @Override
+ public FilterArg add(final FilterArg first, final FilterArg second) {
+ return new FilterOp("add", first, second);
+ }
+
+ @Override
+ public FilterArg sub(final FilterArg first, final FilterArg second) {
+ return new FilterOp("add", first, second);
+ }
+
+ @Override
+ public FilterArg mul(final FilterArg first, final FilterArg second) {
+ return new FilterOp("mul", first, second);
+ }
+
+ @Override
+ public FilterArg div(final FilterArg first, final FilterArg second) {
+ return new FilterOp("div", first, second);
+ }
+
+ @Override
+ public FilterArg mod(final FilterArg first, final FilterArg second) {
+ return new FilterOp("mod", first, second);
+ }
+
+ @Override
+ public FilterArg endswith(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("endswith", first, second);
+ }
+
+ @Override
+ public FilterArg startswith(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("startswith", first, second);
+ }
+
+ @Override
+ public FilterArg length(final FilterArg param) {
+ return new FilterFunction("length", param);
+ }
+
+ @Override
+ public FilterArg indexof(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("indexof", first, second);
+ }
+
+ @Override
+ public FilterArg replace(final FilterArg first, final FilterArg second, final FilterArg third) {
+ return new FilterFunction("replace", first, second, third);
+ }
+
+ @Override
+ public FilterArg substring(final FilterArg arg, final FilterArg pos) {
+ return new FilterFunction("substring", arg, pos);
+ }
+
+ @Override
+ public FilterArg substring(final FilterArg arg, final FilterArg pos, final FilterArg length) {
+ return new FilterFunction("substring", arg, pos, length);
+ }
+
+ @Override
+ public FilterArg tolower(final FilterArg param) {
+ return new FilterFunction("tolower", param);
+ }
+
+ @Override
+ public FilterArg toupper(final FilterArg param) {
+ return new FilterFunction("toupper", param);
+ }
+
+ @Override
+ public FilterArg trim(final FilterArg param) {
+ return new FilterFunction("trim", param);
+ }
+
+ @Override
+ public FilterArg concat(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("concat", first, second);
+ }
+
+ @Override
+ public FilterArg day(final FilterArg param) {
+ return new FilterFunction("day", param);
+ }
+
+ @Override
+ public FilterArg hour(final FilterArg param) {
+ return new FilterFunction("hour", param);
+ }
+
+ @Override
+ public FilterArg minute(final FilterArg param) {
+ return new FilterFunction("minute", param);
+ }
+
+ @Override
+ public FilterArg month(final FilterArg param) {
+ return new FilterFunction("month", param);
+ }
+
+ @Override
+ public FilterArg second(final FilterArg param) {
+ return new FilterFunction("second", param);
+ }
+
+ @Override
+ public FilterArg year(final FilterArg param) {
+ return new FilterFunction("year", param);
+ }
+
+ @Override
+ public FilterArg round(final FilterArg param) {
+ return new FilterFunction("round", param);
+ }
+
+ @Override
+ public FilterArg floor(final FilterArg param) {
+ return new FilterFunction("floor", param);
+ }
+
+ @Override
+ public FilterArg ceiling(final FilterArg param) {
+ return new FilterFunction("ceiling", param);
+ }
+
+ @Override
+ public FilterArg isof(final FilterArg type) {
+ return new FilterFunction("isof", type);
+ }
+
+ @Override
+ public FilterArg isof(final FilterArg expression, final FilterArg type) {
+ return new FilterFunction("isof", expression, type);
+ }
+}
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/AbstractFilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterFactory.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterFactory.java
new file mode 100644
index 0000000..b939e91
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterFactory.java
@@ -0,0 +1,108 @@
+/*
+ * 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.FilterFactory;
+import org.apache.olingo.client.api.uri.filter.URIFilter;
+
+abstract class AbstractFilterFactory implements FilterFactory {
+
+ private static final long serialVersionUID = -6141317149802621836L;
+
+ @Override
+ public URIFilter match(final FilterArg arg) {
+ return new MatchFilter(arg);
+ }
+
+ @Override
+ public URIFilter eq(final String key, final Object value) {
+ return new EqFilter(getArgFactory().property(key), getArgFactory().literal(value));
+ }
+
+ @Override
+ public URIFilter eq(final FilterArg left, final FilterArg right) {
+ return new EqFilter(left, right);
+ }
+
+ @Override
+ public URIFilter ne(final String key, final Object value) {
+ return new NeFilter(getArgFactory().property(key), getArgFactory().literal(value));
+ }
+
+ @Override
+ public URIFilter ne(final FilterArg left, final FilterArg right) {
+ return new NeFilter(left, right);
+ }
+
+ @Override
+ public URIFilter gt(final String key, final Object value) {
+ return new GtFilter(getArgFactory().property(key), getArgFactory().literal(value));
+ }
+
+ @Override
+ public URIFilter gt(final FilterArg left, final FilterArg right) {
+ return new GtFilter(left, right);
+ }
+
+ @Override
+ public URIFilter ge(final String key, final Object value) {
+ return new GeFilter(getArgFactory().property(key), getArgFactory().literal(value));
+ }
+
+ @Override
+ public URIFilter ge(final FilterArg left, final FilterArg right) {
+ return new GeFilter(left, right);
+ }
+
+ @Override
+ public URIFilter lt(final String key, final Object value) {
+ return new LtFilter(getArgFactory().property(key), getArgFactory().literal(value));
+ }
+
+ @Override
+ public URIFilter lt(final FilterArg left, final FilterArg right) {
+ return new LtFilter(left, right);
+ }
+
+ @Override
+ public URIFilter le(final String key, final Object value) {
+ return new LeFilter(getArgFactory().property(key), getArgFactory().literal(value));
+ }
+
+ @Override
+ public URIFilter le(final FilterArg left, final FilterArg right) {
+ return new LeFilter(left, right);
+ }
+
+ @Override
+ public URIFilter and(final URIFilter left, final URIFilter right) {
+ return new AndFilter(left, right);
+ }
+
+ @Override
+ public URIFilter or(final URIFilter left, final URIFilter right) {
+ return new OrFilter(left, right);
+ }
+
+ @Override
+ public URIFilter not(final URIFilter filter) {
+ return new NotFilter(filter);
+ }
+}
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/AndFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AndFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AndFilter.java
new file mode 100644
index 0000000..173ea21
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AndFilter.java
@@ -0,0 +1,42 @@
+/*
+ * 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.URIFilter;
+
+public class AndFilter implements URIFilter {
+
+ private final URIFilter left;
+
+ private final URIFilter right;
+
+ public AndFilter(final URIFilter left, final URIFilter right) {
+ this.left = left;
+ this.right = right;
+ }
+
+ @Override
+ public String build() {
+ return new StringBuilder().
+ append('(').append(left.build()).
+ append(" and ").
+ append(right.build()).append(')').
+ toString();
+ }
+}
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/EqFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/EqFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/EqFilter.java
new file mode 100644
index 0000000..7ba0f93
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/EqFilter.java
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+public class EqFilter extends AbstractComparingFilter {
+
+ EqFilter(final FilterArg left, final FilterArg right) {
+ super(left, right);
+ }
+
+ @Override
+ protected String getOp() {
+ return "eq";
+ }
+}
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/FilterConst.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterConst.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterConst.java
new file mode 100644
index 0000000..189cbdc
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterConst.java
@@ -0,0 +1,41 @@
+/*
+ * 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.FilterArgFactory;
+
+/**
+ * Filter property path; obtain instances via <tt>FilterArgFactory</tt>.
+ *
+ * @see FilterArgFactory
+ */
+public class FilterConst implements FilterArg {
+
+ private final String value;
+
+ FilterConst(final String value) {
+ this.value = value;
+ }
+
+ @Override
+ public String build() {
+ return value;
+ }
+}
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/FilterFunction.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterFunction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterFunction.java
new file mode 100644
index 0000000..47cd719
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterFunction.java
@@ -0,0 +1,48 @@
+/*
+ * 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.commons.lang3.StringUtils;
+
+public class FilterFunction implements FilterArg {
+
+ private final String function;
+
+ private final FilterArg[] params;
+
+ FilterFunction(final String function, final FilterArg... params) {
+ this.function = function;
+ this.params = params;
+ }
+
+ @Override
+ public String build() {
+ final String[] strParams = params == null || params.length == 0 ? new String[0] : new String[params.length];
+ for (int i = 0; i < strParams.length; i++) {
+ strParams[i] = params[i].build();
+ }
+
+ return new StringBuilder(function).
+ append('(').
+ append(strParams.length == 0 ? StringUtils.EMPTY : StringUtils.join(strParams, ',')).
+ append(')').
+ toString();
+ }
+}
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/FilterLambda.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLambda.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLambda.java
new file mode 100644
index 0000000..18f783a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLambda.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;
+
+public class FilterLambda implements FilterArg {
+
+ private final FilterArg collection;
+
+ private final String operator;
+
+ private final URIFilter expression;
+
+ FilterLambda(final FilterArg collection, final String operator, final URIFilter expression) {
+ this.collection = collection;
+ this.operator = operator;
+ this.expression = expression;
+ }
+
+ @Override
+ public String build() {
+ return new StringBuilder(collection.build()).
+ append('/').
+ append(operator).
+ append(expression.build()).
+ toString();
+ }
+}
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/FilterLiteral.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLiteral.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLiteral.java
new file mode 100644
index 0000000..661e613
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLiteral.java
@@ -0,0 +1,41 @@
+/*
+ * 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.core.uri.URIUtils;
+
+/**
+ * Filter value literals; obtain instances via <tt>FilterArgFactory</tt>.
+ *
+ * @see FilterArgFactory
+ */
+public class FilterLiteral implements FilterArg {
+
+ private final Object value;
+
+ FilterLiteral(final Object value) {
+ this.value = value;
+ }
+
+ @Override
+ public String build() {
+ return URIUtils.escape(value);
+ }
+}
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/FilterOp.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterOp.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterOp.java
new file mode 100644
index 0000000..5cdced7
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterOp.java
@@ -0,0 +1,45 @@
+/*
+ * 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;
+
+public class FilterOp implements FilterArg {
+
+ private final String op;
+
+ private final FilterArg first;
+
+ private final FilterArg second;
+
+ FilterOp(final String op, final FilterArg first, final FilterArg second) {
+ this.op = op;
+ this.first = first;
+ this.second = second;
+ }
+
+ @Override
+ public String build() {
+ return new StringBuilder().
+ append('(').append(first.build()).
+ append(' ').append(op).append(' ').
+ append(second.build()).append(')').
+ toString();
+ }
+}
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/FilterProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterProperty.java
new file mode 100644
index 0000000..53b2ca7
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterProperty.java
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+/**
+ * Filter property path; obtain instances via <tt>FilterArgFactory</tt>.
+ *
+ * @see FilterArgFactory
+ */
+public class FilterProperty implements FilterArg {
+
+ private final String propertyPath;
+
+ FilterProperty(final String value) {
+ this.propertyPath = value;
+ }
+
+ @Override
+ public String build() {
+ return propertyPath;
+ }
+}
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/GeFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GeFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GeFilter.java
new file mode 100644
index 0000000..439920f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GeFilter.java
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+public class GeFilter extends AbstractComparingFilter {
+
+ GeFilter(final FilterArg left, final FilterArg right) {
+ super(left, right);
+ }
+
+ @Override
+ protected String getOp() {
+ return "ge";
+ }
+}
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/GtFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GtFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GtFilter.java
new file mode 100644
index 0000000..34eb2c2
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GtFilter.java
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+public class GtFilter extends AbstractComparingFilter {
+
+ GtFilter(final FilterArg left, final FilterArg right) {
+ super(left, right);
+ }
+
+ @Override
+ protected String getOp() {
+ return "gt";
+ }
+}
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/HasFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/HasFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/HasFilter.java
new file mode 100644
index 0000000..b6029db
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/HasFilter.java
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+public class HasFilter extends AbstractComparingFilter {
+
+ HasFilter(final FilterArg left, final FilterArg right) {
+ super(left, right);
+ }
+
+ @Override
+ protected String getOp() {
+ return "has";
+ }
+
+}
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/LeFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LeFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LeFilter.java
new file mode 100644
index 0000000..36452c3
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LeFilter.java
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+public class LeFilter extends AbstractComparingFilter {
+
+ LeFilter(final FilterArg left, final FilterArg right) {
+ super(left, right);
+ }
+
+ @Override
+ protected String getOp() {
+ return "le";
+ }
+}
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/LtFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LtFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LtFilter.java
new file mode 100644
index 0000000..8dd963f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LtFilter.java
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+public class LtFilter extends AbstractComparingFilter {
+
+ LtFilter(final FilterArg left, final FilterArg right) {
+ super(left, right);
+ }
+
+ @Override
+ protected String getOp() {
+ return "lt";
+ }
+}
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/MatchFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/MatchFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/MatchFilter.java
new file mode 100644
index 0000000..0706fc1
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/MatchFilter.java
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+public class MatchFilter implements URIFilter {
+
+ private final FilterArg arg;
+
+ MatchFilter(final FilterArg arg) {
+ this.arg = arg;
+ }
+
+ @Override
+ public String build() {
+ return arg.build();
+ }
+}
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/NeFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NeFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NeFilter.java
new file mode 100644
index 0000000..c3a5849
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NeFilter.java
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+public class NeFilter extends AbstractComparingFilter {
+
+ NeFilter(final FilterArg left, final FilterArg right) {
+ super(left, right);
+ }
+
+ @Override
+ protected String getOp() {
+ return "ne";
+ }
+}
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/NotFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NotFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NotFilter.java
new file mode 100644
index 0000000..911cd66
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NotFilter.java
@@ -0,0 +1,35 @@
+/*
+ * 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.URIFilter;
+
+public class NotFilter implements URIFilter {
+
+ private final URIFilter filter;
+
+ public NotFilter(final URIFilter left) {
+ this.filter = left;
+ }
+
+ @Override
+ public String build() {
+ return new StringBuilder("not (").append(filter.build()).append(')').toString();
+ }
+}
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/OrFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/OrFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/OrFilter.java
new file mode 100644
index 0000000..31b0d4f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/OrFilter.java
@@ -0,0 +1,42 @@
+/*
+ * 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.URIFilter;
+
+public class OrFilter implements URIFilter {
+
+ private final URIFilter left;
+
+ private final URIFilter right;
+
+ public OrFilter(final URIFilter left, final URIFilter right) {
+ this.left = left;
+ this.right = right;
+ }
+
+ @Override
+ public String build() {
+ return new StringBuilder().
+ append('(').append(left.build()).
+ append(" or ").
+ append(right.build()).append(')').
+ toString();
+ }
+}
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/V3FilterArgFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterArgFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterArgFactoryImpl.java
new file mode 100644
index 0000000..e208f11
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterArgFactoryImpl.java
@@ -0,0 +1,31 @@
+/*
+ * 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.V3FilterArgFactory;
+
+public class V3FilterArgFactoryImpl extends AbstractFilterArgFactory implements V3FilterArgFactory {
+
+ @Override
+ public FilterArg substringof(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("substringof", first, second);
+ }
+
+}
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/V3FilterFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterFactoryImpl.java
new file mode 100644
index 0000000..1feb9d7
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterFactoryImpl.java
@@ -0,0 +1,33 @@
+/*
+ * 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.V3FilterArgFactory;
+import org.apache.olingo.client.api.uri.filter.V3FilterFactory;
+
+public class V3FilterFactoryImpl extends AbstractFilterFactory implements V3FilterFactory {
+
+ private static final long serialVersionUID = 1092594961118334631L;
+
+ @Override
+ public V3FilterArgFactory getArgFactory() {
+ return new V3FilterArgFactoryImpl();
+ }
+
+}
[20/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/metadata.xml
deleted file mode 100644
index 707d7d7..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/metadata.xml
+++ /dev/null
@@ -1,721 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
- <edmx:DataServices m:DataServiceVersion="3.0" m:MaxDataServiceVersion="3.0"
- xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
- <Schema Namespace="Microsoft.Test.OData.Services.AstoriaDefaultService"
- xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
- <EntityType Name="AllSpatialTypes">
- <Key>
- <PropertyRef Name="Id" />
- </Key>
- <Property Name="Id" Type="Edm.Int32" Nullable="false" />
- <Property Name="Geog" Type="Edm.Geography" SRID="Variable" />
- <Property Name="GeogPoint" Type="Edm.GeographyPoint" SRID="Variable" />
- <Property Name="GeogLine" Type="Edm.GeographyLineString" SRID="Variable" />
- <Property Name="GeogPolygon" Type="Edm.GeographyPolygon" SRID="Variable" />
- <Property Name="GeogCollection" Type="Edm.GeographyCollection" SRID="Variable" />
- <Property Name="GeogMultiPoint" Type="Edm.GeographyMultiPoint" SRID="Variable" />
- <Property Name="GeogMultiLine" Type="Edm.GeographyMultiLineString" SRID="Variable" />
- <Property Name="GeogMultiPolygon" Type="Edm.GeographyMultiPolygon" SRID="Variable" />
- <Property Name="Geom" Type="Edm.Geometry" SRID="Variable" />
- <Property Name="GeomPoint" Type="Edm.GeometryPoint" SRID="Variable" />
- <Property Name="GeomLine" Type="Edm.GeometryLineString" SRID="Variable" />
- <Property Name="GeomPolygon" Type="Edm.GeometryPolygon" SRID="Variable" />
- <Property Name="GeomCollection" Type="Edm.GeometryCollection" SRID="Variable" />
- <Property Name="GeomMultiPoint" Type="Edm.GeometryMultiPoint" SRID="Variable" />
- <Property Name="GeomMultiLine" Type="Edm.GeometryMultiLineString" SRID="Variable" />
- <Property Name="GeomMultiPolygon" Type="Edm.GeometryMultiPolygon" SRID="Variable" />
- </EntityType>
- <EntityType Name="AllSpatialCollectionTypes" Abstract="true">
- <Key>
- <PropertyRef Name="Id" />
- </Key>
- <Property Name="Id" Type="Edm.Int32" Nullable="false" />
- </EntityType>
- <EntityType Name="Customer">
- <Key>
- <PropertyRef Name="CustomerId" />
- </Key>
- <Property Name="Thumbnail" Type="Edm.Stream" Nullable="false" />
- <Property Name="Video" Type="Edm.Stream" Nullable="false" />
- <Property Name="CustomerId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" m:FC_TargetPath="SyndicationSummary" m:FC_ContentKind="text" m:FC_KeepInContent="false" />
- <Property Name="PrimaryContactInfo" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails" />
- <Property Name="BackupContactInfo" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails)" Nullable="false" />
- <Property Name="Auditing" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo" />
- <NavigationProperty Name="Orders" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Orders" ToRole="Orders" FromRole="Customer" />
- <NavigationProperty Name="Logins" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Logins" ToRole="Logins" FromRole="Customer" />
- <NavigationProperty Name="Husband" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Husband" ToRole="Husband" FromRole="Customer" />
- <NavigationProperty Name="Wife" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Wife" ToRole="Wife" FromRole="Customer" />
- <NavigationProperty Name="Info" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Info" ToRole="Info" FromRole="Customer" />
- </EntityType>
- <EntityType Name="Login">
- <Key>
- <PropertyRef Name="Username" />
- </Key>
- <Property Name="Username" Type="Edm.String" Nullable="false" />
- <Property Name="CustomerId" Type="Edm.Int32" Nullable="false" />
- <NavigationProperty Name="Customer" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Customer" ToRole="Customer" FromRole="Login" />
- <NavigationProperty Name="LastLogin" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_LastLogin" ToRole="LastLogin" FromRole="Login" />
- <NavigationProperty Name="SentMessages" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_SentMessages" ToRole="SentMessages" FromRole="Login" />
- <NavigationProperty Name="ReceivedMessages" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_ReceivedMessages" ToRole="ReceivedMessages" FromRole="Login" />
- <NavigationProperty Name="Orders" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Orders" ToRole="Orders" FromRole="Login" />
- </EntityType>
- <EntityType Name="RSAToken">
- <Key>
- <PropertyRef Name="Serial" />
- </Key>
- <Property Name="Serial" Type="Edm.String" Nullable="false" />
- <Property Name="Issued" Type="Edm.DateTime" Nullable="false" />
- <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken_Login" ToRole="Login" FromRole="RSAToken" />
- </EntityType>
- <EntityType Name="PageView">
- <Key>
- <PropertyRef Name="PageViewId" />
- </Key>
- <Property Name="PageViewId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Username" Type="Edm.String" />
- <Property Name="Viewed" Type="Edm.DateTimeOffset" Nullable="false" />
- <Property Name="TimeSpentOnPage" Type="Edm.Time" Nullable="false" />
- <Property Name="PageUrl" Type="Edm.String" />
- <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView_Login" ToRole="Login" FromRole="PageView" />
- </EntityType>
- <EntityType Name="LastLogin">
- <Key>
- <PropertyRef Name="Username" />
- </Key>
- <Property Name="Username" Type="Edm.String" Nullable="false" />
- <Property Name="LoggedIn" Type="Edm.DateTime" Nullable="false" />
- <Property Name="LoggedOut" Type="Edm.DateTime" />
- <Property Name="Duration" Type="Edm.Time" Nullable="false" />
- <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin_Login" ToRole="Login" FromRole="LastLogin" />
- </EntityType>
- <EntityType Name="Message">
- <Key>
- <PropertyRef Name="FromUsername" />
- <PropertyRef Name="MessageId" />
- </Key>
- <Property Name="MessageId" Type="Edm.Int32" Nullable="false" />
- <Property Name="FromUsername" Type="Edm.String" Nullable="false" />
- <Property Name="ToUsername" Type="Edm.String" />
- <Property Name="Sent" Type="Edm.DateTimeOffset" Nullable="false" m:FC_TargetPath="SyndicationPublished" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
- <Property Name="Subject" Type="Edm.String" m:FC_TargetPath="SyndicationTitle" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
- <Property Name="Body" Type="Edm.String" />
- <Property Name="IsRead" Type="Edm.Boolean" Nullable="false" />
- <NavigationProperty Name="Sender" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Sender" ToRole="Sender" FromRole="Message" />
- <NavigationProperty Name="Recipient" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Recipient" ToRole="Recipient" FromRole="Message" />
- <NavigationProperty Name="Attachments" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Attachments" ToRole="Attachments" FromRole="Message" />
- </EntityType>
- <EntityType Name="MessageAttachment">
- <Key>
- <PropertyRef Name="AttachmentId" />
- </Key>
- <Property Name="AttachmentId" Type="Edm.Guid" Nullable="false" />
- <Property Name="Attachment" Type="Edm.Binary" />
- </EntityType>
- <EntityType Name="Order">
- <Key>
- <PropertyRef Name="OrderId" />
- </Key>
- <Property Name="OrderId" Type="Edm.Int32" Nullable="false" />
- <Property Name="CustomerId" Type="Edm.Int32" />
- <Property Name="Concurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo" />
- <NavigationProperty Name="Customer" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Customer" ToRole="Customer" FromRole="Order" />
- <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Login" ToRole="Login" FromRole="Order" />
- </EntityType>
- <EntityType Name="OrderLine">
- <Key>
- <PropertyRef Name="OrderId" />
- <PropertyRef Name="ProductId" />
- </Key>
- <Property Name="OrderLineStream" Type="Edm.Stream" Nullable="false" />
- <Property Name="OrderId" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Quantity" Type="Edm.Int32" Nullable="false" />
- <Property Name="ConcurrencyToken" Type="Edm.String" ConcurrencyMode="Fixed" />
- <NavigationProperty Name="Order" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Order" ToRole="Order" FromRole="OrderLine" />
- <NavigationProperty Name="Product" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Product" ToRole="Product" FromRole="OrderLine" />
- </EntityType>
- <EntityType Name="Product">
- <Key>
- <PropertyRef Name="ProductId" />
- </Key>
- <Property Name="Picture" Type="Edm.Stream" Nullable="false" />
- <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Description" Type="Edm.String" />
- <Property Name="Dimensions" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions" />
- <Property Name="BaseConcurrency" Type="Edm.String" ConcurrencyMode="Fixed" />
- <Property Name="ComplexConcurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo" />
- <Property Name="NestedComplexConcurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo" />
- <NavigationProperty Name="RelatedProducts" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_RelatedProducts" ToRole="RelatedProducts" FromRole="Product" />
- <NavigationProperty Name="Detail" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Detail" ToRole="Detail" FromRole="Product" />
- <NavigationProperty Name="Reviews" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Reviews" ToRole="Reviews" FromRole="Product" />
- <NavigationProperty Name="Photos" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Photos" ToRole="Photos" FromRole="Product" />
- </EntityType>
- <EntityType Name="ProductDetail">
- <Key>
- <PropertyRef Name="ProductId" />
- </Key>
- <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Details" Type="Edm.String" />
- <NavigationProperty Name="Product" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail_Product" ToRole="Product" FromRole="ProductDetail" />
- </EntityType>
- <EntityType Name="ProductReview">
- <Key>
- <PropertyRef Name="ProductId" />
- <PropertyRef Name="ReviewId" />
- <PropertyRef Name="RevisionId" />
- </Key>
- <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
- <Property Name="ReviewId" Type="Edm.Int32" Nullable="false" />
- <Property Name="RevisionId" Type="Edm.String" Nullable="false" />
- <Property Name="Review" Type="Edm.String" />
- <NavigationProperty Name="Product" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview_Product" ToRole="Product" FromRole="ProductReview" />
- </EntityType>
- <EntityType Name="ProductPhoto">
- <Key>
- <PropertyRef Name="PhotoId" />
- <PropertyRef Name="ProductId" />
- </Key>
- <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
- <Property Name="PhotoId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Photo" Type="Edm.Binary" />
- </EntityType>
- <EntityType Name="CustomerInfo" m:HasStream="true">
- <Key>
- <PropertyRef Name="CustomerInfoId" />
- </Key>
- <Property Name="CustomerInfoId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Information" Type="Edm.String" />
- </EntityType>
- <EntityType Name="Computer">
- <Key>
- <PropertyRef Name="ComputerId" />
- </Key>
- <Property Name="ComputerId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
- <NavigationProperty Name="ComputerDetail" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer_ComputerDetail" ToRole="ComputerDetail" FromRole="Computer" />
- </EntityType>
- <EntityType Name="ComputerDetail">
- <Key>
- <PropertyRef Name="ComputerDetailId" />
- </Key>
- <Property Name="ComputerDetailId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Manufacturer" Type="Edm.String" m:FC_TargetPath="SyndicationAuthorEmail" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
- <Property Name="Model" Type="Edm.String" m:FC_TargetPath="SyndicationAuthorUri" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
- <Property Name="Serial" Type="Edm.String" />
- <Property Name="SpecificationsBag" Type="Collection(Edm.String)" Nullable="false" />
- <Property Name="PurchaseDate" Type="Edm.DateTime" Nullable="false" />
- <Property Name="Dimensions" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions" />
- <NavigationProperty Name="Computer" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail_Computer" ToRole="Computer" FromRole="ComputerDetail" />
- </EntityType>
- <EntityType Name="Driver">
- <Key>
- <PropertyRef Name="Name" />
- </Key>
- <Property Name="Name" Type="Edm.String" Nullable="false" />
- <Property Name="BirthDate" Type="Edm.DateTime" Nullable="false" />
- <NavigationProperty Name="License" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver_License" ToRole="License" FromRole="Driver" />
- </EntityType>
- <EntityType Name="License">
- <Key>
- <PropertyRef Name="Name" />
- </Key>
- <Property Name="Name" Type="Edm.String" Nullable="false" />
- <Property Name="LicenseNumber" Type="Edm.String" />
- <Property Name="LicenseClass" Type="Edm.String" m:FC_TargetPath="SyndicationContributorEmail" m:FC_ContentKind="text" m:FC_KeepInContent="false" />
- <Property Name="Restrictions" Type="Edm.String" m:FC_TargetPath="SyndicationContributorUri" m:FC_ContentKind="text" m:FC_KeepInContent="false" />
- <Property Name="ExpirationDate" Type="Edm.DateTime" Nullable="false" />
- <NavigationProperty Name="Driver" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.License_Driver" ToRole="Driver" FromRole="License" />
- </EntityType>
- <EntityType Name="MappedEntityType">
- <Key>
- <PropertyRef Name="Id" />
- </Key>
- <Property Name="Id" Type="Edm.Int32" Nullable="false" />
- <Property Name="Href" Type="Edm.String" />
- <Property Name="Title" Type="Edm.String" />
- <Property Name="HrefLang" Type="Edm.String" />
- <Property Name="Type" Type="Edm.String" />
- <Property Name="Length" Type="Edm.Int32" Nullable="false" />
- <Property Name="BagOfPrimitiveToLinks" Type="Collection(Edm.String)" Nullable="false" />
- <Property Name="Logo" Type="Edm.Binary" />
- <Property Name="BagOfDecimals" Type="Collection(Edm.Decimal)" Nullable="false" />
- <Property Name="BagOfDoubles" Type="Collection(Edm.Double)" Nullable="false" />
- <Property Name="BagOfSingles" Type="Collection(Edm.Single)" Nullable="false" />
- <Property Name="BagOfBytes" Type="Collection(Edm.Byte)" Nullable="false" />
- <Property Name="BagOfInt16s" Type="Collection(Edm.Int16)" Nullable="false" />
- <Property Name="BagOfInt32s" Type="Collection(Edm.Int32)" Nullable="false" />
- <Property Name="BagOfInt64s" Type="Collection(Edm.Int64)" Nullable="false" />
- <Property Name="BagOfGuids" Type="Collection(Edm.Guid)" Nullable="false" />
- <Property Name="BagOfDateTime" Type="Collection(Edm.DateTime)" Nullable="false" />
- <Property Name="BagOfComplexToCategories" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ComplexToCategory)" Nullable="false" />
- <Property Name="ComplexPhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" m:FC_TargetPath="SyndicationRights" m:FC_ContentKind="text" m:FC_SourcePath="PhoneNumber" m:FC_KeepInContent="true" />
- <Property Name="ComplexContactDetails" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails" m:FC_TargetPath="SyndicationSummary" m:FC_ContentKind="text" m:FC_SourcePath="WorkPhone/Extension" m:FC_KeepInContent="true" />
- </EntityType>
- <EntityType Name="Car" m:HasStream="true">
- <Key>
- <PropertyRef Name="VIN" />
- </Key>
- <Property Name="Photo" Type="Edm.Stream" Nullable="false" />
- <Property Name="Video" Type="Edm.Stream" Nullable="false" />
- <Property Name="VIN" Type="Edm.Int32" Nullable="false" />
- <Property Name="Description" Type="Edm.String" />
- </EntityType>
- <EntityType Name="Person">
- <Key>
- <PropertyRef Name="PersonId" />
- </Key>
- <Property Name="PersonId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
- <NavigationProperty Name="PersonMetadata" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Person_PersonMetadata" ToRole="PersonMetadata" FromRole="Person" />
- </EntityType>
- <EntityType Name="PersonMetadata">
- <Key>
- <PropertyRef Name="PersonMetadataId" />
- </Key>
- <Property Name="PersonMetadataId" Type="Edm.Int32" Nullable="false" />
- <Property Name="PersonId" Type="Edm.Int32" Nullable="false" />
- <Property Name="PropertyName" Type="Edm.String" />
- <Property Name="PropertyValue" Type="Edm.String" />
- <NavigationProperty Name="Person" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata_Person" ToRole="Person" FromRole="PersonMetadata" />
- </EntityType>
- <ComplexType Name="ContactDetails">
- <Property Name="EmailBag" Type="Collection(Edm.String)" Nullable="false" />
- <Property Name="AlternativeNames" Type="Collection(Edm.String)" Nullable="false" />
- <Property Name="ContactAlias" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases" />
- <Property Name="HomePhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" />
- <Property Name="WorkPhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" />
- <Property Name="MobilePhoneBag" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Phone)" Nullable="false" />
- </ComplexType>
- <ComplexType Name="AuditInfo">
- <Property Name="ModifiedDate" Type="Edm.DateTime" Nullable="false" />
- <Property Name="ModifiedBy" Type="Edm.String" />
- <Property Name="Concurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo" />
- </ComplexType>
- <ComplexType Name="ConcurrencyInfo">
- <Property Name="Token" Type="Edm.String" />
- <Property Name="QueriedDateTime" Type="Edm.DateTime" />
- </ComplexType>
- <ComplexType Name="Dimensions">
- <Property Name="Width" Type="Edm.Decimal" Nullable="false" />
- <Property Name="Height" Type="Edm.Decimal" Nullable="false" />
- <Property Name="Depth" Type="Edm.Decimal" Nullable="false" />
- </ComplexType>
- <ComplexType Name="ComplexToCategory">
- <Property Name="Term" Type="Edm.String" />
- <Property Name="Scheme" Type="Edm.String" />
- <Property Name="Label" Type="Edm.String" />
- </ComplexType>
- <ComplexType Name="Phone">
- <Property Name="PhoneNumber" Type="Edm.String" />
- <Property Name="Extension" Type="Edm.String" />
- </ComplexType>
- <ComplexType Name="Aliases">
- <Property Name="AlternativeNames" Type="Collection(Edm.String)" Nullable="false" />
- </ComplexType>
- <EntityType Name="AllSpatialCollectionTypes_Simple" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes">
- <Property Name="ManyGeogPoint" Type="Collection(Edm.GeographyPoint)" Nullable="false" SRID="Variable" />
- <Property Name="ManyGeogLine" Type="Collection(Edm.GeographyLineString)" Nullable="false" SRID="Variable" />
- <Property Name="ManyGeogPolygon" Type="Collection(Edm.GeographyPolygon)" Nullable="false" SRID="Variable" />
- <Property Name="ManyGeomPoint" Type="Collection(Edm.GeometryPoint)" Nullable="false" SRID="Variable" />
- <Property Name="ManyGeomLine" Type="Collection(Edm.GeometryLineString)" Nullable="false" SRID="Variable" />
- <Property Name="ManyGeomPolygon" Type="Collection(Edm.GeometryPolygon)" Nullable="false" SRID="Variable" />
- </EntityType>
- <EntityType Name="ProductPageView" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView">
- <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
- <Property Name="ConcurrencyToken" Type="Edm.String" ConcurrencyMode="Fixed" />
- </EntityType>
- <EntityType Name="BackOrderLine" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" />
- <EntityType Name="BackOrderLine2" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.BackOrderLine" />
- <EntityType Name="DiscontinuedProduct" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Product">
- <Property Name="Discontinued" Type="Edm.DateTime" Nullable="false" />
- <Property Name="ReplacementProductId" Type="Edm.Int32" />
- <Property Name="DiscontinuedPhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" />
- <Property Name="ChildConcurrencyToken" Type="Edm.String" ConcurrencyMode="Fixed" />
- </EntityType>
- <EntityType Name="Contractor" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Person">
- <Property Name="ContratorCompanyId" Type="Edm.Int32" Nullable="false" />
- <Property Name="BillingRate" Type="Edm.Int32" Nullable="false" />
- <Property Name="TeamContactPersonId" Type="Edm.Int32" Nullable="false" />
- <Property Name="JobDescription" Type="Edm.String" />
- </EntityType>
- <EntityType Name="Employee" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Person">
- <Property Name="ManagersPersonId" Type="Edm.Int32" Nullable="false" />
- <Property Name="Salary" Type="Edm.Int32" Nullable="false" />
- <Property Name="Title" Type="Edm.String" />
- <NavigationProperty Name="Manager" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee_Manager" ToRole="Manager" FromRole="Employee" />
- </EntityType>
- <EntityType Name="SpecialEmployee" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee">
- <Property Name="CarsVIN" Type="Edm.Int32" Nullable="false" />
- <Property Name="Bonus" Type="Edm.Int32" Nullable="false" />
- <Property Name="IsFullyVested" Type="Edm.Boolean" Nullable="false" />
- <NavigationProperty Name="Car" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee_Car" ToRole="Car" FromRole="SpecialEmployee" />
- </EntityType>
- <ComplexType Name="ComplexWithAllPrimitiveTypes">
- <Property Name="Binary" Type="Edm.Binary" />
- <Property Name="Boolean" Type="Edm.Boolean" Nullable="false" />
- <Property Name="Byte" Type="Edm.Byte" Nullable="false" />
- <Property Name="DateTime" Type="Edm.DateTime" Nullable="false" />
- <Property Name="Decimal" Type="Edm.Decimal" Nullable="false" />
- <Property Name="Double" Type="Edm.Double" Nullable="false" />
- <Property Name="Int16" Type="Edm.Int16" Nullable="false" />
- <Property Name="Int32" Type="Edm.Int32" Nullable="false" />
- <Property Name="Int64" Type="Edm.Int64" Nullable="false" />
- <Property Name="SByte" Type="Edm.SByte" Nullable="false" />
- <Property Name="String" Type="Edm.String" />
- <Property Name="Single" Type="Edm.Single" Nullable="false" />
- <Property Name="GeographyPoint" Type="Edm.GeographyPoint" SRID="Variable" />
- <Property Name="GeometryPoint" Type="Edm.GeometryPoint" SRID="Variable" />
- </ComplexType>
- <Association Name="Customer_Orders">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Orders" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
- </Association>
- <Association Name="Customer_Logins">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Logins" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
- </Association>
- <Association Name="Customer_Husband">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Husband" Multiplicity="0..1" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
- </Association>
- <Association Name="Customer_Wife">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Wife" Multiplicity="0..1" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
- </Association>
- <Association Name="Customer_Info">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo" Role="Info" Multiplicity="0..1" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
- </Association>
- <Association Name="Login_Customer">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="0..1" />
- </Association>
- <Association Name="Login_LastLogin">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin" Role="LastLogin" Multiplicity="0..1" />
- </Association>
- <Association Name="Login_SentMessages">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="SentMessages" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
- </Association>
- <Association Name="Login_ReceivedMessages">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="ReceivedMessages" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
- </Association>
- <Association Name="Login_Orders">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Orders" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
- </Association>
- <Association Name="RSAToken_Login">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken" Role="RSAToken" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
- </Association>
- <Association Name="PageView_Login">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView" Role="PageView" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
- </Association>
- <Association Name="LastLogin_Login">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin" Role="LastLogin" Multiplicity="*" />
- </Association>
- <Association Name="Message_Sender">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="Message" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Sender" Multiplicity="0..1" />
- </Association>
- <Association Name="Message_Recipient">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="Message" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Recipient" Multiplicity="0..1" />
- </Association>
- <Association Name="Message_Attachments">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.MessageAttachment" Role="Attachments" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="Message" Multiplicity="*" />
- </Association>
- <Association Name="Order_Customer">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Order" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="0..1" />
- </Association>
- <Association Name="Order_Login">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Order" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
- </Association>
- <Association Name="OrderLine_Order">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" Role="OrderLine" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Order" Multiplicity="0..1" />
- </Association>
- <Association Name="OrderLine_Product">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="0..1" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" Role="OrderLine" Multiplicity="*" />
- </Association>
- <Association Name="Product_RelatedProducts">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="RelatedProducts" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
- </Association>
- <Association Name="Product_Detail">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail" Role="Detail" Multiplicity="0..1" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
- </Association>
- <Association Name="Product_Reviews">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview" Role="Reviews" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
- </Association>
- <Association Name="Product_Photos">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPhoto" Role="Photos" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
- </Association>
- <Association Name="ProductDetail_Product">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail" Role="ProductDetail" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="0..1" />
- </Association>
- <Association Name="ProductReview_Product">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview" Role="ProductReview" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="0..1" />
- </Association>
- <Association Name="Computer_ComputerDetail">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" Role="ComputerDetail" Multiplicity="0..1" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" Role="Computer" Multiplicity="*" />
- </Association>
- <Association Name="ComputerDetail_Computer">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" Role="ComputerDetail" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" Role="Computer" Multiplicity="0..1" />
- </Association>
- <Association Name="Driver_License">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.License" Role="License" Multiplicity="0..1" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver" Role="Driver" Multiplicity="*" />
- </Association>
- <Association Name="License_Driver">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.License" Role="License" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver" Role="Driver" Multiplicity="0..1" />
- </Association>
- <Association Name="Person_PersonMetadata">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata" Role="PersonMetadata" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" Role="Person" Multiplicity="*" />
- </Association>
- <Association Name="PersonMetadata_Person">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata" Role="PersonMetadata" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" Role="Person" Multiplicity="0..1" />
- </Association>
- <Association Name="Employee_Manager">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" Role="Manager" Multiplicity="0..1" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" Role="Employee" Multiplicity="*" />
- </Association>
- <Association Name="SpecialEmployee_Car">
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee" Role="SpecialEmployee" Multiplicity="*" />
- <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" Role="Car" Multiplicity="0..1" />
- </Association>
- <EntityContainer Name="DefaultContainer" m:IsDefaultEntityContainer="true">
- <EntitySet Name="AllGeoTypesSet" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialTypes" />
- <EntitySet Name="AllGeoCollectionTypesSet" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes" />
- <EntitySet Name="Customer" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" />
- <EntitySet Name="Login" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" />
- <EntitySet Name="RSAToken" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken" />
- <EntitySet Name="PageView" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView" />
- <EntitySet Name="LastLogin" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin" />
- <EntitySet Name="Message" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" />
- <EntitySet Name="MessageAttachment" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.MessageAttachment" />
- <EntitySet Name="Order" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" />
- <EntitySet Name="OrderLine" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" />
- <EntitySet Name="Product" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" />
- <EntitySet Name="ProductDetail" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail" />
- <EntitySet Name="ProductReview" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview" />
- <EntitySet Name="ProductPhoto" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPhoto" />
- <EntitySet Name="CustomerInfo" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo" />
- <EntitySet Name="Computer" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" />
- <EntitySet Name="ComputerDetail" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" />
- <EntitySet Name="Driver" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver" />
- <EntitySet Name="License" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.License" />
- <EntitySet Name="MappedEntityType" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.MappedEntityType" />
- <EntitySet Name="Car" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" />
- <EntitySet Name="Person" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" />
- <EntitySet Name="PersonMetadata" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata" />
- <FunctionImport Name="GetPrimitiveString" ReturnType="Edm.String" m:HttpMethod="GET" />
- <FunctionImport Name="GetSpecificCustomer" ReturnType="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Customer)" EntitySet="Customer" m:HttpMethod="GET">
- <Parameter Name="Name" Type="Edm.String" />
- </FunctionImport>
- <FunctionImport Name="GetCustomerCount" ReturnType="Edm.Int32" m:HttpMethod="GET" />
- <FunctionImport Name="GetArgumentPlusOne" ReturnType="Edm.Int32" m:HttpMethod="GET">
- <Parameter Name="arg1" Type="Edm.Int32" Nullable="false" />
- </FunctionImport>
- <FunctionImport Name="EntityProjectionReturnsCollectionOfComplexTypes" ReturnType="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails)" m:HttpMethod="GET" />
- <FunctionImport Name="ResetDataSource" m:HttpMethod="POST" />
- <FunctionImport Name="InStreamErrorGetCustomer" ReturnType="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Customer)" EntitySet="Customer" m:HttpMethod="GET" />
- <FunctionImport Name="IncreaseSalaries" IsBindable="true" m:IsAlwaysBindable="true">
- <Parameter Name="employees" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Employee)" />
- <Parameter Name="n" Type="Edm.Int32" Nullable="false" />
- </FunctionImport>
- <FunctionImport Name="Sack" IsBindable="true" m:IsAlwaysBindable="true">
- <Parameter Name="employee" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" />
- </FunctionImport>
- <FunctionImport Name="GetComputer" ReturnType="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" IsBindable="true" EntitySet="Computer" m:IsAlwaysBindable="true">
- <Parameter Name="computer" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" />
- </FunctionImport>
- <FunctionImport Name="ChangeProductDimensions" IsBindable="true" m:IsAlwaysBindable="true">
- <Parameter Name="product" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" />
- <Parameter Name="dimensions" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions" />
- </FunctionImport>
- <FunctionImport Name="ResetComputerDetailsSpecifications" IsBindable="true" m:IsAlwaysBindable="true">
- <Parameter Name="computerDetail" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" />
- <Parameter Name="specifications" Type="Collection(Edm.String)" Nullable="false" />
- <Parameter Name="purchaseTime" Type="Edm.DateTime" Nullable="false" />
- </FunctionImport>
- <AssociationSet Name="Customer_Orders" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Orders">
- <End Role="Customer" EntitySet="Customer" />
- <End Role="Orders" EntitySet="Order" />
- </AssociationSet>
- <AssociationSet Name="Customer_Logins" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Logins">
- <End Role="Customer" EntitySet="Customer" />
- <End Role="Logins" EntitySet="Login" />
- </AssociationSet>
- <AssociationSet Name="Customer_Husband" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Husband">
- <End Role="Customer" EntitySet="Customer" />
- <End Role="Husband" EntitySet="Customer" />
- </AssociationSet>
- <AssociationSet Name="Customer_Wife" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Wife">
- <End Role="Customer" EntitySet="Customer" />
- <End Role="Wife" EntitySet="Customer" />
- </AssociationSet>
- <AssociationSet Name="Customer_Info" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Info">
- <End Role="Customer" EntitySet="Customer" />
- <End Role="Info" EntitySet="CustomerInfo" />
- </AssociationSet>
- <AssociationSet Name="Login_Customer" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Customer">
- <End Role="Login" EntitySet="Login" />
- <End Role="Customer" EntitySet="Customer" />
- </AssociationSet>
- <AssociationSet Name="Login_LastLogin" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_LastLogin">
- <End Role="Login" EntitySet="Login" />
- <End Role="LastLogin" EntitySet="LastLogin" />
- </AssociationSet>
- <AssociationSet Name="Login_SentMessages" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_SentMessages">
- <End Role="Login" EntitySet="Login" />
- <End Role="SentMessages" EntitySet="Message" />
- </AssociationSet>
- <AssociationSet Name="Login_ReceivedMessages" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_ReceivedMessages">
- <End Role="Login" EntitySet="Login" />
- <End Role="ReceivedMessages" EntitySet="Message" />
- </AssociationSet>
- <AssociationSet Name="Login_Orders" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Orders">
- <End Role="Login" EntitySet="Login" />
- <End Role="Orders" EntitySet="Order" />
- </AssociationSet>
- <AssociationSet Name="RSAToken_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken_Login">
- <End Role="RSAToken" EntitySet="RSAToken" />
- <End Role="Login" EntitySet="Login" />
- </AssociationSet>
- <AssociationSet Name="PageView_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView_Login">
- <End Role="PageView" EntitySet="PageView" />
- <End Role="Login" EntitySet="Login" />
- </AssociationSet>
- <AssociationSet Name="LastLogin_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin_Login">
- <End Role="LastLogin" EntitySet="LastLogin" />
- <End Role="Login" EntitySet="Login" />
- </AssociationSet>
- <AssociationSet Name="Message_Sender" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Sender">
- <End Role="Message" EntitySet="Message" />
- <End Role="Sender" EntitySet="Login" />
- </AssociationSet>
- <AssociationSet Name="Message_Recipient" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Recipient">
- <End Role="Message" EntitySet="Message" />
- <End Role="Recipient" EntitySet="Login" />
- </AssociationSet>
- <AssociationSet Name="Message_Attachments" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Attachments">
- <End Role="Message" EntitySet="Message" />
- <End Role="Attachments" EntitySet="MessageAttachment" />
- </AssociationSet>
- <AssociationSet Name="Order_Customer" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Customer">
- <End Role="Order" EntitySet="Order" />
- <End Role="Customer" EntitySet="Customer" />
- </AssociationSet>
- <AssociationSet Name="Order_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Login">
- <End Role="Order" EntitySet="Order" />
- <End Role="Login" EntitySet="Login" />
- </AssociationSet>
- <AssociationSet Name="OrderLine_Order" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Order">
- <End Role="OrderLine" EntitySet="OrderLine" />
- <End Role="Order" EntitySet="Order" />
- </AssociationSet>
- <AssociationSet Name="OrderLine_Product" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Product">
- <End Role="OrderLine" EntitySet="OrderLine" />
- <End Role="Product" EntitySet="Product" />
- </AssociationSet>
- <AssociationSet Name="Product_RelatedProducts" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_RelatedProducts">
- <End Role="Product" EntitySet="Product" />
- <End Role="RelatedProducts" EntitySet="Product" />
- </AssociationSet>
- <AssociationSet Name="Product_Detail" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Detail">
- <End Role="Product" EntitySet="Product" />
- <End Role="Detail" EntitySet="ProductDetail" />
- </AssociationSet>
- <AssociationSet Name="Product_Reviews" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Reviews">
- <End Role="Product" EntitySet="Product" />
- <End Role="Reviews" EntitySet="ProductReview" />
- </AssociationSet>
- <AssociationSet Name="Product_Photos" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Photos">
- <End Role="Product" EntitySet="Product" />
- <End Role="Photos" EntitySet="ProductPhoto" />
- </AssociationSet>
- <AssociationSet Name="ProductDetail_Product" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail_Product">
- <End Role="ProductDetail" EntitySet="ProductDetail" />
- <End Role="Product" EntitySet="Product" />
- </AssociationSet>
- <AssociationSet Name="ProductReview_Product" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview_Product">
- <End Role="ProductReview" EntitySet="ProductReview" />
- <End Role="Product" EntitySet="Product" />
- </AssociationSet>
- <AssociationSet Name="Computer_ComputerDetail" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer_ComputerDetail">
- <End Role="Computer" EntitySet="Computer" />
- <End Role="ComputerDetail" EntitySet="ComputerDetail" />
- </AssociationSet>
- <AssociationSet Name="ComputerDetail_Computer" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail_Computer">
- <End Role="ComputerDetail" EntitySet="ComputerDetail" />
- <End Role="Computer" EntitySet="Computer" />
- </AssociationSet>
- <AssociationSet Name="Driver_License" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver_License">
- <End Role="Driver" EntitySet="Driver" />
- <End Role="License" EntitySet="License" />
- </AssociationSet>
- <AssociationSet Name="License_Driver" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.License_Driver">
- <End Role="License" EntitySet="License" />
- <End Role="Driver" EntitySet="Driver" />
- </AssociationSet>
- <AssociationSet Name="Employee_Manager" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee_Manager">
- <End Role="Employee" EntitySet="Person" />
- <End Role="Manager" EntitySet="Person" />
- </AssociationSet>
- <AssociationSet Name="SpecialEmployee_Car" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee_Car">
- <End Role="SpecialEmployee" EntitySet="Person" />
- <End Role="Car" EntitySet="Car" />
- </AssociationSet>
- <AssociationSet Name="Person_PersonMetadata" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Person_PersonMetadata">
- <End Role="Person" EntitySet="Person" />
- <End Role="PersonMetadata" EntitySet="PersonMetadata" />
- </AssociationSet>
- <AssociationSet Name="PersonMetadata_Person" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata_Person">
- <End Role="PersonMetadata" EntitySet="PersonMetadata" />
- <End Role="Person" EntitySet="Person" />
- </AssociationSet>
- </EntityContainer>
- </Schema>
- </edmx:DataServices>
-</edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/northwind-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/northwind-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/northwind-metadata.xml
deleted file mode 100644
index 0a14f0a..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/northwind-metadata.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"><edmx:DataServices m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><Schema Namespace="NorthwindModel" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityType Name="Category"><Key><PropertyRef Name="CategoryID" /></Key><Property Name="CategoryID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Description" Type="Edm.String" MaxLength="Max" FixedLength="false" Unicode="true" /><Property Name="Picture" Type="Edm.Binary" MaxLength="Max" FixedLength="false" /><NavigationProperty Name="Products" Relationship="NorthwindModel.FK_Products_Categories" ToRole="Products" FromRole="Categories" /></Entity
Type><EntityType Name="CustomerDemographic"><Key><PropertyRef Name="CustomerTypeID" /></Key><Property Name="CustomerTypeID" Type="Edm.String" Nullable="false" MaxLength="10" FixedLength="true" Unicode="true" /><Property Name="CustomerDesc" Type="Edm.String" MaxLength="Max" FixedLength="false" Unicode="true" /><NavigationProperty Name="Customers" Relationship="NorthwindModel.CustomerCustomerDemo" ToRole="Customers" FromRole="CustomerDemographics" /></EntityType><EntityType Name="Customer"><Key><PropertyRef Name="CustomerID" /></Key><Property Name="CustomerID" Type="Edm.String" Nullable="false" MaxLength="5" FixedLength="true" Unicode="true" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ContactName" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="ContactTitle" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="Address" Type="E
dm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Phone" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><Property Name="Fax" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><NavigationProperty Name="Orders" Relationship="NorthwindModel.FK_Orders_Customers" ToRole="Orders" FromRole="Customers" /><NavigationProperty Name="CustomerDemographics" Relationship="NorthwindModel.CustomerCustomerDemo" ToRole="CustomerDemographics" FromRole="Customers" /></EntityType><EntityType Name="Employee"><Key><PropertyRef Name="EmployeeID" /></Key><Property N
ame="EmployeeID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="LastName" Type="Edm.String" Nullable="false" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="FirstName" Type="Edm.String" Nullable="false" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Title" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="TitleOfCourtesy" Type="Edm.String" MaxLength="25" FixedLength="false" Unicode="true" /><Property Name="BirthDate" Type="Edm.DateTime" /><Property Name="HireDate" Type="Edm.DateTime" /><Property Name="Address" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.St
ring" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="HomePhone" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><Property Name="Extension" Type="Edm.String" MaxLength="4" FixedLength="false" Unicode="true" /><Property Name="Photo" Type="Edm.Binary" MaxLength="Max" FixedLength="false" /><Property Name="Notes" Type="Edm.String" MaxLength="Max" FixedLength="false" Unicode="true" /><Property Name="ReportsTo" Type="Edm.Int32" /><Property Name="PhotoPath" Type="Edm.String" MaxLength="255" FixedLength="false" Unicode="true" /><NavigationProperty Name="Employees1" Relationship="NorthwindModel.FK_Employees_Employees" ToRole="Employees1" FromRole="Employees" /><NavigationProperty Name="Employee1" Relationship="NorthwindModel.FK_Employees_Employees" ToRole="Employees" FromRole="Employees1" /><NavigationProperty Name="Orders" Relationship="NorthwindModel.FK_O
rders_Employees" ToRole="Orders" FromRole="Employees" /><NavigationProperty Name="Territories" Relationship="NorthwindModel.EmployeeTerritories" ToRole="Territories" FromRole="Employees" /></EntityType><EntityType Name="Order_Detail"><Key><PropertyRef Name="OrderID" /><PropertyRef Name="ProductID" /></Key><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductID" Type="Edm.Int32" Nullable="false" /><Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" /><Property Name="Quantity" Type="Edm.Int16" Nullable="false" /><Property Name="Discount" Type="Edm.Single" Nullable="false" /><NavigationProperty Name="Order" Relationship="NorthwindModel.FK_Order_Details_Orders" ToRole="Orders" FromRole="Order_Details" /><NavigationProperty Name="Product" Relationship="NorthwindModel.FK_Order_Details_Products" ToRole="Products" FromRole="Order_Details" /></EntityType><EntityType Name="Order"><Key><PropertyRef Name="OrderID" /></Key><Prope
rty Name="OrderID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="CustomerID" Type="Edm.String" MaxLength="5" FixedLength="true" Unicode="true" /><Property Name="EmployeeID" Type="Edm.Int32" /><Property Name="OrderDate" Type="Edm.DateTime" /><Property Name="RequiredDate" Type="Edm.DateTime" /><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="ShipVia" Type="Edm.Int32" /><Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="ShipName" Type="Edm.String" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ShipAddress" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="ShipCity" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipRegion" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipPostalCode" Type="Ed
m.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="ShipCountry" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><NavigationProperty Name="Customer" Relationship="NorthwindModel.FK_Orders_Customers" ToRole="Customers" FromRole="Orders" /><NavigationProperty Name="Employee" Relationship="NorthwindModel.FK_Orders_Employees" ToRole="Employees" FromRole="Orders" /><NavigationProperty Name="Order_Details" Relationship="NorthwindModel.FK_Order_Details_Orders" ToRole="Order_Details" FromRole="Orders" /><NavigationProperty Name="Shipper" Relationship="NorthwindModel.FK_Orders_Shippers" ToRole="Shippers" FromRole="Orders" /></EntityType><EntityType Name="Product"><Key><PropertyRef Name="ProductID" /></Key><Property Name="ProductID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40
" FixedLength="false" Unicode="true" /><Property Name="SupplierID" Type="Edm.Int32" /><Property Name="CategoryID" Type="Edm.Int32" /><Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="UnitsInStock" Type="Edm.Int16" /><Property Name="UnitsOnOrder" Type="Edm.Int16" /><Property Name="ReorderLevel" Type="Edm.Int16" /><Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" /><NavigationProperty Name="Category" Relationship="NorthwindModel.FK_Products_Categories" ToRole="Categories" FromRole="Products" /><NavigationProperty Name="Order_Details" Relationship="NorthwindModel.FK_Order_Details_Products" ToRole="Order_Details" FromRole="Products" /><NavigationProperty Name="Supplier" Relationship="NorthwindModel.FK_Products_Suppliers" ToRole="Suppliers" FromRole="Products" /></EntityType><EntityType Name="Region"><Key><PropertyRef Name="RegionID
" /></Key><Property Name="RegionID" Type="Edm.Int32" Nullable="false" /><Property Name="RegionDescription" Type="Edm.String" Nullable="false" MaxLength="50" FixedLength="true" Unicode="true" /><NavigationProperty Name="Territories" Relationship="NorthwindModel.FK_Territories_Region" ToRole="Territories" FromRole="Region" /></EntityType><EntityType Name="Shipper"><Key><PropertyRef Name="ShipperID" /></Key><Property Name="ShipperID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="Phone" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><NavigationProperty Name="Orders" Relationship="NorthwindModel.FK_Orders_Shippers" ToRole="Orders" FromRole="Shippers" /></EntityType><EntityType Name="Supplier"><Key><PropertyRef Name="SupplierID" /></Key><Propert
y Name="SupplierID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ContactName" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="ContactTitle" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="Address" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Phone" Type="Edm.String" MaxLengt
h="24" FixedLength="false" Unicode="true" /><Property Name="Fax" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><Property Name="HomePage" Type="Edm.String" MaxLength="Max" FixedLength="false" Unicode="true" /><NavigationProperty Name="Products" Relationship="NorthwindModel.FK_Products_Suppliers" ToRole="Products" FromRole="Suppliers" /></EntityType><EntityType Name="Territory"><Key><PropertyRef Name="TerritoryID" /></Key><Property Name="TerritoryID" Type="Edm.String" Nullable="false" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="TerritoryDescription" Type="Edm.String" Nullable="false" MaxLength="50" FixedLength="true" Unicode="true" /><Property Name="RegionID" Type="Edm.Int32" Nullable="false" /><NavigationProperty Name="Region" Relationship="NorthwindModel.FK_Territories_Region" ToRole="Region" FromRole="Territories" /><NavigationProperty Name="Employees" Relationship="NorthwindModel.EmployeeTerritories" ToRole="Employees" FromRole="Terr
itories" /></EntityType><EntityType Name="Alphabetical_list_of_product"><Key><PropertyRef Name="CategoryName" /><PropertyRef Name="Discontinued" /><PropertyRef Name="ProductID" /><PropertyRef Name="ProductName" /></Key><Property Name="ProductID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="SupplierID" Type="Edm.Int32" /><Property Name="CategoryID" Type="Edm.Int32" /><Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="UnitsInStock" Type="Edm.Int16" /><Property Name="UnitsOnOrder" Type="Edm.Int16" /><Property Name="ReorderLevel" Type="Edm.Int16" /><Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" /><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true"
/></EntityType><EntityType Name="Category_Sales_for_1997"><Key><PropertyRef Name="CategoryName" /></Key><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="CategorySales" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Current_Product_List"><Key><PropertyRef Name="ProductID" /><PropertyRef Name="ProductName" /></Key><Property Name="ProductID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /></EntityType><EntityType Name="Customer_and_Suppliers_by_City"><Key><PropertyRef Name="CompanyName" /><PropertyRef Name="Relationship" /></Key><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="CompanyName" Type="Edm.String" Null
able="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ContactName" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="Relationship" Type="Edm.String" Nullable="false" MaxLength="9" FixedLength="false" Unicode="false" /></EntityType><EntityType Name="Invoice"><Key><PropertyRef Name="CustomerName" /><PropertyRef Name="Discount" /><PropertyRef Name="OrderID" /><PropertyRef Name="ProductID" /><PropertyRef Name="ProductName" /><PropertyRef Name="Quantity" /><PropertyRef Name="Salesperson" /><PropertyRef Name="ShipperName" /><PropertyRef Name="UnitPrice" /></Key><Property Name="ShipName" Type="Edm.String" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ShipAddress" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="ShipCity" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipRegion" Type="Edm.String" MaxLength="15" FixedLength="false"
Unicode="true" /><Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="ShipCountry" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="CustomerID" Type="Edm.String" MaxLength="5" FixedLength="true" Unicode="true" /><Property Name="CustomerName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="Address" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Salesperson" Type="Edm.String" Nullable="false" MaxLength="31" FixedLength="
false" Unicode="true" /><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="OrderDate" Type="Edm.DateTime" /><Property Name="RequiredDate" Type="Edm.DateTime" /><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="ShipperName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ProductID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" /><Property Name="Quantity" Type="Edm.Int16" Nullable="false" /><Property Name="Discount" Type="Edm.Single" Nullable="false" /><Property Name="ExtendedPrice" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Order_Details_Extended"><Key><PropertyRef Name="Discount" /><PropertyRe
f Name="OrderID" /><PropertyRef Name="ProductID" /><PropertyRef Name="ProductName" /><PropertyRef Name="Quantity" /><PropertyRef Name="UnitPrice" /></Key><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" /><Property Name="Quantity" Type="Edm.Int16" Nullable="false" /><Property Name="Discount" Type="Edm.Single" Nullable="false" /><Property Name="ExtendedPrice" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Order_Subtotal"><Key><PropertyRef Name="OrderID" /></Key><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Orders_Qry"><Key><PropertyRef Name="CompanyName" /><Propert
yRef Name="OrderID" /></Key><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="CustomerID" Type="Edm.String" MaxLength="5" FixedLength="true" Unicode="true" /><Property Name="EmployeeID" Type="Edm.Int32" /><Property Name="OrderDate" Type="Edm.DateTime" /><Property Name="RequiredDate" Type="Edm.DateTime" /><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="ShipVia" Type="Edm.Int32" /><Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="ShipName" Type="Edm.String" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ShipAddress" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="ShipCity" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipRegion" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Proper
ty Name="ShipCountry" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="Address" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /></EntityType><EntityType Name="Product_Sales_for_1997"><Key><PropertyRef Name="CategoryName" /><PropertyRef Name="ProductName" /></Key><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ProductName" Type="Edm.String" Nullable="false"
MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ProductSales" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Products_Above_Average_Price"><Key><PropertyRef Name="ProductName" /></Key><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Products_by_Category"><Key><PropertyRef Name="CategoryName" /><PropertyRef Name="Discontinued" /><PropertyRef Name="ProductName" /></Key><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="UnitsInStock" Type="Edm.Int16" /><Property Name="Disc
ontinued" Type="Edm.Boolean" Nullable="false" /></EntityType><EntityType Name="Sales_by_Category"><Key><PropertyRef Name="CategoryID" /><PropertyRef Name="CategoryName" /><PropertyRef Name="ProductName" /></Key><Property Name="CategoryID" Type="Edm.Int32" Nullable="false" /><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ProductSales" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Sales_Totals_by_Amount"><Key><PropertyRef Name="CompanyName" /><PropertyRef Name="OrderID" /></Key><Property Name="SaleAmount" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ShippedDate" Typ
e="Edm.DateTime" /></EntityType><EntityType Name="Summary_of_Sales_by_Quarter"><Key><PropertyRef Name="OrderID" /></Key><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Summary_of_Sales_by_Year"><Key><PropertyRef Name="OrderID" /></Key><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><Association Name="FK_Products_Categories"><End Type="NorthwindModel.Category" Role="Categories" Multiplicity="0..1" /><End Type="NorthwindModel.Product" Role="Products" Multiplicity="*" /><ReferentialConstraint><Principal Role="Categories"><PropertyRef Name="CategoryID" /></Principal><Dependent Role="Products"><PropertyRef Name="CategoryID" /></Dependent></ReferentialConstraint></Association><A
ssociation Name="CustomerCustomerDemo"><End Type="NorthwindModel.Customer" Role="Customers" Multiplicity="*" /><End Type="NorthwindModel.CustomerDemographic" Role="CustomerDemographics" Multiplicity="*" /></Association><Association Name="FK_Orders_Customers"><End Type="NorthwindModel.Customer" Role="Customers" Multiplicity="0..1" /><End Type="NorthwindModel.Order" Role="Orders" Multiplicity="*" /><ReferentialConstraint><Principal Role="Customers"><PropertyRef Name="CustomerID" /></Principal><Dependent Role="Orders"><PropertyRef Name="CustomerID" /></Dependent></ReferentialConstraint></Association><Association Name="FK_Employees_Employees"><End Type="NorthwindModel.Employee" Role="Employees" Multiplicity="0..1" /><End Type="NorthwindModel.Employee" Role="Employees1" Multiplicity="*" /><ReferentialConstraint><Principal Role="Employees"><PropertyRef Name="EmployeeID" /></Principal><Dependent Role="Employees1"><PropertyRef Name="ReportsTo" /></Dependent></ReferentialConstraint></Associa
tion><Association Name="FK_Orders_Employees"><End Type="NorthwindModel.Employee" Role="Employees" Multiplicity="0..1" /><End Type="NorthwindModel.Order" Role="Orders" Multiplicity="*" /><ReferentialConstraint><Principal Role="Employees"><PropertyRef Name="EmployeeID" /></Principal><Dependent Role="Orders"><PropertyRef Name="EmployeeID" /></Dependent></ReferentialConstraint></Association><Association Name="EmployeeTerritories"><End Type="NorthwindModel.Territory" Role="Territories" Multiplicity="*" /><End Type="NorthwindModel.Employee" Role="Employees" Multiplicity="*" /></Association><Association Name="FK_Order_Details_Orders"><End Type="NorthwindModel.Order" Role="Orders" Multiplicity="1" /><End Type="NorthwindModel.Order_Detail" Role="Order_Details" Multiplicity="*" /><ReferentialConstraint><Principal Role="Orders"><PropertyRef Name="OrderID" /></Principal><Dependent Role="Order_Details"><PropertyRef Name="OrderID" /></Dependent></ReferentialConstraint></Association><Association N
ame="FK_Order_Details_Products"><End Type="NorthwindModel.Product" Role="Products" Multiplicity="1" /><End Type="NorthwindModel.Order_Detail" Role="Order_Details" Multiplicity="*" /><ReferentialConstraint><Principal Role="Products"><PropertyRef Name="ProductID" /></Principal><Dependent Role="Order_Details"><PropertyRef Name="ProductID" /></Dependent></ReferentialConstraint></Association><Association Name="FK_Orders_Shippers"><End Type="NorthwindModel.Shipper" Role="Shippers" Multiplicity="0..1" /><End Type="NorthwindModel.Order" Role="Orders" Multiplicity="*" /><ReferentialConstraint><Principal Role="Shippers"><PropertyRef Name="ShipperID" /></Principal><Dependent Role="Orders"><PropertyRef Name="ShipVia" /></Dependent></ReferentialConstraint></Association><Association Name="FK_Products_Suppliers"><End Type="NorthwindModel.Supplier" Role="Suppliers" Multiplicity="0..1" /><End Type="NorthwindModel.Product" Role="Products" Multiplicity="*" /><ReferentialConstraint><Principal Role="Sup
pliers"><PropertyRef Name="SupplierID" /></Principal><Dependent Role="Products"><PropertyRef Name="SupplierID" /></Dependent></ReferentialConstraint></Association><Association Name="FK_Territories_Region"><End Type="NorthwindModel.Region" Role="Region" Multiplicity="1" /><End Type="NorthwindModel.Territory" Role="Territories" Multiplicity="*" /><ReferentialConstraint><Principal Role="Region"><PropertyRef Name="RegionID" /></Principal><Dependent Role="Territories"><PropertyRef Name="RegionID" /></Dependent></ReferentialConstraint></Association></Schema><Schema Namespace="ODataWebV3.Northwind.Model" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityContainer Name="NorthwindEntities" m:IsDefaultEntityContainer="true" p6:LazyLoadingEnabled="true" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"><EntitySet Name="Categories" EntityType="NorthwindModel.Category" /><EntitySet Name="CustomerDemographics" EntityType="NorthwindModel.CustomerDemographic" /><EntitySet
Name="Customers" EntityType="NorthwindModel.Customer" /><EntitySet Name="Employees" EntityType="NorthwindModel.Employee" /><EntitySet Name="Order_Details" EntityType="NorthwindModel.Order_Detail" /><EntitySet Name="Orders" EntityType="NorthwindModel.Order" /><EntitySet Name="Products" EntityType="NorthwindModel.Product" /><EntitySet Name="Regions" EntityType="NorthwindModel.Region" /><EntitySet Name="Shippers" EntityType="NorthwindModel.Shipper" /><EntitySet Name="Suppliers" EntityType="NorthwindModel.Supplier" /><EntitySet Name="Territories" EntityType="NorthwindModel.Territory" /><EntitySet Name="Alphabetical_list_of_products" EntityType="NorthwindModel.Alphabetical_list_of_product" /><EntitySet Name="Category_Sales_for_1997" EntityType="NorthwindModel.Category_Sales_for_1997" /><EntitySet Name="Current_Product_Lists" EntityType="NorthwindModel.Current_Product_List" /><EntitySet Name="Customer_and_Suppliers_by_Cities" EntityType="NorthwindModel.Customer_and_Suppliers_by_City" /><
EntitySet Name="Invoices" EntityType="NorthwindModel.Invoice" /><EntitySet Name="Order_Details_Extendeds" EntityType="NorthwindModel.Order_Details_Extended" /><EntitySet Name="Order_Subtotals" EntityType="NorthwindModel.Order_Subtotal" /><EntitySet Name="Orders_Qries" EntityType="NorthwindModel.Orders_Qry" /><EntitySet Name="Product_Sales_for_1997" EntityType="NorthwindModel.Product_Sales_for_1997" /><EntitySet Name="Products_Above_Average_Prices" EntityType="NorthwindModel.Products_Above_Average_Price" /><EntitySet Name="Products_by_Categories" EntityType="NorthwindModel.Products_by_Category" /><EntitySet Name="Sales_by_Categories" EntityType="NorthwindModel.Sales_by_Category" /><EntitySet Name="Sales_Totals_by_Amounts" EntityType="NorthwindModel.Sales_Totals_by_Amount" /><EntitySet Name="Summary_of_Sales_by_Quarters" EntityType="NorthwindModel.Summary_of_Sales_by_Quarter" /><EntitySet Name="Summary_of_Sales_by_Years" EntityType="NorthwindModel.Summary_of_Sales_by_Year" /><Associat
ionSet Name="FK_Products_Categories" Association="NorthwindModel.FK_Products_Categories"><End Role="Categories" EntitySet="Categories" /><End Role="Products" EntitySet="Products" /></AssociationSet><AssociationSet Name="CustomerCustomerDemo" Association="NorthwindModel.CustomerCustomerDemo"><End Role="CustomerDemographics" EntitySet="CustomerDemographics" /><End Role="Customers" EntitySet="Customers" /></AssociationSet><AssociationSet Name="FK_Orders_Customers" Association="NorthwindModel.FK_Orders_Customers"><End Role="Customers" EntitySet="Customers" /><End Role="Orders" EntitySet="Orders" /></AssociationSet><AssociationSet Name="FK_Employees_Employees" Association="NorthwindModel.FK_Employees_Employees"><End Role="Employees" EntitySet="Employees" /><End Role="Employees1" EntitySet="Employees" /></AssociationSet><AssociationSet Name="FK_Orders_Employees" Association="NorthwindModel.FK_Orders_Employees"><End Role="Employees" EntitySet="Employees" /><End Role="Orders" EntitySet="Ord
ers" /></AssociationSet><AssociationSet Name="EmployeeTerritories" Association="NorthwindModel.EmployeeTerritories"><End Role="Employees" EntitySet="Employees" /><End Role="Territories" EntitySet="Territories" /></AssociationSet><AssociationSet Name="FK_Order_Details_Orders" Association="NorthwindModel.FK_Order_Details_Orders"><End Role="Order_Details" EntitySet="Order_Details" /><End Role="Orders" EntitySet="Orders" /></AssociationSet><AssociationSet Name="FK_Order_Details_Products" Association="NorthwindModel.FK_Order_Details_Products"><End Role="Order_Details" EntitySet="Order_Details" /><End Role="Products" EntitySet="Products" /></AssociationSet><AssociationSet Name="FK_Orders_Shippers" Association="NorthwindModel.FK_Orders_Shippers"><End Role="Orders" EntitySet="Orders" /><End Role="Shippers" EntitySet="Shippers" /></AssociationSet><AssociationSet Name="FK_Products_Suppliers" Association="NorthwindModel.FK_Products_Suppliers"><End Role="Products" EntitySet="Products" /><End Ro
le="Suppliers" EntitySet="Suppliers" /></AssociationSet><AssociationSet Name="FK_Territories_Region" Association="NorthwindModel.FK_Territories_Region"><End Role="Region" EntitySet="Regions" /><End Role="Territories" EntitySet="Territories" /></AssociationSet></EntityContainer></Schema></edmx:DataServices></edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/serviceDocument.json
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/serviceDocument.json b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/serviceDocument.json
deleted file mode 100644
index 791f961..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/serviceDocument.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "odata.metadata": "http://services.odata.org/V3/OData/OData.svc/$metadata",
- "value": [
- {
- "name": "Products",
- "url": "Products"
- },
- {
- "name": "ProductDetails",
- "url": "ProductDetails"
- },
- {
- "name": "Categories",
- "url": "Categories"
- },
- {
- "name": "Suppliers",
- "url": "Suppliers"
- },
- {
- "name": "Persons",
- "url": "Persons"
- },
- {
- "name": "PersonDetails",
- "url": "PersonDetails"
- },
- {
- "name": "Advertisements",
- "url": "Advertisements"
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/serviceDocument.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/serviceDocument.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/serviceDocument.xml
deleted file mode 100644
index 0981814..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v3/serviceDocument.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<service xml:base="http://services.odata.org/V3/OData/OData.svc/"
- xmlns="http://www.w3.org/2007/app"
- xmlns:atom="http://www.w3.org/2005/Atom">
- <workspace>
- <atom:title>Default</atom:title>
- <collection href="Products">
- <atom:title>Products</atom:title>
- </collection>
- <collection href="ProductDetails">
- <atom:title>ProductDetails</atom:title>
- </collection>
- <collection href="Categories">
- <atom:title>Categories</atom:title>
- </collection>
- <collection href="Suppliers">
- <atom:title>Suppliers</atom:title>
- </collection>
- <collection href="Persons">
- <atom:title>Persons</atom:title>
- </collection>
- <collection href="PersonDetails">
- <atom:title>PersonDetails</atom:title>
- </collection>
- <collection href="Advertisements">
- <atom:title>Advertisements</atom:title>
- </collection>
- </workspace>
-</service>
[29/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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/edm/xml/v3/NavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/NavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/NavigationPropertyImpl.java
deleted file mode 100644
index 4ed4769..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/NavigationPropertyImpl.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.edm.xml.v3;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.NavigationProperty;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractNavigationProperty;
-
-public class NavigationPropertyImpl extends AbstractNavigationProperty implements NavigationProperty {
-
- private static final long serialVersionUID = -2889417442815563307L;
-
- @JsonProperty(value = "Relationship", required = true)
- private String relationship;
-
- @JsonProperty(value = "ToRole", required = true)
- private String toRole;
-
- @JsonProperty(value = "FromRole", required = true)
- private String fromRole;
-
- @Override
- public String getRelationship() {
- return relationship;
- }
-
- public void setRelationship(final String relationship) {
- this.relationship = relationship;
- }
-
- @Override
- public String getToRole() {
- return toRole;
- }
-
- public void setToRole(final String toRole) {
- this.toRole = toRole;
- }
-
- @Override
- public String getFromRole() {
- return fromRole;
- }
-
- public void setFromRole(final String fromRole) {
- this.fromRole = fromRole;
- }
-
-}
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/edm/xml/v3/ParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ParameterImpl.java
deleted file mode 100644
index 7406118..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ParameterImpl.java
+++ /dev/null
@@ -1,40 +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.edm.xml.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ParameterMode;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Parameter;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractParameter;
-
-public class ParameterImpl extends AbstractParameter implements Parameter {
-
- private static final long serialVersionUID = 7596724999614891358L;
-
- private ParameterMode mode;
-
- @Override
- public ParameterMode getMode() {
- return mode;
- }
-
- public void setMode(final ParameterMode mode) {
- this.mode = mode;
- }
-
-}
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/edm/xml/v3/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyImpl.java
deleted file mode 100644
index 352f8f0..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyImpl.java
+++ /dev/null
@@ -1,95 +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.edm.xml.v3;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Property;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractProperty;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmContentKind;
-
-public class PropertyImpl extends AbstractProperty implements Property {
-
- private static final long serialVersionUID = 6224524803474652100L;
-
- private String fcSourcePath;
-
- private String fcTargetPath;
-
- private EdmContentKind fcContentKind = EdmContentKind.text;
-
- private String fcNSPrefix;
-
- private String fcNSURI;
-
- private boolean fcKeepInContent = true;
-
- @Override
- public String getFcSourcePath() {
- return fcSourcePath;
- }
-
- public void setFcSourcePath(final String fcSourcePath) {
- this.fcSourcePath = fcSourcePath;
- }
-
- @Override
- public String getFcTargetPath() {
- return fcTargetPath;
- }
-
- public void setFcTargetPath(final String fcTargetPath) {
- this.fcTargetPath = fcTargetPath;
- }
-
- @Override
- public EdmContentKind getFcContentKind() {
- return fcContentKind;
- }
-
- public void setFcContentKind(final EdmContentKind fcContentKind) {
- this.fcContentKind = fcContentKind;
- }
-
- @Override
- public String getFcNSPrefix() {
- return fcNSPrefix;
- }
-
- public void setFcNSPrefix(final String fcNSPrefix) {
- this.fcNSPrefix = fcNSPrefix;
- }
-
- @Override
- public String getFcNSURI() {
- return fcNSURI;
- }
-
- public void setFcNSURI(final String fcNSURI) {
- this.fcNSURI = fcNSURI;
- }
-
- @Override
- public boolean isFcKeepInContent() {
- return fcKeepInContent;
- }
-
- public void setFcKeepInContent(final boolean fcKeepInContent) {
- this.fcKeepInContent = fcKeepInContent;
- }
-
-}
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/edm/xml/v3/PropertyValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyValueImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyValueImpl.java
deleted file mode 100644
index c7e0d42..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyValueImpl.java
+++ /dev/null
@@ -1,127 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Date;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.PropertyValue;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class PropertyValueImpl extends AbstractEdmItem implements PropertyValue {
-
- private static final long serialVersionUID = -6580934436491418564L;
-
- @JsonProperty(value = "Property", required = true)
- private String property;
-
- @JsonProperty("Path")
- private String path;
-
- @JsonProperty("String")
- private String string;
-
- @JsonProperty("Int")
- private BigInteger _int;
-
- @JsonProperty("Float")
- private Double _float;
-
- @JsonProperty("Decimal")
- private BigDecimal decimal;
-
- @JsonProperty("Bool")
- private Boolean bool;
-
- @JsonProperty("DateTime")
- private Date dateTime;
-
- @Override
- public String getProperty() {
- return property;
- }
-
- public void setProperty(final String property) {
- this.property = property;
- }
-
- @Override
- public String getPath() {
- return path;
- }
-
- public void setPath(final String path) {
- this.path = path;
- }
-
- @Override
- public String getString() {
- return string;
- }
-
- public void setString(final String string) {
- this.string = string;
- }
-
- @Override
- public BigInteger getInt() {
- return _int;
- }
-
- public void setInt(final BigInteger _int) {
- this._int = _int;
- }
-
- @Override
- public Double getFloat() {
- return _float;
- }
-
- public void setFloat(final Double _float) {
- this._float = _float;
- }
-
- @Override
- public BigDecimal getDecimal() {
- return decimal;
- }
-
- public void setDecimal(final BigDecimal decimal) {
- this.decimal = decimal;
- }
-
- @Override
- public Boolean getBool() {
- return bool;
- }
-
- public void setBool(final Boolean bool) {
- this.bool = bool;
- }
-
- @Override
- public Date getDateTime() {
- return dateTime == null ? null : new Date(dateTime.getTime());
- }
-
- public void setDateTime(final Date dateTime) {
- this.dateTime = dateTime == null ? null : new Date(dateTime.getTime());
- }
-}
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/edm/xml/v3/ReferentialConstraintImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ReferentialConstraintImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ReferentialConstraintImpl.java
deleted file mode 100644
index d2cce53..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ReferentialConstraintImpl.java
+++ /dev/null
@@ -1,56 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ReferentialConstraint;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ReferentialConstraintRole;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class ReferentialConstraintImpl extends AbstractEdmItem implements ReferentialConstraint {
-
- private static final long serialVersionUID = 9067893732765127269L;
-
- @JsonProperty(value = "Principal", required = true)
- private ReferentialConstraintRoleImpl principal;
-
- @JsonProperty(value = "Dependent", required = true)
- private ReferentialConstraintRoleImpl dependent;
-
- @Override
- public ReferentialConstraintRoleImpl getPrincipal() {
- return principal;
- }
-
- @JsonIgnore
- public void setPrincipal(final ReferentialConstraintRole principal) {
- this.principal = (ReferentialConstraintRoleImpl) principal;
- }
-
- @Override
- public ReferentialConstraintRoleImpl getDependent() {
- return dependent;
- }
-
- @JsonIgnore
- public void setDependent(final ReferentialConstraintRole dependent) {
- this.dependent = (ReferentialConstraintRoleImpl) dependent;
- }
-}
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/edm/xml/v3/ReferentialConstraintRoleDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java
deleted file mode 100644
index b565225..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml.v3;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.PropertyRefImpl;
-
-public class ReferentialConstraintRoleDeserializer extends AbstractEdmDeserializer<ReferentialConstraintRoleImpl> {
-
- @Override
- protected ReferentialConstraintRoleImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final ReferentialConstraintRoleImpl refConstRole = new ReferentialConstraintRoleImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Role".equals(jp.getCurrentName())) {
- refConstRole.setRole(jp.nextTextValue());
- } else if ("PropertyRef".equals(jp.getCurrentName())) {
- jp.nextToken();
- refConstRole.getPropertyRefs().add(jp.readValueAs( PropertyRefImpl.class));
- }
- }
- }
-
- return refConstRole;
- }
-}
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/edm/xml/v3/ReferentialConstraintRoleImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ReferentialConstraintRoleImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ReferentialConstraintRoleImpl.java
deleted file mode 100644
index 9ded4c5..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ReferentialConstraintRoleImpl.java
+++ /dev/null
@@ -1,49 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.PropertyRef;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ReferentialConstraintRole;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-@JsonDeserialize(using = ReferentialConstraintRoleDeserializer.class)
-public class ReferentialConstraintRoleImpl extends AbstractEdmItem implements ReferentialConstraintRole {
-
- private static final long serialVersionUID = -3712887115248634164L;
-
- private String role;
-
- private List<PropertyRef> propertyRefs = new ArrayList<PropertyRef>();
-
- @Override
- public String getRole() {
- return role;
- }
-
- public void setRole(final String role) {
- this.role = role;
- }
-
- public List<PropertyRef> getPropertyRefs() {
- return propertyRefs;
- }
-}
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/edm/xml/v3/SchemaImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/SchemaImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/SchemaImpl.java
deleted file mode 100644
index 8caccdc..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/SchemaImpl.java
+++ /dev/null
@@ -1,137 +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.edm.xml.v3;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.ComplexType;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityType;
-import org.apache.olingo.odata4.client.api.edm.xml.EnumType;
-import org.apache.olingo.odata4.client.api.edm.xml.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Annotations;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Association;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Using;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ValueTerm;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractSchema;
-
-public class SchemaImpl extends AbstractSchema implements Schema {
-
- private static final long serialVersionUID = 4453992249818796144L;
-
- private final List<Annotations> annotationList = new ArrayList<Annotations>();
-
- private final List<Association> associations = new ArrayList<Association>();
-
- private final List<ComplexType> complexTypes = new ArrayList<ComplexType>();
-
- private final List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
-
- private final List<EntityType> entityTypes = new ArrayList<EntityType>();
-
- private final List<EnumType> enumTypes = new ArrayList<EnumType>();
-
- private final List<Using> usings = new ArrayList<Using>();
-
- private final List<ValueTerm> valueTerms = new ArrayList<ValueTerm>();
-
- public Association getAssociation(final String name) {
- return getOneByName(name, getAssociations());
- }
-
- @Override
- public List<Annotations> getAnnotationsList() {
- return annotationList;
- }
-
- @Override
- public Annotations getAnnotationsList(final String target) {
- Annotations result = null;
- for (Annotations annots : getAnnotationsList()) {
- if (target.equals(annots.getTarget())) {
- result = annots;
- }
- }
- return result;
- }
-
- public List<Association> getAssociations() {
- return associations;
- }
-
- public List<Using> getUsings() {
- return usings;
- }
-
- public List<ValueTerm> getValueTerms() {
- return valueTerms;
- }
-
- @Override
- public List<EntityContainer> getEntityContainers() {
- return entityContainers;
- }
-
- @Override
- public EntityContainer getDefaultEntityContainer() {
- EntityContainer result = null;
- for (EntityContainer container : getEntityContainers()) {
- if (container.isDefaultEntityContainer()) {
- result = container;
- }
- }
- return result;
- }
-
- @Override
- public EntityContainer getEntityContainer(final String name) {
- return getOneByName(name, getEntityContainers());
- }
-
- @Override
- public EnumTypeImpl getEnumType(final String name) {
- return (EnumTypeImpl) super.getEnumType(name);
- }
-
- @Override
- public List<EnumType> getEnumTypes() {
- return enumTypes;
- }
-
- @Override
- public ComplexTypeImpl getComplexType(final String name) {
- return (ComplexTypeImpl) super.getComplexType(name);
- }
-
- @Override
- public List<ComplexType> getComplexTypes() {
- return complexTypes;
- }
-
- @Override
- public EntityTypeImpl getEntityType(final String name) {
- return (EntityTypeImpl) super.getEntityType(name);
- }
-
- @Override
- public List<EntityType> getEntityTypes() {
- return entityTypes;
- }
-
-}
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/edm/xml/v3/TypeAnnotationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/TypeAnnotationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/TypeAnnotationDeserializer.java
deleted file mode 100644
index c6a10bc..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/TypeAnnotationDeserializer.java
+++ /dev/null
@@ -1,52 +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.edm.xml.v3;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class TypeAnnotationDeserializer extends AbstractEdmDeserializer<TypeAnnotationImpl> {
-
- @Override
- protected TypeAnnotationImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final TypeAnnotationImpl typeAnnot = new TypeAnnotationImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Term".equals(jp.getCurrentName())) {
- typeAnnot.setTerm(jp.nextTextValue());
- } else if ("Qualifier".equals(jp.getCurrentName())) {
- typeAnnot.setQualifier(jp.nextTextValue());
- } else if ("PropertyValue".equals(jp.getCurrentName())) {
- jp.nextToken();
- typeAnnot.getPropertyValues().add(jp.readValueAs( PropertyValueImpl.class));
- }
- }
- }
-
- return typeAnnot;
- }
-}
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/edm/xml/v3/TypeAnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/TypeAnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/TypeAnnotationImpl.java
deleted file mode 100644
index e709d84..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/TypeAnnotationImpl.java
+++ /dev/null
@@ -1,62 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.PropertyValue;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.TypeAnnotation;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-@JsonDeserialize(using = TypeAnnotationDeserializer.class)
-public class TypeAnnotationImpl extends AbstractEdmItem implements TypeAnnotation {
-
- private static final long serialVersionUID = -7585489230017331877L;
-
- private String term;
-
- private String qualifier;
-
- private List<PropertyValue> propertyValues = new ArrayList<PropertyValue>();
-
- @Override
- public String getTerm() {
- return term;
- }
-
- public void setTerm(final String term) {
- this.term = term;
- }
-
- @Override
- public String getQualifier() {
- return qualifier;
- }
-
- public void setQualifier(final String qualifier) {
- this.qualifier = qualifier;
- }
-
- @Override
- public List<PropertyValue> getPropertyValues() {
- return propertyValues;
- }
-
-}
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/edm/xml/v3/UsingImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/UsingImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/UsingImpl.java
deleted file mode 100644
index 0d938d7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/UsingImpl.java
+++ /dev/null
@@ -1,52 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Using;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class UsingImpl extends AbstractEdmItem implements Using {
-
- private static final long serialVersionUID = 2086957510154443445L;
-
- @JsonProperty(value = "Namespace", required = true)
- private String namespace;
-
- @JsonProperty("Alias")
- private String alias;
-
- @Override
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(final String namespace) {
- this.namespace = namespace;
- }
-
- @Override
- public String getAlias() {
- return alias;
- }
-
- public void setAlias(final String alias) {
- this.alias = alias;
- }
-}
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/edm/xml/v3/ValueAnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ValueAnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ValueAnnotationImpl.java
deleted file mode 100644
index fde4380..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ValueAnnotationImpl.java
+++ /dev/null
@@ -1,139 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Date;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ValueAnnotation;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class ValueAnnotationImpl extends AbstractEdmItem implements ValueAnnotation {
-
- private static final long serialVersionUID = -1826414005417952278L;
-
- @JsonProperty(value = "Term", required = true)
- private String term;
-
- @JsonProperty("Qualifier")
- private String qualifier;
-
- @JsonProperty("Path")
- private String path;
-
- @JsonProperty("String")
- private String string;
-
- @JsonProperty("Int")
- private BigInteger _int;
-
- @JsonProperty("Float")
- private Double _float;
-
- @JsonProperty("Decimal")
- private BigDecimal decimal;
-
- @JsonProperty("Bool")
- private Boolean bool;
-
- @JsonProperty("DateTime")
- private Date dateTime;
-
- @Override
- public String getTerm() {
- return term;
- }
-
- public void setTerm(final String term) {
- this.term = term;
- }
-
- @Override
- public String getQualifier() {
- return qualifier;
- }
-
- public void setQualifier(final String qualifier) {
- this.qualifier = qualifier;
- }
-
- @Override
- public String getPath() {
- return path;
- }
-
- public void setPath(final String path) {
- this.path = path;
- }
-
- @Override
- public String getString() {
- return string;
- }
-
- public void setString(final String string) {
- this.string = string;
- }
-
- @Override
- public BigInteger getInt() {
- return _int;
- }
-
- public void setInt(final BigInteger _int) {
- this._int = _int;
- }
-
- @Override
- public Double getFloat() {
- return _float;
- }
-
- public void setFloat(final Double _float) {
- this._float = _float;
- }
-
- @Override
- public BigDecimal getDecimal() {
- return decimal;
- }
-
- public void setDecimal(final BigDecimal decimal) {
- this.decimal = decimal;
- }
-
- @Override
- public Boolean getBool() {
- return bool;
- }
-
- public void setBool(final Boolean bool) {
- this.bool = bool;
- }
-
- @Override
- public Date getDateTime() {
- return dateTime == null ? null : new Date(dateTime.getTime());
- }
-
- public void setDateTime(final Date dateTime) {
- this.dateTime = dateTime == null ? null : new Date(dateTime.getTime());
- }
-}
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/edm/xml/v3/ValueTermImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ValueTermImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ValueTermImpl.java
deleted file mode 100644
index 114465b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ValueTermImpl.java
+++ /dev/null
@@ -1,52 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ValueTerm;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class ValueTermImpl extends AbstractEdmItem implements ValueTerm {
-
- private static final long serialVersionUID = 6149019886137610604L;
-
- @JsonProperty(value = "Name", required = true)
- private String name;
-
- @JsonProperty(value = "Type", required = true)
- private String type;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-}
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/edm/xml/v3/XMLMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/XMLMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/XMLMetadataImpl.java
deleted file mode 100644
index f2d6095..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/XMLMetadataImpl.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.edm.xml.v3;
-
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractXMLMetadata;
-
-public class XMLMetadataImpl extends AbstractXMLMetadata {
-
- private static final long serialVersionUID = -7765327879691528010L;
-
- public XMLMetadataImpl(final EdmxImpl edmx) {
- super(edmx);
- }
-
-}
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/edm/xml/v4/AbstractAnnotatedEdmItem.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AbstractAnnotatedEdmItem.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AbstractAnnotatedEdmItem.java
deleted file mode 100644
index accae2e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AbstractAnnotatedEdmItem.java
+++ /dev/null
@@ -1,44 +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.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.AnnotatedEdmItem;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public abstract class AbstractAnnotatedEdmItem extends AbstractEdmItem implements AnnotatedEdmItem {
-
- private static final long serialVersionUID = -8859729466090997718L;
-
- @JsonProperty("Annotation")
- private AnnotationImpl annotation;
-
- @Override
- public AnnotationImpl getAnnotation() {
- return annotation;
- }
-
- @JsonIgnore
- public void setAnnotation(final Annotation annotation) {
- this.annotation = (AnnotationImpl) annotation;
- }
-
-}
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/edm/xml/v4/ActionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ActionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ActionDeserializer.java
deleted file mode 100644
index ea93d75..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ActionDeserializer.java
+++ /dev/null
@@ -1,60 +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.edm.xml.v4;
-
-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 java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class ActionDeserializer extends AbstractEdmDeserializer<ActionImpl> {
-
- @Override
- protected ActionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final ActionImpl action = new ActionImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- action.setName(jp.nextTextValue());
- } else if ("IsBound".equals(jp.getCurrentName())) {
- action.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("EntitySetPath".equals(jp.getCurrentName())) {
- action.setEntitySetPath(jp.nextTextValue());
- } else if ("Parameter".equals(jp.getCurrentName())) {
- jp.nextToken();
- action.getParameters().add(jp.readValueAs(ParameterImpl.class));
- } else if ("ReturnType".equals(jp.getCurrentName())) {
- action.setReturnType(parseReturnType(jp, "Action"));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- action.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return action;
- }
-}
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/edm/xml/v4/ActionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ActionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ActionImpl.java
deleted file mode 100644
index a1c3d16..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ActionImpl.java
+++ /dev/null
@@ -1,89 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Action;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Parameter;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ReturnType;
-
-@JsonDeserialize(using = ActionDeserializer.class)
-public class ActionImpl extends AbstractAnnotatedEdmItem implements Action {
-
- private static final long serialVersionUID = -99977447455438193L;
-
- private String name;
-
- private boolean bound = false;
-
- private String entitySetPath;
-
- private final List<Parameter> parameters = new ArrayList<Parameter>();
-
- private ReturnType returnType;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public boolean isBound() {
- return bound;
- }
-
- public void setBound(final boolean bound) {
- this.bound = bound;
- }
-
- @Override
- public String getEntitySetPath() {
- return entitySetPath;
- }
-
- public void setEntitySetPath(final String entitySetPath) {
- this.entitySetPath = entitySetPath;
- }
-
- @Override
- public Parameter getParameter(final String name) {
- return getOneByName(name, getParameters());
- }
-
- @Override
- public List<Parameter> getParameters() {
- return parameters;
- }
-
- @Override
- public ReturnType getReturnType() {
- return returnType;
- }
-
- public void setReturnType(final ReturnType returnType) {
- this.returnType = returnType;
- }
-
-}
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/edm/xml/v4/ActionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ActionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ActionImportImpl.java
deleted file mode 100644
index fca7ed7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ActionImportImpl.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.edm.xml.v4;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ActionImport;
-
-public class ActionImportImpl extends AbstractAnnotatedEdmItem implements ActionImport {
-
- private static final long serialVersionUID = -866422101558426421L;
-
- @JsonProperty(value = "Name", required = true)
- private String name;
-
- @JsonProperty(value = "Action", required = true)
- private String action;
-
- @JsonProperty(value = "EntitySet")
- private String entitySet;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getAction() {
- return action;
- }
-
- public void setAction(final String action) {
- this.action = action;
- }
-
- @Override
- public String getEntitySet() {
- return entitySet;
- }
-
- @Override
- public void setEntitySet(final String entitySet) {
- this.entitySet = entitySet;
- }
-
-}
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/edm/xml/v4/AnnotationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationDeserializer.java
deleted file mode 100644
index 6a4332a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationDeserializer.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.edm.xml.v4;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.annotation.DynExprConstructImpl;
-
-public class AnnotationDeserializer extends AbstractEdmDeserializer<AnnotationImpl> {
-
- @Override
- protected AnnotationImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AnnotationImpl annotation = new AnnotationImpl();
-
- for (; jp.getCurrentToken() != null && jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Term".equals(jp.getCurrentName())) {
- annotation.setTerm(jp.nextTextValue());
- } else if ("Qualifier".equals(jp.getCurrentName())) {
- annotation.setQualifier(jp.nextTextValue());
- } else if (isAnnotationConstExprConstruct(jp)) {
- // Constant Expressions
- annotation.setConstExpr(parseAnnotationConstExprConstruct(jp));
- } else {
- // Dynamic Expressions
- annotation.setDynExpr(jp.readValueAs( DynExprConstructImpl.class));
- }
- }
- }
-
- return annotation;
- }
-
-}
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/edm/xml/v4/AnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationImpl.java
deleted file mode 100644
index 1e1ae0c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationImpl.java
+++ /dev/null
@@ -1,76 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ConstExprConstruct;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-@JsonDeserialize(using = AnnotationDeserializer.class)
-public class AnnotationImpl extends AbstractEdmItem implements Annotation {
-
- private static final long serialVersionUID = -5600031479702563436L;
-
- private String term;
-
- private String qualifier;
-
- private ConstExprConstruct constExpr;
-
- private DynExprConstruct dynExpr;
-
- @Override
- public String getTerm() {
- return term;
- }
-
- public void setTerm(final String term) {
- this.term = term;
- }
-
- @Override
- public String getQualifier() {
- return qualifier;
- }
-
- public void setQualifier(final String qualifier) {
- this.qualifier = qualifier;
- }
-
- @Override
- public ConstExprConstruct getConstExpr() {
- return constExpr;
- }
-
- public void setConstExpr(final ConstExprConstruct constExpr) {
- this.constExpr = constExpr;
- }
-
- @Override
- public DynExprConstruct getDynExpr() {
- return dynExpr;
- }
-
- public void setDynExpr(final DynExprConstruct dynExpr) {
- this.dynExpr = dynExpr;
- }
-
-}
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/edm/xml/v4/AnnotationsDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationsDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationsDeserializer.java
deleted file mode 100644
index 80e07ad..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationsDeserializer.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.edm.xml.v4;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class AnnotationsDeserializer extends AbstractEdmDeserializer<AnnotationsImpl> {
-
- @Override
- protected AnnotationsImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AnnotationsImpl annotations = new AnnotationsImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Target".equals(jp.getCurrentName())) {
- annotations.setTarget(jp.nextTextValue());
- } else if ("Qualifier".equals(jp.getCurrentName())) {
- annotations.setQualifier(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- annotations.getAnnotations().add(jp.readValueAs( AnnotationImpl.class));
- }
- }
- }
-
- return annotations;
- }
-
-}
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/edm/xml/v4/AnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationsImpl.java
deleted file mode 100644
index cfd961d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationsImpl.java
+++ /dev/null
@@ -1,49 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotations;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractAnnotations;
-
-@JsonDeserialize(using = AnnotationsDeserializer.class)
-public class AnnotationsImpl extends AbstractAnnotations implements Annotations {
-
- private static final long serialVersionUID = 3877353656301805410L;
-
- private final List<AnnotationImpl> annotations = new ArrayList<AnnotationImpl>();
-
- @Override
- public List<AnnotationImpl> getAnnotations() {
- return annotations;
- }
-
- @Override
- public AnnotationImpl getAnnotation(final String term) {
- AnnotationImpl result = null;
- for (AnnotationImpl annotation : getAnnotations()) {
- if (term.equals(annotation.getTerm())) {
- result = annotation;
- }
- }
- return result;
- }
-}
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/edm/xml/v4/ComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ComplexTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ComplexTypeImpl.java
deleted file mode 100644
index bc3fe92..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ComplexTypeImpl.java
+++ /dev/null
@@ -1,101 +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 >ied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml.v4;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ComplexType;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Property;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractComplexType;
-
-public class ComplexTypeImpl extends AbstractComplexType implements ComplexType {
-
- private static final long serialVersionUID = -1251230308269425962L;
-
- private boolean abstractEntityType = false;
-
- private String baseType;
-
- private boolean openType = false;
-
- private final List<Property> properties = new ArrayList<Property>();
-
- private final List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
-
- private Annotation annotation;
-
- @Override
- public boolean isAbstractEntityType() {
- return abstractEntityType;
- }
-
- public void setAbstractEntityType(final boolean abstractEntityType) {
- this.abstractEntityType = abstractEntityType;
- }
-
- @Override
- public String getBaseType() {
- return baseType;
- }
-
- public void setBaseType(final String baseType) {
- this.baseType = baseType;
- }
-
- @Override
- public boolean isOpenType() {
- return openType;
- }
-
- public void setOpenType(final boolean openType) {
- this.openType = openType;
- }
-
- @Override
- public Property getProperty(final String name) {
- return (Property) super.getProperty(name);
- }
-
- @Override
- public List<Property> getProperties() {
- return properties;
- }
-
- @Override
- public NavigationProperty getNavigationProperty(final String name) {
- return (NavigationProperty) super.getNavigationProperty(name);
- }
-
- @Override
- public List<NavigationProperty> getNavigationProperties() {
- return navigationProperties;
- }
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-
-}
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/edm/xml/v4/DataServicesImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/DataServicesImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/DataServicesImpl.java
deleted file mode 100644
index a9b0589..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/DataServicesImpl.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.edm.xml.v4;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Schema;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractDataServices;
-
-public class DataServicesImpl extends AbstractDataServices {
-
- private static final long serialVersionUID = -7954360771258897632L;
-
- private final List<Schema> schemas = new ArrayList<Schema>();
-
- @Override
- public List<Schema> getSchemas() {
- return schemas;
- }
-
-}
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/edm/xml/v4/EdmxImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EdmxImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EdmxImpl.java
deleted file mode 100644
index bd216f9..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EdmxImpl.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.edm.xml.v4;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Edmx;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Reference;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmx;
-
-public class EdmxImpl extends AbstractEdmx implements Edmx {
-
- private static final long serialVersionUID = -8031883176876401375L;
-
- private final List<Reference> references = new ArrayList<Reference>();
-
- @Override
- public DataServicesImpl getDataServices() {
- return (DataServicesImpl) super.getDataServices();
- }
-
- @Override
- public List<Reference> getReferences() {
- return references;
- }
-
-}
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/edm/xml/v4/EntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityContainerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityContainerImpl.java
deleted file mode 100644
index 8e11425..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityContainerImpl.java
+++ /dev/null
@@ -1,128 +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.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.AnnotatedEdmItem;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ActionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntitySet;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.FunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Singleton;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntityContainer;
-
-public class EntityContainerImpl extends AbstractEntityContainer implements AnnotatedEdmItem, EntityContainer {
-
- private static final long serialVersionUID = 2526002525927260320L;
-
- private final List<EntitySet> entitySets = new ArrayList<EntitySet>();
-
- private final List<Singleton> singletons = new ArrayList<Singleton>();
-
- private final List<ActionImport> actionImports = new ArrayList<ActionImport>();
-
- private final List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
-
- private Annotation annotation;
-
- @Override
- public void setDefaultEntityContainer(final boolean defaultEntityContainer) {
- // no action: a single entity container MUST be available as per OData 4.0
- }
-
- @Override
- public boolean isDefaultEntityContainer() {
- return true;
- }
-
- @Override
- public EntitySet getEntitySet(final String name) {
- return (EntitySet) super.getEntitySet(name);
- }
-
- @Override
- public List<EntitySet> getEntitySets() {
- return entitySets;
- }
-
- @Override
- public List<Singleton> getSingletons() {
- return singletons;
- }
-
- @Override
- public Singleton getSingleton(final String name) {
- return getOneByName(name, getSingletons());
- }
-
- @Override
- public FunctionImport getFunctionImport(final String name) {
- return (FunctionImport) super.getFunctionImport(name);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public List<FunctionImport> getFunctionImports(final String name) {
- return (List<FunctionImport>) super.getFunctionImports(name);
- }
-
- /**
- * Gets the first action import with given name.
- *
- * @param name name.
- * @return action import.
- */
- @Override
- public ActionImport getActionImport(final String name) {
- return getOneByName(name, getActionImports());
- }
-
- /**
- * Gets all action imports with given name.
- *
- * @param name name.
- * @return action imports.
- */
- @Override
- public List<ActionImport> getActionImports(final String name) {
- return getAllByName(name, getActionImports());
- }
-
- @Override
- public List<ActionImport> getActionImports() {
- return actionImports;
- }
-
- @Override
- public List<FunctionImport> getFunctionImports() {
- return functionImports;
- }
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-
-}
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/edm/xml/v4/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntitySetImpl.java
deleted file mode 100644
index 723faee..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntitySetImpl.java
+++ /dev/null
@@ -1,61 +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.edm.xml.v4;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntitySet;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationPropertyBinding;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntitySet;
-
-public class EntitySetImpl extends AbstractEntitySet implements EntitySet {
-
- private static final long serialVersionUID = 5570833733884884012L;
-
- private boolean includeInServiceDocument = true;
-
- private Annotation annotation;
-
- private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
-
- @Override
- public boolean isIncludeInServiceDocument() {
- return includeInServiceDocument;
- }
-
- public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
- this.includeInServiceDocument = includeInServiceDocument;
- }
-
- @Override
- public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
- return navigationPropertyBindings;
- }
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-
-}
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/edm/xml/v4/EntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityTypeImpl.java
deleted file mode 100644
index 8ca73aa..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityTypeImpl.java
+++ /dev/null
@@ -1,68 +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.edm.xml.v4;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntityType;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Property;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntityType;
-
-public class EntityTypeImpl extends AbstractEntityType implements EntityType {
-
- private static final long serialVersionUID = 8727765036150269547L;
-
- private final List<Property> properties = new ArrayList<Property>();
-
- private final List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
-
- private Annotation annotation;
-
- @Override
- public Property getProperty(final String name) {
- return (Property) super.getProperty(name);
- }
-
- @Override
- public List<Property> getProperties() {
- return properties;
- }
-
- @Override
- public NavigationProperty getNavigationProperty(final String name) {
- return (NavigationProperty) super.getNavigationProperty(name);
- }
-
- @Override
- public List<NavigationProperty> getNavigationProperties() {
- return navigationProperties;
- }
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-
-}
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/edm/xml/v4/EnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EnumTypeImpl.java
deleted file mode 100644
index b225902..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EnumTypeImpl.java
+++ /dev/null
@@ -1,40 +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.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.AnnotatedEdmItem;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEnumType;
-
-public class EnumTypeImpl extends AbstractEnumType implements AnnotatedEdmItem {
-
- private static final long serialVersionUID = -3329664331877556957L;
-
- private Annotation annotation;
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-
-}
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/edm/xml/v4/FunctionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/FunctionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/FunctionDeserializer.java
deleted file mode 100644
index f8c6b8a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/FunctionDeserializer.java
+++ /dev/null
@@ -1,62 +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.edm.xml.v4;
-
-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 java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class FunctionDeserializer extends AbstractEdmDeserializer<FunctionImpl> {
-
- @Override
- protected FunctionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final FunctionImpl functionImpl = new FunctionImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- functionImpl.setName(jp.nextTextValue());
- } else if ("IsBound".equals(jp.getCurrentName())) {
- functionImpl.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("IsComposable".equals(jp.getCurrentName())) {
- functionImpl.setComposable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("EntitySetPath".equals(jp.getCurrentName())) {
- functionImpl.setEntitySetPath(jp.nextTextValue());
- } else if ("Parameter".equals(jp.getCurrentName())) {
- jp.nextToken();
- functionImpl.getParameters().add(jp.readValueAs(ParameterImpl.class));
- } else if ("ReturnType".equals(jp.getCurrentName())) {
- functionImpl.setReturnType(parseReturnType(jp, "Function"));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- functionImpl.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return functionImpl;
- }
-}
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/edm/xml/v4/FunctionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/FunctionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/FunctionImpl.java
deleted file mode 100644
index 17ae459..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/FunctionImpl.java
+++ /dev/null
@@ -1,40 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Function;
-
-@JsonDeserialize(using = FunctionDeserializer.class)
-public class FunctionImpl extends ActionImpl implements Function {
-
- private static final long serialVersionUID = -5888231162358116515L;
-
- private boolean composable = false;
-
- @Override
- public boolean isComposable() {
- return composable;
- }
-
- public void setComposable(final boolean composable) {
- this.composable = composable;
- }
-
-}
[40/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImpl.java
new file mode 100644
index 0000000..67f9e94
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImpl.java
@@ -0,0 +1,61 @@
+/*
+ * 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.edm;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.CommonParameter;
+import org.apache.olingo.client.api.edm.xml.v4.Action;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmParameter;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.commons.core.edm.AbstractEdmOperation;
+
+public abstract class EdmOperationImpl extends AbstractEdmOperation {
+
+ protected final Action operation;
+
+ protected static <T extends EdmOperationImpl> T getInstance(final T instance) {
+ final List<? extends CommonParameter> parameters = instance.operation.getParameters();
+ final List<EdmParameter> _parameters = new ArrayList<EdmParameter>(parameters.size());
+ for (CommonParameter parameter : parameters) {
+ _parameters.add(EdmParameterImpl.getInstance(instance.edm, parameter));
+ }
+ instance.setParameters(_parameters);
+
+ instance.setEntitySetPath(instance.operation.getEntitySetPath());
+
+ instance.setIsBound(instance.operation.isBound());
+
+ if (instance.operation.getReturnType() != null) {
+ instance.setReturnType(EdmReturnTypeImpl.getInstance(instance.edm, instance.operation.getReturnType()));
+ }
+
+ return instance;
+ }
+
+ protected EdmOperationImpl(final Edm edm, final FullQualifiedName name, final Action operation,
+ final EdmTypeKind kind) {
+
+ super(edm, name, kind);
+ this.operation = operation;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImportImpl.java
new file mode 100644
index 0000000..9f7aadf
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmOperationImportImpl.java
@@ -0,0 +1,34 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.Target;
+import org.apache.olingo.commons.core.edm.AbstractEdmOperationImport;
+
+public abstract class EdmOperationImportImpl extends AbstractEdmOperationImport {
+
+ protected EdmOperationImportImpl(final Edm edm, final EdmEntityContainer container, final String name,
+ final String entitySet) {
+
+ super(edm, container, name, entitySet == null ? null : new Target.Builder(entitySet, container).build());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmParameterImpl.java
new file mode 100644
index 0000000..33dfad3
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmParameterImpl.java
@@ -0,0 +1,74 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.CommonParameter;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmMapping;
+import org.apache.olingo.commons.core.edm.AbstractEdmParameter;
+
+public class EdmParameterImpl extends AbstractEdmParameter {
+
+ private final CommonParameter parameter;
+
+ private final EdmTypeInfo parameterInfo;
+
+ public static EdmParameterImpl getInstance(final Edm edm, final CommonParameter parameter) {
+ final EdmTypeInfo paramTypeInfo = new EdmTypeInfo(parameter.getType());
+ return new EdmParameterImpl(edm, parameter, paramTypeInfo);
+ }
+
+ private EdmParameterImpl(final Edm edm, final CommonParameter parameter, final EdmTypeInfo parameterInfo) {
+ super(edm, parameter.getName(), parameterInfo.getFullQualifiedName());
+ this.parameter = parameter;
+ this.parameterInfo = parameterInfo;
+ }
+
+ @Override
+ public boolean isCollection() {
+ return parameterInfo.isCollection();
+ }
+
+ @Override
+ public EdmMapping getMapping() {
+ throw new UnsupportedOperationException("Not supported in client code.");
+ }
+
+ @Override
+ public Boolean isNullable() {
+ return parameter.isNullable();
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return parameter.getMaxLength();
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return parameter.getPrecision();
+ }
+
+ @Override
+ public Integer getScale() {
+ return parameter.getScale();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmPropertyImpl.java
new file mode 100644
index 0000000..399b344
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmPropertyImpl.java
@@ -0,0 +1,91 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.CommonProperty;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmMapping;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmProperty;
+
+public class EdmPropertyImpl extends AbstractEdmProperty implements EdmProperty {
+
+ private final CommonProperty property;
+
+ private final EdmTypeInfo edmTypeInfo;
+
+ public EdmPropertyImpl(final Edm edm, final CommonProperty property) {
+ super(edm, property.getName());
+ this.property = property;
+ this.edmTypeInfo = new EdmTypeInfo(property.getType());
+ }
+
+ @Override
+ protected FullQualifiedName getTypeFQN() {
+ return edmTypeInfo.getFullQualifiedName();
+ }
+
+ @Override
+ public boolean isCollection() {
+ return edmTypeInfo.isCollection();
+ }
+
+ @Override
+ public EdmMapping getMapping() {
+ throw new UnsupportedOperationException("Not supported in client code.");
+ }
+
+ @Override
+ public String getMimeType() {
+ throw new UnsupportedOperationException("Not supported in client code.");
+ }
+
+ @Override
+ public Boolean isNullable() {
+ return property.isNullable();
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return property.getMaxLength();
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return property.getPrecision();
+ }
+
+ @Override
+ public Integer getScale() {
+ return property.getScale();
+ }
+
+ @Override
+ public Boolean isUnicode() {
+ return property.isUnicode();
+ }
+
+ @Override
+ public String getDefaultValue() {
+ return property.getDefaultValue();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReturnTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReturnTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReturnTypeImpl.java
new file mode 100644
index 0000000..72d6626
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmReturnTypeImpl.java
@@ -0,0 +1,68 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.v4.ReturnType;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.core.edm.AbstractEdmReturnType;
+
+public class EdmReturnTypeImpl extends AbstractEdmReturnType {
+
+ private final ReturnType returnType;
+
+ private final EdmTypeInfo returnTypeInfo;
+
+ public static EdmReturnTypeImpl getInstance(final Edm edm, final ReturnType returnType) {
+ final EdmTypeInfo returnTypeInfo = new EdmTypeInfo(returnType.getType());
+ return new EdmReturnTypeImpl(edm, returnType, returnTypeInfo);
+ }
+
+ private EdmReturnTypeImpl(final Edm edm, final ReturnType returnType, final EdmTypeInfo returnTypeInfo) {
+ super(edm, returnTypeInfo.getFullQualifiedName());
+ this.returnType = returnType;
+ this.returnTypeInfo = returnTypeInfo;
+ }
+
+ @Override
+ public Boolean isNullable() {
+ return returnType.isNullable();
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return returnType.getMaxLength();
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return returnType.getPrecision();
+ }
+
+ @Override
+ public Integer getScale() {
+ return returnType.getScale();
+ }
+
+ @Override
+ public boolean isCollection() {
+ return returnTypeInfo.isCollection();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSingletonImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSingletonImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSingletonImpl.java
new file mode 100644
index 0000000..b91340e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmSingletonImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.v4.Singleton;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmSingleton;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class EdmSingletonImpl extends EdmBindingTargetImpl implements EdmSingleton {
+
+ public EdmSingletonImpl(final Edm edm, final EdmEntityContainer container, final String name,
+ final FullQualifiedName type, final Singleton singleton) {
+
+ super(edm, container, name, type, singleton);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmStructuredTypeHelperImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmStructuredTypeHelperImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmStructuredTypeHelperImpl.java
new file mode 100644
index 0000000..140fe89
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmStructuredTypeHelperImpl.java
@@ -0,0 +1,72 @@
+/*
+ * 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.edm;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.olingo.client.api.edm.xml.CommonNavigationProperty;
+import org.apache.olingo.client.api.edm.xml.CommonProperty;
+import org.apache.olingo.client.api.edm.xml.ComplexType;
+import org.apache.olingo.client.api.edm.xml.v4.NavigationProperty;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper;
+
+public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
+
+ private final Edm edm;
+
+ private final ComplexType complexType;
+
+ private Map<String, EdmProperty> properties;
+
+ private Map<String, EdmNavigationProperty> navigationProperties;
+
+ public EdmStructuredTypeHelperImpl(final Edm edm, final ComplexType complexType) {
+ this.edm = edm;
+ this.complexType = complexType;
+ }
+
+ @Override
+ public Map<String, EdmProperty> getProperties() {
+ if (properties == null) {
+ properties = new LinkedHashMap<String, EdmProperty>();
+ for (CommonProperty property : complexType.getProperties()) {
+ properties.put(property.getName(), new EdmPropertyImpl(edm, property));
+ }
+ }
+ return properties;
+ }
+
+ @Override
+ public Map<String, EdmNavigationProperty> getNavigationProperties() {
+ if (navigationProperties == null) {
+ navigationProperties = new LinkedHashMap<String, EdmNavigationProperty>();
+ for (CommonNavigationProperty navigationProperty : complexType.getNavigationProperties()) {
+ if (navigationProperty instanceof NavigationProperty) {
+ navigationProperties.put(navigationProperty.getName(),
+ new EdmNavigationPropertyImpl(edm, (NavigationProperty) navigationProperty));
+ }
+ }
+ }
+ return navigationProperties;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTypeDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTypeDefinitionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTypeDefinitionImpl.java
new file mode 100644
index 0000000..afe6512
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmTypeDefinitionImpl.java
@@ -0,0 +1,74 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.v4.TypeDefinition;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmTypeDefinition;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+
+public class EdmTypeDefinitionImpl extends AbstractEdmTypeDefinition implements EdmTypeDefinition {
+
+ private TypeDefinition typeDefinition;
+
+ private EdmPrimitiveType edmPrimitiveTypeInstance;
+
+ public EdmTypeDefinitionImpl(final Edm edm, final FullQualifiedName typeDefinitionName,
+ final TypeDefinition typeDefinition) {
+
+ super(edm, typeDefinitionName);
+ this.typeDefinition = typeDefinition;
+ // TODO: Should we check for edmNamespace in the underlying type name?
+ try {
+ edmPrimitiveTypeInstance = EdmPrimitiveTypeKind.fromString(
+ typeDefinition.getUnderlyingType()).getEdmPrimitiveTypeInstance();
+ } catch (IllegalArgumentException e) {
+ throw new EdmException("Invalid underlying type: " + typeDefinition.getUnderlyingType(), e);
+ }
+ }
+
+ @Override
+ public EdmPrimitiveType getUnderlyingType() {
+ return edmPrimitiveTypeInstance;
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return typeDefinition.getMaxLength();
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return typeDefinition.getPrecision();
+ }
+
+ @Override
+ public Integer getScale() {
+ return typeDefinition.getScale();
+ }
+
+ @Override
+ public Boolean isUnicode() {
+ return typeDefinition.isUnicode();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmActionImportProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmActionImportProxy.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmActionImportProxy.java
new file mode 100644
index 0000000..576623e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmActionImportProxy.java
@@ -0,0 +1,45 @@
+/*
+ * 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.edm.v3;
+
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.client.core.edm.EdmOperationImportImpl;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmActionImport;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+
+public class EdmActionImportProxy extends EdmOperationImportImpl implements EdmActionImport {
+
+ private final FunctionImport functionImport;
+
+ public EdmActionImportProxy(final Edm edm, final EdmEntityContainer container, final String name,
+ final FunctionImport functionImport) {
+
+ super(edm, container, name, functionImport.getEntitySet());
+ this.functionImport = functionImport;
+ }
+
+ @Override
+ public EdmAction getAction() {
+ return edm.getAction(
+ new EdmTypeInfo(functionImport.getName(), container.getNamespace()).getFullQualifiedName(), null, null);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmActionProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmActionProxy.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmActionProxy.java
new file mode 100644
index 0000000..be57801
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmActionProxy.java
@@ -0,0 +1,39 @@
+/*
+ * 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.edm.v3;
+
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public class EdmActionProxy extends EdmOperationProxy implements EdmAction {
+
+ public static EdmActionProxy getInstance(final Edm edm, final FullQualifiedName name,
+ final FunctionImport functionImport) {
+
+ return EdmActionProxy.getInstance(new EdmActionProxy(edm, name, functionImport));
+ }
+
+ private EdmActionProxy(final Edm edm, final FullQualifiedName name, final FunctionImport functionImport) {
+ super(edm, name, functionImport, EdmTypeKind.ACTION);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmEntitySetProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmEntitySetProxy.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmEntitySetProxy.java
new file mode 100644
index 0000000..d3e0312
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmEntitySetProxy.java
@@ -0,0 +1,102 @@
+/*
+ * 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.edm.v3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+import org.apache.olingo.client.api.edm.xml.v3.Association;
+import org.apache.olingo.client.api.edm.xml.v3.AssociationSet;
+import org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl;
+import org.apache.olingo.client.core.edm.xml.v3.SchemaImpl;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmBindingTarget;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmBindingTarget;
+
+public class EdmEntitySetProxy extends AbstractEdmBindingTarget implements EdmEntitySet {
+
+ private final XMLMetadata xmlMetadata;
+
+ public EdmEntitySetProxy(final Edm edm, final EdmEntityContainer container, final String name,
+ final FullQualifiedName type, final XMLMetadata xmlMetadata) {
+
+ super(edm, container, name, type);
+ this.xmlMetadata = xmlMetadata;
+ }
+
+ @Override
+ public EdmBindingTarget getRelatedBindingTarget(final String path) {
+ final List<AssociationSet> candidateAssociationSets = new ArrayList<AssociationSet>();
+ for (Schema schema : xmlMetadata.getSchemas()) {
+ for (EntityContainer _entityContainer : schema.getEntityContainers()) {
+ final EntityContainerImpl entityContainer = (EntityContainerImpl) _entityContainer;
+ for (AssociationSet associationSet : entityContainer.getAssociationSets()) {
+ if (getName().equals(associationSet.getEnds().get(0).getEntitySet())
+ || getName().equals(associationSet.getEnds().get(1).getEntitySet())) {
+
+ candidateAssociationSets.add(associationSet);
+ }
+ }
+ }
+ }
+ if (candidateAssociationSets.isEmpty()) {
+ throw new EdmException("Cannot find any AssociationSet with first End: " + getName());
+ }
+
+ Schema targetSchema = null;
+ String targetEntitySet = null;
+ for (AssociationSet associationSet : candidateAssociationSets) {
+ for (Schema schema : xmlMetadata.getSchemas()) {
+ for (Association association : ((SchemaImpl) schema).getAssociations()) {
+ final FullQualifiedName associationName = new FullQualifiedName(schema.getNamespace(), association.getName());
+ if (associationName.getFullQualifiedNameAsString().equals(associationSet.getAssociation())
+ && (path.equals(association.getEnds().get(0).getRole())
+ || path.equals(association.getEnds().get(1).getRole()))) {
+
+ targetSchema = schema;
+ if (getName().equals(associationSet.getEnds().get(0).getEntitySet())) {
+ targetEntitySet = associationSet.getEnds().get(1).getEntitySet();
+ } else {
+ targetEntitySet = associationSet.getEnds().get(0).getEntitySet();
+ }
+ }
+ }
+ }
+ }
+ if (targetSchema == null || targetEntitySet == null) {
+ throw new EdmException("Cannot find Association for candidate AssociationSets and given Role");
+ }
+
+ final FullQualifiedName relatedFQN = new FullQualifiedName(targetSchema.getNamespace(), targetEntitySet);
+ final EdmEntityContainer entityContainer = edm.getEntityContainer(relatedFQN);
+ if (entityContainer == null) {
+ throw new EdmException("Cannot find EntityContainer with name: " + relatedFQN);
+ }
+
+ return entityContainer.getEntitySet(targetEntitySet);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmFunctionImportProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmFunctionImportProxy.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmFunctionImportProxy.java
new file mode 100644
index 0000000..c7d1de2
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmFunctionImportProxy.java
@@ -0,0 +1,48 @@
+/*
+ * 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.edm.v3;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.client.core.edm.EdmOperationImportImpl;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+
+public class EdmFunctionImportProxy extends EdmOperationImportImpl implements EdmFunctionImport {
+
+ private final FunctionImport functionImport;
+
+ public EdmFunctionImportProxy(final Edm edm, final EdmEntityContainer container, final String name,
+ final FunctionImport functionImport) {
+
+ super(edm, container, name, functionImport.getEntitySet());
+ this.functionImport = functionImport;
+ }
+
+ @Override
+ public EdmFunction getFunction(final List<String> parameterNames) {
+ return edm.getFunction(
+ new EdmTypeInfo(functionImport.getName(), container.getNamespace()).getFullQualifiedName(),
+ null, null, parameterNames);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmFunctionProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmFunctionProxy.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmFunctionProxy.java
new file mode 100644
index 0000000..d883f1d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmFunctionProxy.java
@@ -0,0 +1,43 @@
+/*
+ * 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.edm.v3;
+
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public class EdmFunctionProxy extends EdmOperationProxy implements EdmFunction {
+
+ public static EdmFunctionProxy getInstance(final Edm edm, final FullQualifiedName name,
+ final FunctionImport functionImport) {
+
+ return EdmFunctionProxy.getInstance(new EdmFunctionProxy(edm, name, functionImport));
+ }
+
+ private EdmFunctionProxy(final Edm edm, final FullQualifiedName name, final FunctionImport functionImport) {
+ super(edm, name, functionImport, EdmTypeKind.FUNCTION);
+ }
+
+ @Override
+ public boolean isComposable() {
+ return functionImport.isComposable();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmOperationProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmOperationProxy.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmOperationProxy.java
new file mode 100644
index 0000000..2876bb2
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmOperationProxy.java
@@ -0,0 +1,65 @@
+/*
+ * 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.edm.v3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.CommonParameter;
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.api.edm.xml.v3.Parameter;
+import org.apache.olingo.client.core.edm.EdmParameterImpl;
+import org.apache.olingo.client.core.edm.EdmReturnTypeImpl;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmParameter;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.commons.core.edm.AbstractEdmOperation;
+
+public class EdmOperationProxy extends AbstractEdmOperation {
+
+ protected final FunctionImport functionImport;
+
+ protected static <T extends EdmOperationProxy> T getInstance(final T instance) {
+ final List<Parameter> parameters = instance.functionImport.getParameters();
+ final List<EdmParameter> _parameters = new ArrayList<EdmParameter>(parameters.size());
+ for (CommonParameter parameter : parameters) {
+ _parameters.add(EdmParameterImpl.getInstance(instance.edm, parameter));
+ }
+ instance.setParameters(_parameters);
+
+ instance.setEntitySetPath(instance.functionImport.getEntitySetPath());
+
+ instance.setIsBound(instance.functionImport.isBindable());
+
+ if (instance.functionImport.getReturnType() != null) {
+ instance.setReturnType(EdmReturnTypeImpl.getInstance(instance.edm, new ReturnTypeProxy(instance.functionImport)));
+ }
+
+ return instance;
+ }
+
+ protected EdmOperationProxy(final Edm edm, final FullQualifiedName fqn, final FunctionImport functionImport,
+ final EdmTypeKind kind) {
+
+ super(edm, fqn, kind);
+ this.functionImport = functionImport;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmServiceMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmServiceMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmServiceMetadataImpl.java
new file mode 100644
index 0000000..d036d90
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/EdmServiceMetadataImpl.java
@@ -0,0 +1,98 @@
+/*
+ * 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.edm.v3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.UnsupportedInV3Exception;
+import org.apache.olingo.client.api.edm.xml.CommonFunctionImport;
+import org.apache.olingo.client.api.edm.xml.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.core.edm.AbstractEdmServiceMetadataImpl;
+import org.apache.olingo.client.core.edm.xml.v3.XMLMetadataImpl;
+import org.apache.olingo.commons.api.edm.EdmActionImportInfo;
+import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo;
+import org.apache.olingo.commons.api.edm.EdmSingletonInfo;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+import org.apache.olingo.commons.core.edm.EdmActionImportInfoImpl;
+import org.apache.olingo.commons.core.edm.EdmFunctionImportInfoImpl;
+
+public class EdmServiceMetadataImpl extends AbstractEdmServiceMetadataImpl {
+
+ private static final ODataServiceVersion SERVICE_VERSION = ODataServiceVersion.V30;
+
+ public EdmServiceMetadataImpl(final XMLMetadataImpl xmlMetadata) {
+ super(xmlMetadata);
+ }
+
+ @Override
+ public String getDataServiceVersion() {
+ return SERVICE_VERSION.toString();
+ }
+
+ @Override
+ public List<EdmSingletonInfo> getSingletonInfos() {
+ throw new UnsupportedInV3Exception();
+ }
+
+ @Override
+ public List<EdmFunctionImportInfo> getFunctionImportInfos() {
+ synchronized (this) {
+ if (functionImportInfos == null) {
+ functionImportInfos = new ArrayList<EdmFunctionImportInfo>();
+ for (Schema schema : xmlMetadata.getSchemas()) {
+ for (EntityContainer entityContainer : schema.getEntityContainers()) {
+ for (CommonFunctionImport functionImport : entityContainer.getFunctionImports()) {
+ final FunctionImport _funFunctionImport = (FunctionImport) functionImport;
+ if (V3FunctionImportUtils.canProxyFunction(_funFunctionImport)) {
+ functionImportInfos.add(
+ new EdmFunctionImportInfoImpl(entityContainer.getName(), functionImport.getName()));
+ }
+ }
+ }
+ }
+ }
+ return functionImportInfos;
+ }
+ }
+
+ @Override
+ public List<EdmActionImportInfo> getActionImportInfos() {
+ synchronized (this) {
+ if (actionImportInfos == null) {
+ actionImportInfos = new ArrayList<EdmActionImportInfo>();
+ for (Schema schema : xmlMetadata.getSchemas()) {
+ for (EntityContainer entityContainer : schema.getEntityContainers()) {
+ for (CommonFunctionImport functionImport : entityContainer.getFunctionImports()) {
+ final FunctionImport _funFunctionImport = (FunctionImport) functionImport;
+ if (!V3FunctionImportUtils.canProxyFunction(_funFunctionImport)) {
+ actionImportInfos.add(
+ new EdmActionImportInfoImpl(entityContainer.getName(), functionImport.getName()));
+ }
+ }
+ }
+ }
+ }
+ return actionImportInfos;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/ReturnTypeProxy.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/ReturnTypeProxy.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/ReturnTypeProxy.java
new file mode 100644
index 0000000..79baae3
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/ReturnTypeProxy.java
@@ -0,0 +1,62 @@
+/*
+ * 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.edm.v3;
+
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.api.edm.xml.v4.ReturnType;
+
+public class ReturnTypeProxy implements ReturnType {
+
+ private final FunctionImport functionImport;
+
+ public ReturnTypeProxy(final FunctionImport functionImport) {
+ this.functionImport = functionImport;
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return null;
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return null;
+ }
+
+ @Override
+ public Integer getScale() {
+ return null;
+ }
+
+ @Override
+ public String getSrid() {
+ return null;
+ }
+
+ @Override
+ public String getType() {
+ return functionImport.getReturnType();
+ }
+
+ @Override
+ public boolean isNullable() {
+ return false;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/V3FunctionImportUtils.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/V3FunctionImportUtils.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/V3FunctionImportUtils.java
new file mode 100644
index 0000000..9453d63
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v3/V3FunctionImportUtils.java
@@ -0,0 +1,36 @@
+/*
+ * 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.edm.v3;
+
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.api.http.HttpMethod;
+
+public final class V3FunctionImportUtils {
+
+ public static boolean canProxyFunction(final FunctionImport functionImport) {
+ return functionImport.getHttpMethod() == null
+ ? !functionImport.isSideEffecting()
+ : HttpMethod.GET.name().equals(functionImport.getHttpMethod());
+ }
+
+ private V3FunctionImportUtils() {
+ // empty 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/client/core/edm/v4/EdmServiceMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/EdmServiceMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/EdmServiceMetadataImpl.java
new file mode 100644
index 0000000..55cecc7
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/EdmServiceMetadataImpl.java
@@ -0,0 +1,105 @@
+/*
+ * 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.edm.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.CommonFunctionImport;
+import org.apache.olingo.client.api.edm.xml.v4.ActionImport;
+import org.apache.olingo.client.api.edm.xml.v4.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.v4.Schema;
+import org.apache.olingo.client.api.edm.xml.v4.Singleton;
+import org.apache.olingo.client.core.edm.AbstractEdmServiceMetadataImpl;
+import org.apache.olingo.client.core.edm.xml.v4.XMLMetadataImpl;
+import org.apache.olingo.commons.api.edm.EdmActionImportInfo;
+import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo;
+import org.apache.olingo.commons.api.edm.EdmSingletonInfo;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+import org.apache.olingo.commons.core.edm.EdmActionImportInfoImpl;
+import org.apache.olingo.commons.core.edm.EdmFunctionImportInfoImpl;
+import org.apache.olingo.commons.core.edm.EdmSingletonInfoImpl;
+
+public class EdmServiceMetadataImpl extends AbstractEdmServiceMetadataImpl {
+
+ private static final ODataServiceVersion SERVICE_VERSION = ODataServiceVersion.V40;
+
+ private List<EdmSingletonInfo> singletonInfos;
+
+ private List<EdmActionImportInfo> actionImportInfos;
+
+ public EdmServiceMetadataImpl(final XMLMetadataImpl xmlMetadata) {
+ super(xmlMetadata);
+ }
+
+ @Override
+ public String getDataServiceVersion() {
+ return SERVICE_VERSION.toString();
+ }
+
+ @Override
+ public List<EdmSingletonInfo> getSingletonInfos() {
+ synchronized (this) {
+ if (singletonInfos == null) {
+ singletonInfos = new ArrayList<EdmSingletonInfo>();
+ for (Schema schema : ((XMLMetadataImpl) xmlMetadata).getSchemas()) {
+ final EntityContainer entityContainer = (EntityContainer) schema.getDefaultEntityContainer();
+ for (Singleton singleton : entityContainer.getSingletons()) {
+ singletonInfos.add(new EdmSingletonInfoImpl(entityContainer.getName(), singleton.getName()));
+ }
+ }
+ }
+ return singletonInfos;
+ }
+ }
+
+ @Override
+ public List<EdmFunctionImportInfo> getFunctionImportInfos() {
+ synchronized (this) {
+ if (functionImportInfos == null) {
+ functionImportInfos = new ArrayList<EdmFunctionImportInfo>();
+ for (Schema schema : ((XMLMetadataImpl) xmlMetadata).getSchemas()) {
+ for (EntityContainer entityContainer : schema.getEntityContainers()) {
+ for (CommonFunctionImport functionImport : entityContainer.getFunctionImports()) {
+ functionImportInfos.add(
+ new EdmFunctionImportInfoImpl(entityContainer.getName(), functionImport.getName()));
+ }
+ }
+ }
+ }
+ }
+ return functionImportInfos;
+ }
+
+ @Override
+ public List<EdmActionImportInfo> getActionImportInfos() {
+ synchronized (this) {
+ if (actionImportInfos == null) {
+ actionImportInfos = new ArrayList<EdmActionImportInfo>();
+ for (Schema schema : ((XMLMetadataImpl) xmlMetadata).getSchemas()) {
+ final EntityContainer entityContainer = (EntityContainer) schema.getDefaultEntityContainer();
+ for (ActionImport actionImport : entityContainer.getActionImports()) {
+ actionImportInfos.add(new EdmActionImportInfoImpl(entityContainer.getName(), actionImport.getName()));
+ }
+ }
+ }
+ return actionImportInfos;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractAnnotations.java
new file mode 100644
index 0000000..13ddbca
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractAnnotations.java
@@ -0,0 +1,51 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public abstract class AbstractAnnotations extends AbstractEdmItem
+ implements org.apache.olingo.client.api.edm.xml.CommonAnnotations {
+
+ private static final long serialVersionUID = 4926640428016042620L;
+
+ @JsonProperty(value = "Target", required = true)
+ private String target;
+
+ @JsonProperty("Qualifier")
+ private String qualifier;
+
+ @Override
+ public String getTarget() {
+ return target;
+ }
+
+ public void setTarget(final String target) {
+ this.target = target;
+ }
+
+ @Override
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public void setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
new file mode 100644
index 0000000..30d2142
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.CommonNavigationProperty;
+import org.apache.olingo.client.api.edm.xml.CommonProperty;
+import org.apache.olingo.client.api.edm.xml.ComplexType;
+import org.apache.olingo.client.core.op.impl.ComplexTypeDeserializer;
+
+@JsonDeserialize(using = ComplexTypeDeserializer.class)
+public abstract class AbstractComplexType extends AbstractEdmItem implements ComplexType {
+
+ private static final long serialVersionUID = -4765071294433482957L;
+
+ private String name;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public CommonProperty getProperty(final String name) {
+ return getOneByName(name, getProperties());
+ }
+
+ @Override
+ public CommonNavigationProperty getNavigationProperty(final String name) {
+ return getOneByName(name, getNavigationProperties());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractDataServices.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractDataServices.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractDataServices.java
new file mode 100644
index 0000000..df505d0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractDataServices.java
@@ -0,0 +1,51 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.DataServices;
+
+@JsonDeserialize(using = DataServicesDeserializer.class)
+public abstract class AbstractDataServices extends AbstractEdmItem implements DataServices {
+
+ private static final long serialVersionUID = -9126377222393876166L;
+
+ private String dataServiceVersion;
+
+ private String maxDataServiceVersion;
+
+ @Override
+ public String getDataServiceVersion() {
+ return dataServiceVersion;
+ }
+
+ public void setDataServiceVersion(final String version) {
+ this.dataServiceVersion = version;
+ }
+
+ @Override
+ public String getMaxDataServiceVersion() {
+ return maxDataServiceVersion;
+ }
+
+ public void setMaxDataServiceVersion(final String version) {
+ this.maxDataServiceVersion = version;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmItem.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmItem.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmItem.java
new file mode 100644
index 0000000..656ba56
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmItem.java
@@ -0,0 +1,62 @@
+/*
+ * 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.edm.xml;
+
+import java.util.ArrayList;
+import java.util.Collection;
+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.client.api.edm.xml.Named;
+
+public abstract class AbstractEdmItem {
+
+ protected <T extends Named> T getOneByName(final String name, final Collection<T> items) {
+ final List<T> result = getAllByName(name, items);
+ return result.isEmpty() ? null : result.get(0);
+ }
+
+ protected <T extends Named> List<T> getAllByName(final String name, final Collection<T> items) {
+ final List<T> result = new ArrayList<T>();
+ for (T type : items) {
+ if (name.equals(type.getName())) {
+ result.add(type);
+ }
+ }
+ return result;
+ }
+
+ @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/client/core/edm/xml/AbstractEdmx.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmx.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmx.java
new file mode 100644
index 0000000..15b6e8c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmx.java
@@ -0,0 +1,52 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.DataServices;
+import org.apache.olingo.client.api.edm.xml.Edmx;
+
+@JsonDeserialize(using = EdmxDeserializer.class)
+public abstract class AbstractEdmx extends AbstractEdmItem implements Edmx {
+
+ private static final long serialVersionUID = -5480835122183091469L;
+
+ private String version;
+
+ private DataServices dataServices;
+
+ @Override
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(final String version) {
+ this.version = version;
+ }
+
+ @Override
+ public DataServices getDataServices() {
+ return dataServices;
+ }
+
+ public void setDataServices(final DataServices dataServices) {
+ this.dataServices = dataServices;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
new file mode 100644
index 0000000..ade3a6b
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
@@ -0,0 +1,105 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.CommonFunctionImport;
+import org.apache.olingo.client.api.edm.xml.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.EntitySet;
+import org.apache.olingo.client.core.op.impl.EntityContainerDeserializer;
+
+@JsonDeserialize(using = EntityContainerDeserializer.class)
+public abstract class AbstractEntityContainer extends AbstractEdmItem implements EntityContainer {
+
+ private static final long serialVersionUID = 4121974387552855032L;
+
+ private String name;
+
+ private String _extends;
+
+ private boolean lazyLoadingEnabled;
+
+ private boolean defaultEntityContainer;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getExtends() {
+ return _extends;
+ }
+
+ public void setExtends(final String _extends) {
+ this._extends = _extends;
+ }
+
+ @Override
+ public boolean isLazyLoadingEnabled() {
+ return lazyLoadingEnabled;
+ }
+
+ public void setLazyLoadingEnabled(final boolean lazyLoadingEnabled) {
+ this.lazyLoadingEnabled = lazyLoadingEnabled;
+ }
+
+ @Override
+ public boolean isDefaultEntityContainer() {
+ return defaultEntityContainer;
+ }
+
+ public void setDefaultEntityContainer(final boolean defaultEntityContainer) {
+ this.defaultEntityContainer = defaultEntityContainer;
+ }
+
+ @Override
+ public EntitySet getEntitySet(final String name) {
+ return getOneByName(name, getEntitySets());
+ }
+
+ /**
+ * Gets the first function import with given name.
+ *
+ * @param name name.
+ * @return function import.
+ */
+ @Override
+ public CommonFunctionImport getFunctionImport(final String name) {
+ return getOneByName(name, getFunctionImports());
+ }
+
+ /**
+ * Gets all function imports with given name.
+ *
+ * @param name name.
+ * @return function imports.
+ */
+ @Override
+ public List<? extends CommonFunctionImport> getFunctionImports(final String name) {
+ return getAllByName(name, getFunctionImports());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntitySet.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntitySet.java
new file mode 100644
index 0000000..722610a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntitySet.java
@@ -0,0 +1,52 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.EntitySet;
+import org.apache.olingo.client.core.op.impl.EntitySetDeserializer;
+
+@JsonDeserialize(using = EntitySetDeserializer.class)
+public abstract class AbstractEntitySet extends AbstractEdmItem implements EntitySet {
+
+ private static final long serialVersionUID = -6577263439520376420L;
+
+ private String name;
+
+ private String entityType;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getEntityType() {
+ return entityType;
+ }
+
+ public void setEntityType(final String entityType) {
+ this.entityType = entityType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityType.java
new file mode 100644
index 0000000..d30e124
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityType.java
@@ -0,0 +1,87 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.EntityKey;
+import org.apache.olingo.client.api.edm.xml.EntityType;
+import org.apache.olingo.client.core.op.impl.EntityTypeDeserializer;
+
+@JsonDeserialize(using = EntityTypeDeserializer.class)
+public abstract class AbstractEntityType extends AbstractComplexType implements EntityType {
+
+ private static final long serialVersionUID = -1579462552966168139L;
+
+ private boolean abstractEntityType = false;
+
+ private String baseType;
+
+ private boolean openType = false;
+
+ private boolean hasStream = false;
+
+ private EntityKeyImpl key;
+
+ @Override
+ public boolean isAbstractEntityType() {
+ return abstractEntityType;
+ }
+
+ public void setAbstractEntityType(final boolean abstractEntityType) {
+ this.abstractEntityType = abstractEntityType;
+ }
+
+ @Override
+ public String getBaseType() {
+ return baseType;
+ }
+
+ public void setBaseType(final String baseType) {
+ this.baseType = baseType;
+ }
+
+ @Override
+ public boolean isOpenType() {
+ return openType;
+ }
+
+ public void setOpenType(final boolean openType) {
+ this.openType = openType;
+ }
+
+ @Override
+ public EntityKeyImpl getKey() {
+ return key;
+ }
+
+ public void setKey(final EntityKey key) {
+ this.key = (EntityKeyImpl) key;
+ }
+
+ @Override
+ public boolean isHasStream() {
+ return hasStream;
+ }
+
+ public void setHasStream(final boolean hasStream) {
+ this.hasStream = hasStream;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEnumType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEnumType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEnumType.java
new file mode 100644
index 0000000..2afa794
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEnumType.java
@@ -0,0 +1,97 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.EnumType;
+import org.apache.olingo.client.api.edm.xml.Member;
+import org.apache.olingo.client.core.op.impl.EnumTypeDeserializer;
+
+@JsonDeserialize(using = EnumTypeDeserializer.class)
+public abstract class AbstractEnumType extends AbstractEdmItem implements EnumType {
+
+ private static final long serialVersionUID = 2688487586103418210L;
+
+ private String name;
+
+ private String underlyingType;
+
+ private boolean flags;
+
+ private final List<Member> members = new ArrayList<Member>();
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getUnderlyingType() {
+ return underlyingType;
+ }
+
+ public void setUnderlyingType(final String underlyingType) {
+ this.underlyingType = underlyingType;
+ }
+
+ @Override
+ public boolean isFlags() {
+ return flags;
+ }
+
+ public void setFlags(final boolean flags) {
+ this.flags = flags;
+ }
+
+ @Override
+ public Member getMember(final String name) {
+ Member result = null;
+ for (Member member : getMembers()) {
+ if (name.equals(member.getName())) {
+ result = member;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public Member getMember(final Integer value) {
+ Member result = null;
+ for (Member member : getMembers()) {
+ if (value.equals(member.getValue())) {
+ result = member;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public List<Member> getMembers() {
+ return members;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractMember.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractMember.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractMember.java
new file mode 100644
index 0000000..b16ee7d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractMember.java
@@ -0,0 +1,52 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.Member;
+
+public abstract class AbstractMember extends AbstractEdmItem implements Member {
+
+ private static final long serialVersionUID = -1852481655317148552L;
+
+ @JsonProperty(value = "Name", required = true)
+ private String name;
+
+ @JsonProperty("Value")
+ private String value;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(final String value) {
+ this.value = value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractNavigationProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractNavigationProperty.java
new file mode 100644
index 0000000..65c9a8f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractNavigationProperty.java
@@ -0,0 +1,40 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.CommonNavigationProperty;
+
+public class AbstractNavigationProperty extends AbstractEdmItem implements CommonNavigationProperty {
+
+ private static final long serialVersionUID = 3112463683071069594L;
+
+ @JsonProperty(value = "Name", required = true)
+ private String name;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractParameter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractParameter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractParameter.java
new file mode 100644
index 0000000..6733fdc
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractParameter.java
@@ -0,0 +1,95 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.CommonParameter;
+
+@JsonDeserialize(using = ParameterDeserializer.class)
+public abstract class AbstractParameter extends AbstractEdmItem implements CommonParameter {
+
+ private static final long serialVersionUID = -4305016554930334342L;
+
+ private String name;
+
+ private String type;
+
+ private boolean nullable = true;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ @Override
+ public boolean isNullable() {
+ return nullable;
+ }
+
+ public void setNullable(final boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public void setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(final Integer precision) {
+ this.precision = precision;
+ }
+
+ @Override
+ public Integer getScale() {
+ return scale;
+ }
+
+ public void setScale(final Integer scale) {
+ this.scale = scale;
+ }
+}
[08/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDurationTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDurationTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDurationTest.java
deleted file mode 100644
index 7384cea..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDurationTest.java
+++ /dev/null
@@ -1,104 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmDurationTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Duration.getEdmPrimitiveTypeInstance();
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("duration'P120D'", instance.toUriLiteral("P120D"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("P120D", instance.fromUriLiteral("duration'P120D'"));
-
- expectErrorInFromUriLiteral(instance, "");
- expectErrorInFromUriLiteral(instance, "Duration'PT1S'");
- expectErrorInFromUriLiteral(instance, "duration'PT1S\"");
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("PT10S", instance.valueToString(BigDecimal.TEN, null, null, null, null, null));
- assertEquals("-PT10S", instance.valueToString(BigDecimal.TEN.negate(), null, null, null, null, null));
- assertEquals("PT10S", instance.valueToString(BigDecimal.TEN, null, null, null, null, null));
- assertEquals("PT10S", instance.valueToString(BigDecimal.TEN, null, null, 0, null, null));
- assertEquals("-PT0.01S", instance.valueToString(BigDecimal.ONE.movePointLeft(2).negate(), null, null, 2, null,
- null));
- assertEquals("PT2M3S", instance.valueToString(123, null, null, null, null, null));
- assertEquals("PT2M3S", instance.valueToString((byte) 123, null, null, null, null, null));
- assertEquals("PT3H25M45S", instance.valueToString((short) 12345, null, null, null, null, null));
- assertEquals("P14288DT23H31M30S", instance.valueToString(1234567890L, null, null, null, null, null));
- assertEquals("P50903316DT2H25M4S", instance.valueToString(BigInteger.ONE.shiftLeft(42), null, null, null, null,
- null));
-
- expectFacetsErrorInValueToString(instance, BigDecimal.ONE.movePointLeft(1), null, null, null, null, null);
- expectFacetsErrorInValueToString(instance, BigDecimal.ONE.movePointLeft(1), null, null, 0, null, null);
-
- expectTypeErrorInValueToString(instance, "");
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(BigDecimal.TEN, instance.valueOfString("PT10S", null, null, null, null, null, BigDecimal.class));
- assertEquals(BigDecimal.TEN.negate(), instance.valueOfString("-PT10S", null, null, null, null, null,
- BigDecimal.class));
- assertEquals(BigDecimal.TEN, instance.valueOfString("PT10S", null, null, null, null, null, BigDecimal.class));
- assertEquals(BigDecimal.ONE.movePointLeft(1), instance.valueOfString("PT0.1S", null, null, 1, null, null,
- BigDecimal.class));
- assertEquals(Byte.valueOf((byte) 123), instance.valueOfString("PT2M3S", null, null, null, null, null, Byte.class));
- assertEquals(Short.valueOf((short) 123), instance.valueOfString("PT2M3S", null, null, null, null, null,
- Short.class));
- assertEquals(Integer.valueOf(12345), instance.valueOfString("PT3H25M45S", null, null, null, null, null,
- Integer.class));
- assertEquals(Long.valueOf(1234567890L), instance.valueOfString("P14288DT23H31M30S", null, null, null, null, null,
- Long.class));
- assertEquals(BigInteger.ONE.shiftLeft(42), instance.valueOfString("P50903316DT2H25M4S", null, null, null, null,
- null, BigInteger.class));
-
- expectFacetsErrorInValueOfString(instance, "PT1.1S", null, null, null, null, null);
- expectFacetsErrorInValueOfString(instance, "PT1H2M3.123S", null, null, 2, null, null);
- expectFacetsErrorInValueOfString(instance, "PT13H2M3.9S", null, null, 0, null, null);
-
- expectContentErrorInValueOfString(instance, "PT1H2M3S.1234");
- expectContentErrorInValueOfString(instance, "P2012Y2M29DT23H32M2S");
- expectContentErrorInValueOfString(instance, "PT-1H");
- expectContentErrorInValueOfString(instance, "PT");
-
- expectUnconvertibleErrorInValueOfString(instance, "-PT2M9S", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "PT2M8S", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "PT10H", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "P25000D", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "P123456789012345D", Long.class);
- // expectUnconvertibleErrorInValueOfString(instance, "PT1.1S", BigInteger.class);
-
- expectTypeErrorInValueOfString(instance, "PT0S");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmGuidTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmGuidTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmGuidTest.java
deleted file mode 100644
index bc39120..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmGuidTest.java
+++ /dev/null
@@ -1,67 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.UUID;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmGuidTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Guid.getEdmPrimitiveTypeInstance();
-
- @Test
- public void toUriLiteral() {
- assertEquals("aabbccdd-aabb-ccdd-eeff-aabbccddeeff",
- instance.toUriLiteral("aabbccdd-aabb-ccdd-eeff-aabbccddeeff"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("aabbccdd-aabb-ccdd-eeff-aabbccddeeff",
- instance.fromUriLiteral("aabbccdd-aabb-ccdd-eeff-aabbccddeeff"));
- }
-
- @Test
- public void valueToString() throws Exception {
- final UUID uuid = UUID.randomUUID();
- assertEquals(uuid.toString(), instance.valueToString(uuid, null, null, null, null, null));
-
- expectTypeErrorInValueToString(instance, 'A');
- }
-
- @Test
- public void valueOfString() throws Exception {
- final UUID uuid = UUID.fromString("aabbccdd-aabb-ccdd-eeff-aabbccddeeff");
-
- assertEquals(uuid, instance.valueOfString("aabbccdd-aabb-ccdd-eeff-aabbccddeeff", null, null, null, null, null,
- UUID.class));
- assertEquals(uuid, instance.valueOfString("AABBCCDD-AABB-CCDD-EEFF-AABBCCDDEEFF", null, null, null, null, null,
- UUID.class));
- assertEquals(uuid, instance.valueOfString("AABBCCDD-aabb-ccdd-eeff-AABBCCDDEEFF", null, null, null, null, null,
- UUID.class));
-
- expectContentErrorInValueOfString(instance, "AABBCCDDAABBCCDDEEFFAABBCCDDEEFF");
-
- expectTypeErrorInValueOfString(instance, uuid.toString());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt16Test.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt16Test.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt16Test.java
deleted file mode 100644
index 7c51505..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt16Test.java
+++ /dev/null
@@ -1,86 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmInt16Test extends PrimitiveTypeBaseTest {
-
- final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance();
-
- @Test
- public void testInt16Compatibility() {
- assertTrue(instance.isCompatible(Uint7.getInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
- }
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("127", instance.toUriLiteral("127"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("127", instance.fromUriLiteral("127"));
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("0", instance.valueToString(0, null, null, null, null, null));
- assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
- assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
- assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
- assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
- assertEquals("-32768", instance.valueToString(BigInteger.valueOf(Short.MIN_VALUE), null, null, null, null, null));
-
- expectContentErrorInValueToString(instance, 123456);
- expectContentErrorInValueToString(instance, -32769);
- expectContentErrorInValueToString(instance, BigInteger.valueOf(32768));
-
- expectTypeErrorInValueToString(instance, 1.0);
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(Byte.valueOf((byte) 1), instance.valueOfString("1", null, null, null, null, null, Byte.class));
- assertEquals(Short.valueOf((short) 2), instance.valueOfString("2", null, null, null, null, null, Short.class));
- assertEquals(Short.valueOf((short) -32768), instance.valueOfString("-32768", null, null, null, null, null,
- Short.class));
- assertEquals(Short.valueOf((short) 32767), instance.valueOfString("32767", null, null, null, null, null,
- Short.class));
- assertEquals(Integer.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Integer.class));
- assertEquals(Long.valueOf(-1), instance.valueOfString("-1", null, null, null, null, null, Long.class));
- assertEquals(BigInteger.TEN, instance.valueOfString("10", null, null, null, null, null, BigInteger.class));
-
- expectContentErrorInValueOfString(instance, "32768");
- expectContentErrorInValueOfString(instance, "1.0");
-
- expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
-
- expectTypeErrorInValueOfString(instance, "1");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt32Test.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt32Test.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt32Test.java
deleted file mode 100644
index 414e984..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt32Test.java
+++ /dev/null
@@ -1,87 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmInt32Test extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance();
-
- @Test
- public void compatibility() {
- assertTrue(instance.isCompatible(Uint7.getInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
- }
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("127", instance.toUriLiteral("127"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("127", instance.fromUriLiteral("127"));
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("0", instance.valueToString(0, null, null, null, null, null));
- assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
- assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
- assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
- assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
- assertEquals("-2147483648", instance.valueToString(BigInteger.valueOf(Integer.MIN_VALUE), null, null, null, null,
- null));
-
- expectContentErrorInValueToString(instance, 12345678901L);
- expectContentErrorInValueToString(instance, -2147483649L);
- expectContentErrorInValueToString(instance, BigInteger.valueOf(2147483648L));
-
- expectTypeErrorInValueToString(instance, 1.0);
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(Byte.valueOf((byte) 1), instance.valueOfString("1", null, null, null, null, null, Byte.class));
- assertEquals(Short.valueOf((short) 2), instance.valueOfString("2", null, null, null, null, null, Short.class));
- assertEquals(Integer.valueOf(-10000000), instance.valueOfString("-10000000", null, null, null, null, null,
- Integer.class));
- assertEquals(Long.valueOf(10000000), instance.valueOfString("10000000", null, null, null, null, null, Long.class));
- assertEquals(BigInteger.TEN, instance.valueOfString("10", null, null, null, null, null, BigInteger.class));
-
- expectContentErrorInValueOfString(instance, "-2147483649");
- expectContentErrorInValueOfString(instance, "1.0");
-
- expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
-
- expectTypeErrorInValueOfString(instance, "1");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt64Test.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt64Test.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt64Test.java
deleted file mode 100644
index 35fe137..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt64Test.java
+++ /dev/null
@@ -1,94 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmInt64Test extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance();
-
- @Test
- public void compatibility() {
- assertTrue(instance.isCompatible(Uint7.getInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance()));
- }
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("127", instance.toUriLiteral("127"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("127", instance.fromUriLiteral("127"));
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("0", instance.valueToString(0, null, null, null, null, null));
- assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
- assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
- assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
- assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
- assertEquals("12345678901", instance.valueToString(12345678901L, null, null, null, null, null));
- assertEquals("1234567890123456789", instance.valueToString(new BigInteger("1234567890123456789"), null, null, null,
- null, null));
- assertEquals("-1234567890123456789", instance.valueToString(new BigInteger("-1234567890123456789"), null, null,
- null, null, null));
-
- expectContentErrorInValueToString(instance, new BigInteger("123456789012345678901"));
-
- expectTypeErrorInValueToString(instance, 1.0);
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(Short.valueOf((short) 1), instance.valueOfString("1", null, null, null, null, null, Short.class));
- assertEquals(Integer.valueOf(2), instance.valueOfString("2", null, null, null, null, null, Integer.class));
- assertEquals(Long.valueOf(-1234567890123456789L), instance.valueOfString("-1234567890123456789", null, null, null,
- null, null, Long.class));
- assertEquals(BigInteger.ONE, instance.valueOfString("1", null, null, null, null, null, BigInteger.class));
- assertEquals(Long.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Long.class));
- assertEquals(Byte.valueOf((byte) 0), instance.valueOfString("0", null, null, null, null, null, Byte.class));
-
- expectContentErrorInValueOfString(instance, "-12345678901234567890");
- expectContentErrorInValueOfString(instance, "1.0");
- expectContentErrorInValueOfString(instance, "0L");
- expectContentErrorInValueOfString(instance, "0x42");
-
- expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "-2147483649", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "2147483648", Integer.class);
-
- expectTypeErrorInValueOfString(instance, "1");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmNullTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmNullTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmNullTest.java
deleted file mode 100644
index 9756393..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmNullTest.java
+++ /dev/null
@@ -1,49 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertNull;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmNullTest extends PrimitiveTypeBaseTest {
-
- @Test
- public void checkNull() throws Exception {
- for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
- final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
- assertNull(instance.valueToString(null, null, null, null, null, null));
- assertNull(instance.valueToString(null, true, null, null, null, null));
-
- expectNullErrorInValueToString(instance);
- }
- }
-
- @Test
- public void checkValueOfNull() throws Exception {
- for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
- final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
- assertNull(instance.valueOfString(null, null, null, null, null, null, instance.getDefaultType()));
- assertNull(instance.valueOfString(null, true, null, null, null, null, instance.getDefaultType()));
-
- expectNullErrorInValueOfString(instance);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSByteTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSByteTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSByteTest.java
deleted file mode 100644
index 68296e7..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSByteTest.java
+++ /dev/null
@@ -1,80 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmSByteTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance();
-
- @Test
- public void compatibility() {
- assertTrue(instance.isCompatible(Uint7.getInstance()));
- }
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("127", instance.toUriLiteral("127"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("127", instance.fromUriLiteral("127"));
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("0", instance.valueToString(0, null, null, null, null, null));
- assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
- assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
- assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
- assertEquals("64", instance.valueToString(64L, null, null, null, null, null));
- assertEquals("-128", instance.valueToString(BigInteger.valueOf(Byte.MIN_VALUE), null, null, null, null, null));
-
- expectContentErrorInValueToString(instance, -129);
- expectContentErrorInValueToString(instance, 128);
- expectContentErrorInValueToString(instance, BigInteger.valueOf(128));
-
- expectTypeErrorInValueToString(instance, 'A');
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(Byte.valueOf((byte) 1), instance.valueOfString("1", null, null, null, null, null, Byte.class));
- assertEquals(Short.valueOf((short) -2), instance.valueOfString("-2", null, null, null, null, null, Short.class));
- assertEquals(Byte.valueOf((byte) 127), instance.valueOfString("127", null, null, null, null, null, Byte.class));
- assertEquals(Byte.valueOf((byte) -128), instance.valueOfString("-128", null, null, null, null, null, Byte.class));
- assertEquals(Integer.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Integer.class));
- assertEquals(Long.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Long.class));
- assertEquals(BigInteger.TEN, instance.valueOfString("10", null, null, null, null, null, BigInteger.class));
-
- expectContentErrorInValueOfString(instance, "128");
- expectContentErrorInValueOfString(instance, "-129");
- expectContentErrorInValueOfString(instance, "1.0");
-
- expectTypeErrorInValueOfString(instance, "1");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSingleTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSingleTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSingleTest.java
deleted file mode 100644
index 366a7a6..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSingleTest.java
+++ /dev/null
@@ -1,136 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmSingleTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance();
-
- @Test
- public void compatibility() {
- assertTrue(instance.isCompatible(Uint7.getInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance()));
- }
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("127", instance.toUriLiteral("127"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("127", instance.fromUriLiteral("127"));
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("0", instance.valueToString(0, null, null, null, null, null));
- assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
- assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
- assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
- assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
- assertEquals("0.00390625", instance.valueToString(1.0 / 256, null, null, null, null, null));
- assertEquals("4.2E-8", instance.valueToString(42e-9, null, null, null, null, null));
- assertEquals("INF", instance.valueToString(Double.POSITIVE_INFINITY, null, null, null, null, null));
- assertEquals("-INF", instance.valueToString(Double.NEGATIVE_INFINITY, null, null, null, null, null));
- assertEquals("NaN", instance.valueToString(Double.NaN, null, null, null, null, null));
- assertEquals("-0.125", instance.valueToString(-0.125f, null, null, null, null, null));
- assertEquals("INF", instance.valueToString(Float.POSITIVE_INFINITY, null, null, null, null, null));
- assertEquals("-INF", instance.valueToString(Float.NEGATIVE_INFINITY, null, null, null, null, null));
- assertEquals("NaN", instance.valueToString(Float.NaN, null, null, null, null, null));
- assertEquals("-123456.75", instance.valueToString(new BigDecimal("-123456.75"), null, null, null, null, null));
-
- expectContentErrorInValueToString(instance, 12345678L);
- expectContentErrorInValueToString(instance, new BigDecimal("123456789"));
- expectContentErrorInValueToString(instance, new BigDecimal(BigInteger.ONE, -39));
- expectContentErrorInValueToString(instance, 42e38);
- expectContentErrorInValueToString(instance, 12345.6789);
- expectContentErrorInValueToString(instance, 1E-50);
-
- expectTypeErrorInValueToString(instance, 'A');
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(Float.valueOf(1.42F), instance.valueOfString("1.42", null, null, null, null, null, Float.class));
- assertEquals(Double.valueOf(-42.42), instance.valueOfString("-42.42", null, null, null, null, null, Double.class));
- assertEquals(Float.valueOf(42.0F), instance.valueOfString("42", null, null, null, null, null, Float.class));
- assertEquals(Float.valueOf(2.2E38F), instance.valueOfString("22E37", null, null, null, null, null, Float.class));
- assertEquals(Float.valueOf(1.23E-38F), instance.valueOfString("12.3E-39", null, null, null, null, null,
- Float.class));
- assertEquals(BigDecimal.TEN, instance.valueOfString("10", null, null, null, null, null, BigDecimal.class));
- assertEquals(Byte.valueOf((byte) 0), instance.valueOfString("0", null, null, null, null, null, Byte.class));
- assertEquals(Short.valueOf((short) 1), instance.valueOfString("1.00", null, null, null, null, null, Short.class));
- assertEquals(Integer.valueOf(42), instance.valueOfString("4.2E1", null, null, null, null, null, Integer.class));
- assertEquals(Long.valueOf(12345678), instance.valueOfString("12345.678E+03", null, null, null, null, null,
- Long.class));
-
- assertEquals(Float.valueOf(Float.NaN), instance.valueOfString("NaN", null, null, null, null, null, Float.class));
- assertEquals(Float.valueOf(Float.NEGATIVE_INFINITY), instance.valueOfString("-INF", null, null, null, null, null,
- Float.class));
- assertEquals(Float.valueOf(Float.POSITIVE_INFINITY), instance.valueOfString("INF", null, null, null, null, null,
- Float.class));
- assertEquals(Double.valueOf(Double.NaN), instance.valueOfString("NaN", null, null, null, null, null,
- Double.class));
- assertEquals(Double.valueOf(Double.NEGATIVE_INFINITY), instance.valueOfString("-INF", null, null, null, null, null,
- Double.class));
-
- expectContentErrorInValueOfString(instance, "0.");
- expectContentErrorInValueOfString(instance, ".0");
- expectContentErrorInValueOfString(instance, "1E-50");
- expectContentErrorInValueOfString(instance, "12345.6789");
- expectContentErrorInValueOfString(instance, "42E42");
- expectContentErrorInValueOfString(instance, "42.42.42");
- expectContentErrorInValueOfString(instance, "42.42.42");
- expectContentErrorInValueOfString(instance, "42D");
- expectContentErrorInValueOfString(instance, "0x42P4");
-
- expectUnconvertibleErrorInValueOfString(instance, "INF", BigDecimal.class);
- expectUnconvertibleErrorInValueOfString(instance, "NaN", BigDecimal.class);
- expectUnconvertibleErrorInValueOfString(instance, "-INF", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "NaN", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "5E-1", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "5E-1", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "5E-1", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "5E-1", Long.class);
- expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "-2147483.65E3", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "2147483.65E3", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "-1E19", Long.class);
- expectUnconvertibleErrorInValueOfString(instance, "1E19", Long.class);
-
- expectTypeErrorInValueOfString(instance, "1.42");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmStringTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmStringTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmStringTest.java
deleted file mode 100644
index ecd89fd..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmStringTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmStringTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance();
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("'StringValue'", instance.toUriLiteral("StringValue"));
- assertEquals("'String''Value'", instance.toUriLiteral("String'Value"));
- assertEquals("'String''''''Value'", instance.toUriLiteral("String'''Value"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("String''Value", instance.fromUriLiteral("'String''''Value'"));
-
- expectErrorInFromUriLiteral(instance, "");
- expectErrorInFromUriLiteral(instance, "'");
- expectErrorInFromUriLiteral(instance, "'\"");
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("text", instance.valueToString("text", null, null, null, null, null));
- assertEquals("a\nb", instance.valueToString("a\nb", null, null, null, null, null));
- assertEquals("true", instance.valueToString(true, null, null, null, null, null));
- assertEquals("a'b", instance.valueToString("a'b", null, null, null, null, null));
-
- assertEquals("text", instance.valueToString("text", null, null, null, null, true));
- assertEquals("text", instance.valueToString("text", null, 4, null, null, null));
- assertEquals("text", instance.valueToString("text", null, Integer.MAX_VALUE, null, null, null));
-
- expectFacetsErrorInValueToString(instance, "schräg", null, null, null, null, false);
- expectFacetsErrorInValueToString(instance, "text", null, 3, null, null, null);
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals("text", instance.valueOfString("text", null, null, null, null, null, String.class));
- assertEquals("a\nb", instance.valueOfString("a\nb", null, null, null, null, null, String.class));
- assertEquals("true", instance.valueOfString("true", null, null, null, null, null, String.class));
- assertEquals("'a''b'", instance.valueOfString("'a''b'", null, null, null, null, null, String.class));
-
- assertEquals("text", instance.valueOfString("text", null, null, null, null, true, String.class));
- assertEquals("text", instance.valueOfString("text", null, 4, null, null, null, String.class));
- assertEquals("text", instance.valueOfString("text", null, Integer.MAX_VALUE, null, null, null, String.class));
-
- expectFacetsErrorInValueOfString(instance, "schräg", null, null, null, null, false);
- expectFacetsErrorInValueOfString(instance, "text", null, 3, null, null, null);
-
- expectTypeErrorInValueOfString(instance, "text");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmTimeOfDayTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmTimeOfDayTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmTimeOfDayTest.java
deleted file mode 100644
index ae342f4..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmTimeOfDayTest.java
+++ /dev/null
@@ -1,92 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Calendar;
-import java.util.TimeZone;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmTimeOfDayTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.TimeOfDay.getEdmPrimitiveTypeInstance();
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("11:12", instance.toUriLiteral("11:12"));
- assertEquals("11:12:13.012", instance.toUriLiteral("11:12:13.012"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("11:12", instance.fromUriLiteral("11:12"));
- assertEquals("11:12:13.012", instance.fromUriLiteral("11:12:13.012"));
- }
-
- @Test
- public void valueToString() throws Exception {
- Calendar dateTime = Calendar.getInstance();
- dateTime.clear();
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT+11:30"));
- dateTime.set(1, 2, 3, 4, 5, 6);
- assertEquals("04:05:06", instance.valueToString(dateTime, null, null, null, null, null));
-
- dateTime.add(Calendar.MILLISECOND, 42);
- assertEquals("04:05:06.042", instance.valueToString(dateTime, null, null, 3, null, null));
- assertEquals("04:05:06.042", instance.valueToString(dateTime, null, null, 4, null, null));
-
- expectFacetsErrorInValueToString(instance, dateTime, null, null, null, null, null);
- expectFacetsErrorInValueToString(instance, dateTime, null, null, 2, null, null);
-
- expectTypeErrorInValueToString(instance, 0);
- }
-
- @Test
- public void valueOfString() throws Exception {
- Calendar dateTime = Calendar.getInstance();
- dateTime.clear();
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
-
- assertEquals(dateTime, instance.valueOfString("00:00", null, null, null, null, null, Calendar.class));
- assertEquals(dateTime, instance.valueOfString("00:00:00", null, null, null, null, null, Calendar.class));
- assertEquals(dateTime, instance.valueOfString("00:00:00.000000000000", null, null, null, null, null,
- Calendar.class));
-
- dateTime.set(Calendar.MILLISECOND, 999);
- assertEquals(dateTime, instance.valueOfString("00:00:00.999", null, null, 3, null, null, Calendar.class));
- assertEquals(dateTime, instance.valueOfString("00:00:00.999", null, null, 3, null, null, Calendar.class));
-
- expectFacetsErrorInValueOfString(instance, "11:12:13.123", null, null, null, null, null);
- expectFacetsErrorInValueOfString(instance, "11:12:13.123", null, null, 2, null, null);
-
- expectContentErrorInValueOfString(instance, "24:32:02");
- expectContentErrorInValueOfString(instance, "011:12:13");
- expectContentErrorInValueOfString(instance, "11:12:13:14");
- expectContentErrorInValueOfString(instance, "111213");
- expectContentErrorInValueOfString(instance, "1:2:3");
- expectContentErrorInValueOfString(instance, "11:12:13.0.1");
- expectContentErrorInValueOfString(instance, "11:12:13.");
- expectContentErrorInValueOfString(instance, "11:12:13.0000000000000");
-
- expectTypeErrorInValueOfString(instance, "11:12:13");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/PrimitiveTypeBaseTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/PrimitiveTypeBaseTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/PrimitiveTypeBaseTest.java
deleted file mode 100644
index a1949ea..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/PrimitiveTypeBaseTest.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-public abstract class PrimitiveTypeBaseTest {
-
- private void expectErrorInValueToString(final EdmPrimitiveType instance,
- final Object value, final Boolean isNullable, final Integer maxLength,
- final Integer precision, final Integer scale, final Boolean isUnicode,
- final String messageReferenceString) {
- try {
- instance.valueToString(value, isNullable, maxLength, precision, scale, isUnicode);
- fail("Expected exception not thrown");
- } catch (final EdmPrimitiveTypeException e) {
- assertNotNull(e.getLocalizedMessage());
- assertTrue(e.getLocalizedMessage().startsWith(messageReferenceString));
- }
- }
-
- private void expectErrorInValueToString(final EdmPrimitiveType instance, final Object value,
- final String messageReference) {
- expectErrorInValueToString(instance, value, null, null, null, null, null, messageReference);
- }
-
- protected void expectTypeErrorInValueToString(final EdmPrimitiveType instance, final Object value) {
- expectErrorInValueToString(instance, value, "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED");
- }
-
- protected void expectContentErrorInValueToString(final EdmPrimitiveType instance, final Object value) {
- expectErrorInValueToString(instance, value, "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT");
- }
-
- protected void expectFacetsErrorInValueToString(final EdmPrimitiveType instance, final Object value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) {
- expectErrorInValueToString(instance, value, isNullable, maxLength, precision, scale, isUnicode,
- "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED");
- }
-
- protected void expectNullErrorInValueToString(final EdmPrimitiveType instance) {
- expectErrorInValueToString(instance, null, false, null, null, null, null,
- "EdmPrimitiveTypeException.VALUE_NULL_NOT_ALLOWED");
- }
-
- private void expectErrorInValueOfString(final EdmPrimitiveType instance,
- final String value, final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<?> returnType,
- final String messageReferenceString) {
-
- try {
- instance.valueOfString(value, isNullable, maxLength, precision, scale, isUnicode, returnType);
- fail("Expected exception not thrown");
- } catch (final EdmPrimitiveTypeException e) {
- assertNotNull(e.getLocalizedMessage());
- assertTrue(e.getLocalizedMessage().startsWith(messageReferenceString));
- }
- }
-
- protected void expectTypeErrorInValueOfString(final EdmPrimitiveType instance, final String value) {
- expectErrorInValueOfString(instance, value, null, null, null, null, null, Class.class,
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED");
- }
-
- protected void expectUnconvertibleErrorInValueOfString(final EdmPrimitiveType instance, final String value,
- final Class<?> type) {
- expectErrorInValueOfString(instance, value, null, null, null, null, null, type,
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE");
- }
-
- protected void expectContentErrorInValueOfString(final EdmPrimitiveType instance, final String value) {
- expectErrorInValueOfString(instance, value, null, null, null, null, null, instance.getDefaultType(),
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT");
- }
-
- protected void expectFacetsErrorInValueOfString(final EdmPrimitiveType instance, final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) {
- expectErrorInValueOfString(instance, value, isNullable, maxLength, precision, scale, isUnicode,
- instance.getDefaultType(), "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED");
- }
-
- protected void expectNullErrorInValueOfString(final EdmPrimitiveType instance) {
- expectErrorInValueOfString(instance, null, false, null, null, null, null, instance.getDefaultType(),
- "EdmPrimitiveTypeException.LITERAL_NULL_NOT_ALLOWED");
- }
-
- protected void expectErrorInFromUriLiteral(final EdmPrimitiveType instance, final String value) {
- try {
- instance.fromUriLiteral(value);
- fail("Expected exception not thrown");
- } catch (final EdmPrimitiveTypeException e) {
- assertNotNull(e.getLocalizedMessage());
- assertTrue(e.getLocalizedMessage().startsWith("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT"));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/UInt7Test.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/UInt7Test.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/UInt7Test.java
deleted file mode 100644
index b9c25fd..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/UInt7Test.java
+++ /dev/null
@@ -1,33 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class UInt7Test extends PrimitiveTypeBaseTest {
-
- @Test
- public void compatibility() {
- assertTrue(Uint7.getInstance().isCompatible(Uint7.getInstance()));
- assertFalse(Uint7.getInstance().isCompatible(EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance()));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Action.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Action.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Action.java
deleted file mode 100644
index ee4a3c4..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Action.java
+++ /dev/null
@@ -1,54 +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.server.api.edm.provider;
-
-import java.util.List;
-
-public class Action extends Operation {
-
- @Override
- public Action setName(final String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public Action setBound(final boolean isBound) {
- this.isBound = isBound;
- return this;
- }
-
- @Override
- public Action setEntitySetPath(final EntitySetPath entitySetPath) {
- this.entitySetPath = entitySetPath;
- return this;
- }
-
- @Override
- public Action setParameters(final List<Parameter> parameters) {
- this.parameters = parameters;
- return this;
- }
-
- @Override
- public Action setReturnType(final ReturnType returnType) {
- this.returnType = returnType;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ActionImport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ActionImport.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ActionImport.java
deleted file mode 100644
index 9311094..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ActionImport.java
+++ /dev/null
@@ -1,48 +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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.Target;
-
-public class ActionImport extends OperationImport {
-
- private FullQualifiedName action;
-
- @Override
- public ActionImport setName(final String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public ActionImport setEntitySet(final Target entitySet) {
- this.entitySet = entitySet;
- return this;
- }
-
- public FullQualifiedName getAction() {
- return action;
- }
-
- public ActionImport setAction(final FullQualifiedName action) {
- this.action = action;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/AliasInfo.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/AliasInfo.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/AliasInfo.java
deleted file mode 100644
index 3ab5b61..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/AliasInfo.java
+++ /dev/null
@@ -1,45 +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.server.api.edm.provider;
-
-public class AliasInfo {
-
- private String namespace;
-
- private String alias;
-
- public String getNamespace() {
- return namespace;
- }
-
- public AliasInfo setNamespace(final String namespace) {
- this.namespace = namespace;
- return this;
- }
-
- public String getAlias() {
- return alias;
- }
-
- public AliasInfo setAlias(final String alias) {
- this.alias = alias;
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Annotation.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Annotation.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Annotation.java
deleted file mode 100644
index 3f3280b..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Annotation.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 org.apache.olingo.odata4.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class Annotation {
-
- private FullQualifiedName term;
-
- // Target should be a target path
-// private String targetPath;
- private String qualifier;
-
- private Expression expression;
-
- private List<Annotation> annotation;
-
- public FullQualifiedName getTerm() {
- return term;
- }
-
- public Annotation setTerm(final FullQualifiedName term) {
- this.term = term;
- return this;
- }
-
- public String getQualifier() {
- return qualifier;
- }
-
- public Annotation setQualifier(final String qualifier) {
- this.qualifier = qualifier;
- return this;
- }
-
- public Expression getExpression() {
- return expression;
- }
-
- public Annotation setExpression(final Expression expression) {
- this.expression = expression;
- return this;
- }
-
- public List<Annotation> getAnnotation() {
- return annotation;
- }
-
- public Annotation setAnnotation(final List<Annotation> annotation) {
- this.annotation = annotation;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/BindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/BindingTarget.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/BindingTarget.java
deleted file mode 100644
index dccec29..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/BindingTarget.java
+++ /dev/null
@@ -1,60 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public abstract class BindingTarget {
-
- protected String name;
-
- protected FullQualifiedName type;
-
- protected List<NavigationPropertyBinding> navigationPropertyBindings;
-
- public String getName() {
- return name;
- }
-
- public BindingTarget setName(final String name) {
- this.name = name;
- return this;
- }
-
- public FullQualifiedName getType() {
- return type;
- }
-
- public BindingTarget setType(final FullQualifiedName type) {
- this.type = type;
- return this;
- }
-
- public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
- return navigationPropertyBindings;
- }
-
- public BindingTarget setNavigationPropertyBindings(final List<NavigationPropertyBinding> navigationPropertyBindings) {
- this.navigationPropertyBindings = navigationPropertyBindings;
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ComplexType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ComplexType.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ComplexType.java
deleted file mode 100644
index 4857b37..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ComplexType.java
+++ /dev/null
@@ -1,62 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class ComplexType extends StructuredType {
-
- @Override
- public ComplexType setName(final String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public ComplexType setOpenType(final boolean isOpenType) {
- this.isOpenType = isOpenType;
- return this;
- }
-
- @Override
- public ComplexType setBaseType(final FullQualifiedName baseType) {
- this.baseType = baseType;
- return this;
- }
-
- @Override
- public ComplexType setAbstract(final boolean isAbstract) {
- this.isAbstract = isAbstract;
- return this;
- }
-
- @Override
- public ComplexType setProperties(final List<Property> properties) {
- this.properties = properties;
- return this;
- }
-
- @Override
- public ComplexType setNavigationProperties(final List<NavigationProperty> navigationProperties) {
- this.navigationProperties = navigationProperties;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EdmProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EdmProvider.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EdmProvider.java
deleted file mode 100644
index 7381803..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EdmProvider.java
+++ /dev/null
@@ -1,182 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.ODataException;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public abstract class EdmProvider {
-
- /**
- * This method should return an {@link EnumType} or <b>null</b> if nothing is found
- *
- * @param enumTypeName
- * @return {@link EnumType} for given name
- * @throws ODataException
- */
- public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
- return null;
- }
-
- /**
- * This method should return an {@link TypeDefinition} or <b>null</b> if nothing is found
- *
- * @param typeDefinitionName
- * @return {@link TypeDefinition} for given name
- * @throws ODataException
- */
- public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException {
- return null;
- }
-
- /**
- * This method should return an {@link EntityType} or <b>null</b> if nothing is found
- *
- * @param entityTypeName
- * @return {@link EntityType} for the given name
- * @throws ODataException
- */
- public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
- return null;
- }
-
- /**
- * This method should return a {@link ComplexType} or <b>null</b> if nothing is found
- *
- * @param complexTypeName
- * @return {@link StructuralType} for the given name
- * @throws ODataException
- */
- public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
- return null;
- }
-
- /**
- * This method should return a list of all {@link Action} for the FullQualifiedname or <b>null</b> if nothing is found
- *
- * @param actionName
- * @return List of {@link Action} or null
- * @throws ODataException
- */
- public List<Action> getActions(final FullQualifiedName actionName) throws ODataException {
- return null;
- }
-
- /**
- * This method should return a list of all {@link Function} for the FullQualifiedname or <b>null</b> if nothing is
- * found
- *
- * @param functionName
- * @return List of {@link Function} or null
- * @throws ODataException
- */
- public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
- return null;
- }
-
- // TODO: document
- public Term getTerm(final FullQualifiedName termName) throws ODataException {
- return null;
- }
-
- /**
- * This method should return an {@link EntitySet} or <b>null</b> if nothing is found
- *
- * @param entityContainer this EntitySet is contained in
- * @param entitySetName
- * @return {@link EntitySet} for the given container and entityset name
- * @throws ODataException
- */
- public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
- throws ODataException {
- return null;
- }
-
- /**
- * This method should return an {@link Singleton} or <b>null</b> if nothing is found
- *
- * @param entityContainer this Singleton is contained in
- * @param singletonName
- * @return {@link Singleton} for given container and singleton name
- * @throws ODataException
- */
- public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
- throws ODataException {
- return null;
- }
-
- /**
- * This method should return an {@link ActionImport} or <b>null</b> if nothing is found
- *
- * @param entityContainer this ActionImport is contained in
- * @param actionImportName
- * @return {@link ActionImport} for the given container and ActionImport name
- * @throws ODataException
- */
- public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
- throws ODataException {
- return null;
- }
-
- /**
- * This method should return a {@link FunctionImport} or <b>null</b> if nothing is found
- *
- * @param entityContainer this FunctionImport is contained in
- * @param functionImportName
- * @return {@link FunctionImport} for the given container name and function import name
- * @throws ODataException
- */
- public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
- throws ODataException {
- return null;
- }
-
- /**
- * This method should return an {@link EntityContainerInfo} or <b>null</b> if nothing is found
- *
- * @param entityContainerName (null for default container)
- * @return {@link EntityContainerInfo} for the given name
- * @throws ODataException
- */
- public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException {
- return null;
- }
-
- /**
- * This method should return a list of all namespaces which have an alias
- *
- * @return List of alias info
- * @throws ODataException
- */
- public List<AliasInfo> getAliasInfos() throws ODataException {
- return null;
- }
-
- /**
- * This method should return a collection of all {@link Schema}
- *
- * @return List<{@link Schema}>
- * @throws ODataException
- */
- public List<Schema> getSchemas() throws ODataException {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityContainer.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityContainer.java
deleted file mode 100644
index 70a702f..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityContainer.java
+++ /dev/null
@@ -1,93 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class EntityContainer {
-
- private String name;
-
- private FullQualifiedName extendsContainer;
-
- private List<EntitySet> entitySets;
-
- private List<ActionImport> actionImports;
-
- private List<FunctionImport> functionImports;
-
- private List<Singleton> singletons;
-
- // Annotations
- public String getName() {
- return name;
- }
-
- public EntityContainer setName(final String name) {
- this.name = name;
- return this;
- }
-
- public FullQualifiedName getExtendsContainer() {
- return extendsContainer;
- }
-
- public EntityContainer setExtendsContainer(final FullQualifiedName extendsContainer) {
- this.extendsContainer = extendsContainer;
- return this;
- }
-
- public List<EntitySet> getEntitySets() {
- return entitySets;
- }
-
- public EntityContainer setEntitySets(final List<EntitySet> entitySets) {
- this.entitySets = entitySets;
- return this;
- }
-
- public List<ActionImport> getActionImports() {
- return actionImports;
- }
-
- public EntityContainer setActionImports(final List<ActionImport> actionImports) {
- this.actionImports = actionImports;
- return this;
- }
-
- public List<FunctionImport> getFunctionImports() {
- return functionImports;
- }
-
- public EntityContainer setFunctionImports(final List<FunctionImport> functionImports) {
- this.functionImports = functionImports;
- return this;
- }
-
- public List<Singleton> getSingletons() {
- return singletons;
- }
-
- public EntityContainer setSingletons(final List<Singleton> singletons) {
- this.singletons = singletons;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityContainerInfo.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityContainerInfo.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityContainerInfo.java
deleted file mode 100644
index aa08637..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityContainerInfo.java
+++ /dev/null
@@ -1,47 +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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class EntityContainerInfo {
-
- private FullQualifiedName containerName;
-
- private FullQualifiedName extendsContainer;
-
- public FullQualifiedName getContainerName() {
- return containerName;
- }
-
- public EntityContainerInfo setContainerName(final FullQualifiedName containerName) {
- this.containerName = containerName;
- return this;
- }
-
- public FullQualifiedName getExtendsContainer() {
- return extendsContainer;
- }
-
- public EntityContainerInfo setExtendsContainer(final FullQualifiedName extendsContainer) {
- this.extendsContainer = extendsContainer;
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntitySet.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntitySet.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntitySet.java
deleted file mode 100644
index 8fbfb91..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntitySet.java
+++ /dev/null
@@ -1,55 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class EntitySet extends BindingTarget {
-
- private boolean includeInServiceDocument;
-
- @Override
- public EntitySet setName(final String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public EntitySet setNavigationPropertyBindings(final List<NavigationPropertyBinding> navigationPropertyBindings) {
- this.navigationPropertyBindings = navigationPropertyBindings;
- return this;
- }
-
- @Override
- public EntitySet setType(final FullQualifiedName entityType) {
- type = entityType;
- return this;
- }
-
- public boolean isIncludeInServiceDocument() {
- return includeInServiceDocument;
- }
-
- public EntitySet setIncludeInServiceDocument(final boolean includeInServiceDocument) {
- this.includeInServiceDocument = includeInServiceDocument;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntitySetPath.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntitySetPath.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntitySetPath.java
deleted file mode 100644
index 4df76f8..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntitySetPath.java
+++ /dev/null
@@ -1,45 +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.server.api.edm.provider;
-
-//TODO: Do we really need this class?
-public class EntitySetPath {
-
- private String bindingParameter;
-
- private String path;
-
- public String getBindingParameter() {
- return bindingParameter;
- }
-
- public EntitySetPath setBindingParameter(final String bindingParameter) {
- this.bindingParameter = bindingParameter;
- return this;
- }
-
- public String getPath() {
- return path;
- }
-
- public EntitySetPath setPath(final String path) {
- this.path = path;
- return this;
- }
-}
[15/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmParameter.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmParameter.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmParameter.java
new file mode 100644
index 0000000..b1d551b
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmParameter.java
@@ -0,0 +1,87 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmMapping;
+import org.apache.olingo.commons.api.edm.EdmParameter;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+
+public abstract class AbstractEdmParameter extends EdmElementImpl implements EdmParameter {
+
+ private final FullQualifiedName paramType;
+
+ private EdmType typeImpl;
+
+ public AbstractEdmParameter(final Edm edm, final String name, final FullQualifiedName paramType) {
+ super(edm, name);
+ this.paramType = paramType;
+ }
+
+ @Override
+ public EdmType getType() {
+ if (typeImpl == null) {
+ if (EdmPrimitiveType.EDM_NAMESPACE.equals(paramType.getNamespace())) {
+ try {
+ typeImpl = EdmPrimitiveTypeKind.valueOf(paramType.getName()).getEdmPrimitiveTypeInstance();
+ } catch (IllegalArgumentException e) {
+ throw new EdmException("Cannot find type with name: " + paramType, e);
+ }
+ } else {
+ typeImpl = edm.getComplexType(paramType);
+ if (typeImpl == null) {
+ typeImpl = edm.getEntityType(paramType);
+ if (typeImpl == null) {
+ typeImpl = edm.getEnumType(paramType);
+ if (typeImpl == null) {
+ typeImpl = edm.getTypeDefinition(paramType);
+ if (typeImpl == null) {
+ throw new EdmException("Cannot find type with name: " + paramType);
+ }
+ }
+ }
+ }
+ }
+ }
+ return typeImpl;
+ }
+
+ @Override
+ public abstract boolean isCollection();
+
+ @Override
+ public abstract EdmMapping getMapping();
+
+ @Override
+ public abstract Boolean isNullable();
+
+ @Override
+ public abstract Integer getMaxLength();
+
+ @Override
+ public abstract Integer getPrecision();
+
+ @Override
+ public abstract Integer getScale();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmProperty.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmProperty.java
new file mode 100644
index 0000000..11e0365
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmProperty.java
@@ -0,0 +1,70 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+
+public abstract class AbstractEdmProperty extends EdmElementImpl implements EdmProperty {
+
+ private EdmType propertyType;
+
+ public AbstractEdmProperty(final Edm edm, final String name) {
+ super(edm, name);
+ }
+
+ protected abstract FullQualifiedName getTypeFQN();
+
+ @Override
+ public boolean isPrimitive() {
+ return EdmPrimitiveType.EDM_NAMESPACE.equals(getTypeFQN().getNamespace());
+ }
+
+ @Override
+ public EdmType getType() {
+ if (propertyType == null) {
+ final FullQualifiedName typeName = getTypeFQN();
+ if (isPrimitive()) {
+ try {
+ propertyType = EdmPrimitiveTypeKind.valueOf(typeName.getName()).getEdmPrimitiveTypeInstance();
+ } catch (IllegalArgumentException e) {
+ throw new EdmException("Cannot find type with name: " + typeName, e);
+ }
+ } else {
+ propertyType = edm.getComplexType(typeName);
+ if (propertyType == null) {
+ propertyType = edm.getEnumType(typeName);
+ if (propertyType == null) {
+ propertyType = edm.getTypeDefinition(typeName);
+ if (propertyType == null) {
+ throw new EdmException("Cannot find type with name: " + typeName);
+ }
+ }
+ }
+ }
+ }
+
+ return propertyType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmReturnType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmReturnType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmReturnType.java
new file mode 100644
index 0000000..a6a6a84
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmReturnType.java
@@ -0,0 +1,85 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmReturnType;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+
+public abstract class AbstractEdmReturnType implements EdmReturnType {
+
+ private final Edm edm;
+
+ private final FullQualifiedName typeName;
+
+ private EdmType typeImpl;
+
+ public AbstractEdmReturnType(final Edm edm, final FullQualifiedName typeName) {
+ this.edm = edm;
+ this.typeName = typeName;
+ }
+
+ @Override
+ public EdmType getType() {
+ if (typeImpl == null) {
+ if (EdmPrimitiveType.EDM_NAMESPACE.equals(typeName.getNamespace())) {
+ try {
+ typeImpl = EdmPrimitiveTypeKind.valueOf(typeName.getName()).getEdmPrimitiveTypeInstance();
+ } catch (IllegalArgumentException e) {
+ throw new EdmException("Cannot find type with name: " + typeName, e);
+ }
+ } else {
+ typeImpl = edm.getComplexType(typeName);
+ if (typeImpl == null) {
+ typeImpl = edm.getEntityType(typeName);
+ if (typeImpl == null) {
+ typeImpl = edm.getEnumType(typeName);
+ if (typeImpl == null) {
+ typeImpl = edm.getTypeDefinition(typeName);
+ if (typeImpl == null) {
+ throw new EdmException("Cant find type with name: " + typeName);
+ }
+ }
+ }
+ }
+ }
+ }
+ return typeImpl;
+ }
+
+ @Override
+ public abstract Boolean isNullable();
+
+ @Override
+ public abstract Integer getMaxLength();
+
+ @Override
+ public abstract Integer getPrecision();
+
+ @Override
+ public abstract Integer getScale();
+
+ @Override
+ public abstract boolean isCollection();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmStructuredType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmStructuredType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmStructuredType.java
new file mode 100644
index 0000000..d48fda4
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmStructuredType.java
@@ -0,0 +1,129 @@
+/*
+ * 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.commons.core.edm;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmElement;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.EdmStructuredType;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public abstract class AbstractEdmStructuredType extends EdmTypeImpl implements EdmStructuredType {
+
+ protected EdmStructuredType baseType;
+
+ private List<String> propertyNames;
+
+ private List<String> navigationPropertyNames;
+
+ public AbstractEdmStructuredType(final Edm edm, final FullQualifiedName fqn, final EdmTypeKind kind,
+ final FullQualifiedName baseTypeName) {
+
+ super(edm, fqn, kind);
+ }
+
+ protected abstract EdmStructuredType buildBaseType(FullQualifiedName baseTypeName);
+
+ protected abstract Map<String, EdmProperty> getProperties();
+
+ protected abstract Map<String, EdmNavigationProperty> getNavigationProperties();
+
+ @Override
+ public List<String> getPropertyNames() {
+ if (propertyNames == null) {
+ propertyNames = new ArrayList<String>();
+ if (baseType != null) {
+ propertyNames.addAll(baseType.getPropertyNames());
+ }
+ propertyNames.addAll(getProperties().keySet());
+ }
+ return propertyNames;
+ }
+
+ @Override
+ public List<String> getNavigationPropertyNames() {
+ if (navigationPropertyNames == null) {
+ navigationPropertyNames = new ArrayList<String>();
+ if (baseType != null) {
+ navigationPropertyNames.addAll(baseType.getNavigationPropertyNames());
+ }
+ navigationPropertyNames.addAll(getNavigationProperties().keySet());
+ }
+ return navigationPropertyNames;
+ }
+
+ @Override
+ public EdmElement getProperty(final String name) {
+ EdmElement property = getStructuralProperty(name);
+ if (property == null) {
+ property = getNavigationProperty(name);
+ }
+ return property;
+ }
+
+ @Override
+ public EdmProperty getStructuralProperty(final String name) {
+ EdmProperty property = null;
+ if (baseType != null) {
+ property = baseType.getStructuralProperty(name);
+ }
+ if (property == null) {
+ property = getProperties().get(name);
+ }
+ return property;
+ }
+
+ @Override
+ public EdmNavigationProperty getNavigationProperty(final String name) {
+ EdmNavigationProperty property = null;
+ if (baseType != null) {
+ property = baseType.getNavigationProperty(name);
+ }
+ if (property == null) {
+ property = getNavigationProperties().get(name);
+ }
+ return property;
+ }
+
+ @Override
+ public boolean compatibleTo(final EdmType targetType) {
+ EdmStructuredType sourceType = this;
+ if (targetType == null) {
+ throw new EdmException("Target type must not be null");
+ }
+ while (!sourceType.getName().equals(targetType.getName())
+ || !sourceType.getNamespace().equals(targetType.getNamespace())) {
+
+ sourceType = sourceType.getBaseType();
+ if (sourceType == null) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmTypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmTypeDefinition.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmTypeDefinition.java
new file mode 100644
index 0000000..9ce14de
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmTypeDefinition.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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public abstract class AbstractEdmTypeDefinition extends EdmNamedImpl implements EdmTypeDefinition {
+
+ private final String namespace;
+
+ public AbstractEdmTypeDefinition(final Edm edm, final FullQualifiedName typeDefinitionName) {
+ super(edm, typeDefinitionName.getName());
+ this.namespace = typeDefinitionName.getNamespace();
+ }
+
+ @Override
+ public abstract EdmPrimitiveType getUnderlyingType();
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return getUnderlyingType().isCompatible(primitiveType);
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return getUnderlyingType().getDefaultType();
+ }
+
+ @Override
+ public boolean validate(final String value, final Boolean isNullable, final Integer maxLength,
+ final Integer precision, final Integer scale,
+ final Boolean isUnicode) {
+
+ return getUnderlyingType().validate(value, isNullable, maxLength, precision, scale, isUnicode);
+ }
+
+ @Override
+ public <T> T valueOfString(final String value, final Boolean isNullable, final Integer maxLength,
+ final Integer precision, final Integer scale,
+ final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ return getUnderlyingType().
+ valueOfString(value, isNullable, maxLength, precision, scale, isUnicode, returnType);
+ }
+
+ @Override
+ public String valueToString(final Object value, final Boolean isNullable, final Integer maxLength,
+ final Integer precision, final Integer scale,
+ final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ return getUnderlyingType().valueToString(value, isNullable, maxLength, precision, scale, isUnicode);
+ }
+
+ @Override
+ public String toUriLiteral(final String literal) {
+ return getUnderlyingType().toUriLiteral(literal);
+ }
+
+ @Override
+ public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
+ return getUnderlyingType().fromUriLiteral(literal);
+ }
+
+ @Override
+ public String getNamespace() {
+ return namespace;
+ }
+
+ @Override
+ public EdmTypeKind getKind() {
+ return EdmTypeKind.DEFINITION;
+ }
+
+ @Override
+ public abstract Integer getMaxLength();
+
+ @Override
+ public abstract Integer getPrecision();
+
+ @Override
+ public abstract Integer getScale();
+
+ @Override
+ public abstract Boolean isUnicode();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/ActionMapKey.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/ActionMapKey.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/ActionMapKey.java
new file mode 100644
index 0000000..7e1874a
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/ActionMapKey.java
@@ -0,0 +1,67 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class ActionMapKey {
+
+ private final FullQualifiedName actionName;
+
+ private final FullQualifiedName bindingParameterTypeName;
+
+ private final Boolean isBindingParameterCollection;
+
+ public ActionMapKey(final FullQualifiedName actionName, final FullQualifiedName bindingParameterTypeName,
+ final Boolean isBindingParameterCollection) {
+
+ if (actionName == null || bindingParameterTypeName == null || isBindingParameterCollection == null) {
+ throw new EdmException("Action name, binding parameter type and binding parameter collection "
+ + "must not be null for bound actions");
+ }
+ this.actionName = actionName;
+ this.bindingParameterTypeName = bindingParameterTypeName;
+ this.isBindingParameterCollection = isBindingParameterCollection;
+ }
+
+ @Override
+ public int hashCode() {
+ final String forHash = actionName.toString()
+ + bindingParameterTypeName.toString()
+ + isBindingParameterCollection.toString();
+ return forHash.hashCode();
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if ((obj == null) || !(obj instanceof ActionMapKey)) {
+ return false;
+ }
+ final ActionMapKey other = (ActionMapKey) obj;
+ if (actionName.equals(other.actionName) && bindingParameterTypeName.equals(other.bindingParameterTypeName)
+ && isBindingParameterCollection.equals(other.isBindingParameterCollection)) {
+ return true;
+ }
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImportInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImportInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImportInfoImpl.java
new file mode 100644
index 0000000..798cb4d
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmActionImportInfoImpl.java
@@ -0,0 +1,45 @@
+/*
+ * 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.commons.core.edm;
+
+import java.net.URI;
+
+import org.apache.olingo.commons.api.edm.EdmActionImportInfo;
+import org.apache.olingo.commons.api.edm.EdmException;
+
+public class EdmActionImportInfoImpl extends EdmOperationImportInfoImpl implements EdmActionImportInfo {
+
+ private String actionImportName;
+
+ public EdmActionImportInfoImpl(final String entityContainerName, final String actionImportName) {
+ super(entityContainerName);
+ this.actionImportName = actionImportName;
+ }
+
+ @Override
+ public String getActionImportName() {
+ return actionImportName;
+ }
+
+ @Override
+ public URI getActionImportUri() {
+ throw new EdmException("Not yet implemented");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmElementImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmElementImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmElementImpl.java
new file mode 100644
index 0000000..1653a8f
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmElementImpl.java
@@ -0,0 +1,29 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmElement;
+
+public abstract class EdmElementImpl extends EdmNamedImpl implements EdmElement {
+
+ public EdmElementImpl(final Edm edm, final String name) {
+ super(edm, name);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntitySetInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntitySetInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntitySetInfoImpl.java
new file mode 100644
index 0000000..9bbf568
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmEntitySetInfoImpl.java
@@ -0,0 +1,52 @@
+/*
+ * 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.commons.core.edm;
+
+import java.net.URI;
+
+import org.apache.olingo.commons.api.edm.EdmEntitySetInfo;
+import org.apache.olingo.commons.api.edm.EdmException;
+
+public class EdmEntitySetInfoImpl implements EdmEntitySetInfo {
+
+ private final String entityContainerName;
+
+ private final String entitySetName;
+
+ public EdmEntitySetInfoImpl(final String entityContainerName, final String entitySetName) {
+ this.entityContainerName = entityContainerName;
+ this.entitySetName = entitySetName;
+ }
+
+ @Override
+ public String getEntityContainerName() {
+ return entityContainerName;
+ }
+
+ @Override
+ public String getEntitySetName() {
+ return entitySetName;
+ }
+
+ @Override
+ public URI getEntitySetUri() {
+ throw new EdmException("Not yet implemented");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImportInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImportInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImportInfoImpl.java
new file mode 100644
index 0000000..a2f52d6
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmFunctionImportInfoImpl.java
@@ -0,0 +1,45 @@
+/*
+ * 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.commons.core.edm;
+
+import java.net.URI;
+
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo;
+
+public class EdmFunctionImportInfoImpl extends EdmOperationImportInfoImpl implements EdmFunctionImportInfo {
+
+ private String functionImportName;
+
+ public EdmFunctionImportInfoImpl(final String entityContainerName, final String functionImportName) {
+ super(entityContainerName);
+ this.functionImportName = functionImportName;
+ }
+
+ @Override
+ public String getFunctionImportName() {
+ return functionImportName;
+ }
+
+ @Override
+ public URI getFunctionImportUri() {
+ throw new EdmException("Not yet implemented");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmMemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmMemberImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmMemberImpl.java
new file mode 100644
index 0000000..79be011
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmMemberImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmMember;
+
+public class EdmMemberImpl extends EdmNamedImpl implements EdmMember {
+
+ private final String value;
+
+ public EdmMemberImpl(final Edm edm, final String name, final String value) {
+ super(edm, name);
+ this.value = value;
+ }
+
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmNamedImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmNamedImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmNamedImpl.java
new file mode 100644
index 0000000..8f82d56
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmNamedImpl.java
@@ -0,0 +1,40 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmNamed;
+
+public abstract class EdmNamedImpl implements EdmNamed {
+
+ protected final Edm edm;
+
+ private final String name;
+
+ public EdmNamedImpl(final Edm edm, final String name) {
+ this.edm = edm;
+ this.name = name;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmOperationImportInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmOperationImportInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmOperationImportInfoImpl.java
new file mode 100644
index 0000000..5c73b61
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmOperationImportInfoImpl.java
@@ -0,0 +1,36 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.EdmOperationImportInfo;
+
+public abstract class EdmOperationImportInfoImpl implements EdmOperationImportInfo {
+
+ protected String entityContainerName;
+
+ public EdmOperationImportInfoImpl(final String entityContainerName) {
+ this.entityContainerName = entityContainerName;
+ }
+
+ @Override
+ public String getEntityContainerName() {
+ return this.entityContainerName;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSingletonInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSingletonInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSingletonInfoImpl.java
new file mode 100644
index 0000000..6fa6489
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmSingletonInfoImpl.java
@@ -0,0 +1,52 @@
+/*
+ * 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.commons.core.edm;
+
+import java.net.URI;
+
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmSingletonInfo;
+
+public class EdmSingletonInfoImpl implements EdmSingletonInfo {
+
+ private final String entityContainerName;
+
+ private final String singletonName;
+
+ public EdmSingletonInfoImpl(final String entityContainerName, final String singletonName) {
+ this.entityContainerName = entityContainerName;
+ this.singletonName = singletonName;
+ }
+
+ @Override
+ public String getEntityContainerName() {
+ return entityContainerName;
+ }
+
+ @Override
+ public String getSingletonName() {
+ return singletonName;
+ }
+
+ @Override
+ public URI getEntitySetUri() {
+ throw new EdmException("Not yet implemented");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmStructuredTypeHelper.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmStructuredTypeHelper.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmStructuredTypeHelper.java
new file mode 100644
index 0000000..e1226dd
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmStructuredTypeHelper.java
@@ -0,0 +1,31 @@
+/*
+ * 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.commons.core.edm;
+
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+
+public interface EdmStructuredTypeHelper {
+
+ Map<String, EdmProperty> getProperties();
+
+ Map<String, EdmNavigationProperty> getNavigationProperties();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeImpl.java
new file mode 100644
index 0000000..7fc2808
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeImpl.java
@@ -0,0 +1,48 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public class EdmTypeImpl extends EdmNamedImpl implements EdmType {
+
+ protected final FullQualifiedName fqn;
+
+ protected final EdmTypeKind kind;
+
+ public EdmTypeImpl(final Edm edm, final FullQualifiedName fqn, final EdmTypeKind kind) {
+ super(edm, fqn.getName());
+ this.fqn = fqn;
+ this.kind = kind;
+ }
+
+ @Override
+ public String getNamespace() {
+ return fqn.getNamespace();
+ }
+
+ @Override
+ public EdmTypeKind getKind() {
+ return kind;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/FunctionMapKey.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/FunctionMapKey.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/FunctionMapKey.java
new file mode 100644
index 0000000..a9193a3
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/FunctionMapKey.java
@@ -0,0 +1,113 @@
+/*
+ * 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.commons.core.edm;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class FunctionMapKey {
+
+ private final FullQualifiedName functionName;
+
+ private final FullQualifiedName bindingParameterTypeName;
+
+ private final Boolean isBindingParameterCollection;
+
+ private final List<String> parameterNames;
+
+ public FunctionMapKey(final FullQualifiedName functionName, final FullQualifiedName bindingParameterTypeName,
+ final Boolean isBindingParameterCollection, final List<String> parameterNames) {
+
+ this.functionName = functionName;
+ if (bindingParameterTypeName != null && isBindingParameterCollection == null) {
+ throw new EdmException(
+ "Indicator that the bindingparameter is a collection must not be null if its an bound function.");
+ }
+ this.bindingParameterTypeName = bindingParameterTypeName;
+ this.isBindingParameterCollection = isBindingParameterCollection;
+ this.parameterNames = new ArrayList<String>();
+ if (parameterNames != null) {
+ this.parameterNames.addAll(parameterNames);
+ Collections.sort(this.parameterNames);
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ String hash = functionName.toString();
+
+ if (bindingParameterTypeName != null) {
+ hash = hash + bindingParameterTypeName.toString();
+ } else {
+ hash = hash + "typeNull";
+ }
+
+ if (isBindingParameterCollection != null) {
+ hash = hash + isBindingParameterCollection.toString();
+ } else {
+ hash = hash + "collectionNull";
+ }
+
+ if (!parameterNames.isEmpty()) {
+ for (String name : parameterNames) {
+ hash = hash + name;
+ }
+ } else {
+ hash = hash + "parameterNamesEmpty";
+ }
+
+ return hash.hashCode();
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if ((obj == null) || !(obj instanceof FunctionMapKey)) {
+ return false;
+ }
+ final FunctionMapKey other = (FunctionMapKey) obj;
+
+ if (functionName.equals(other.functionName)
+ && (bindingParameterTypeName == null && other.bindingParameterTypeName == null)
+ || (bindingParameterTypeName != null && bindingParameterTypeName.equals(other.bindingParameterTypeName))
+ && (isBindingParameterCollection == null
+ && other.isBindingParameterCollection == null)
+ || (isBindingParameterCollection != null
+ && isBindingParameterCollection.equals(other.isBindingParameterCollection))) {
+
+ if (parameterNames == null && other.parameterNames == null) {
+ return true;
+ } else if (parameterNames.size() == other.parameterNames.size()) {
+ for (String name : parameterNames) {
+ if (!other.parameterNames.contains(name)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractPrimitiveType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractPrimitiveType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractPrimitiveType.java
new file mode 100644
index 0000000..09ceb31
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractPrimitiveType.java
@@ -0,0 +1,116 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+/**
+ * Abstract implementation of the EDM primitive-type interface.
+ */
+abstract class AbstractPrimitiveType implements EdmPrimitiveType {
+
+ protected String uriPrefix = "";
+
+ protected String uriSuffix = "";
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return equals(primitiveType);
+ }
+
+ @Override
+ public boolean validate(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
+ final Boolean isUnicode) {
+
+ try {
+ valueOfString(value, isNullable, maxLength, precision, scale, isUnicode, getDefaultType());
+ return true;
+ } catch (final EdmPrimitiveTypeException e) {
+ return false;
+ }
+ }
+
+ @Override
+ public final <T> T valueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType)
+ throws EdmPrimitiveTypeException {
+
+ if (value == null) {
+ if (isNullable != null && !isNullable) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_NULL_NOT_ALLOWED");
+ }
+ return null;
+ }
+ return internalValueOfString(value, isNullable, maxLength, precision, scale, isUnicode, returnType);
+ }
+
+ protected abstract <T> T internalValueOfString(String value,
+ Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode,
+ Class<T> returnType) throws EdmPrimitiveTypeException;
+
+ @Override
+ public final String valueToString(final Object value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+ if (value == null) {
+ if (isNullable != null && !isNullable) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_NULL_NOT_ALLOWED");
+ }
+ return null;
+ }
+ return internalValueToString(value, isNullable, maxLength, precision, scale, isUnicode);
+ }
+
+ protected abstract <T> String internalValueToString(T value,
+ Boolean isNullable, Integer maxLength, Integer precision, Integer scale,
+ Boolean isUnicode) throws EdmPrimitiveTypeException;
+
+ @Override
+ public String toUriLiteral(final String literal) {
+ return literal == null
+ ? null
+ : uriPrefix.isEmpty() && uriSuffix.isEmpty()
+ ? literal
+ : uriPrefix + literal + uriSuffix;
+ }
+
+ @Override
+ public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
+ if (literal == null) {
+ return null;
+ } else if (uriPrefix.isEmpty() && uriSuffix.isEmpty()) {
+ return literal;
+ } else if (literal.length() >= uriPrefix.length() + uriSuffix.length()
+ && literal.startsWith(uriPrefix) && literal.endsWith(uriSuffix)) {
+
+ return literal.substring(uriPrefix.length(), literal.length() - uriSuffix.length());
+ } else {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(literal)");
+ }
+ }
+
+ @Override
+ public String toString() {
+ return new FullQualifiedName(getNamespace(), getName()).getFullQualifiedNameAsString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinary.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinary.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinary.java
new file mode 100644
index 0000000..7611045
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinary.java
@@ -0,0 +1,117 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Binary.
+ */
+public class EdmBinary extends SingletonPrimitiveType {
+
+ private static final EdmBinary INSTANCE = new EdmBinary();
+
+ {
+ uriPrefix = "binary'";
+ uriSuffix = "'";
+ }
+
+ public static EdmBinary getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return byte[].class;
+ }
+
+ @Override
+ public boolean validate(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) {
+
+ return value == null
+ ? isNullable == null || isNullable
+ : Base64.isBase64(value) && validateMaxLength(value, maxLength);
+ }
+
+ private static boolean validateMaxLength(final String value, final Integer maxLength) {
+ return maxLength == null ? true
+ : // Every three bytes are represented as four base-64 characters.
+ // Additionally, there could be up to two padding "=" characters
+ // if the number of bytes is not a multiple of three.
+ maxLength >= value.length() * 3 / 4 - (value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0);
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ if (!Base64.isBase64(value)) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+ if (!validateMaxLength(value, maxLength)) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+
+ final byte[] result = Base64.decodeBase64(value);
+
+ if (returnType.isAssignableFrom(byte[].class)) {
+ return returnType.cast(result);
+ } else if (returnType.isAssignableFrom(Byte[].class)) {
+ final Byte[] byteArray = new Byte[result.length];
+ for (int i = 0; i < result.length; i++) {
+ byteArray[i] = result[i];
+ }
+ return returnType.cast(byteArray);
+ } else {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ byte[] byteArrayValue;
+ if (value instanceof byte[]) {
+ byteArrayValue = (byte[]) value;
+ } else if (value instanceof Byte[]) {
+ final int length = ((Byte[]) value).length;
+ byteArrayValue = new byte[length];
+ for (int i = 0; i < length; i++) {
+ byteArrayValue[i] = ((Byte[]) value)[i].byteValue();
+ }
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+
+ if (maxLength != null && byteArrayValue.length > maxLength) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+
+ return Base64.encodeBase64URLSafeString(byteArrayValue);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBoolean.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBoolean.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBoolean.java
new file mode 100644
index 0000000..a3de59f
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBoolean.java
@@ -0,0 +1,81 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Boolean.
+ */
+public final class EdmBoolean extends SingletonPrimitiveType {
+
+ private static final EdmBoolean INSTANCE = new EdmBoolean();
+
+ public static EdmBoolean getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Boolean.class;
+ }
+
+ @Override
+ public boolean validate(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) {
+
+ return value == null ? isNullable == null || isNullable : validateLiteral(value);
+ }
+
+ private static boolean validateLiteral(final String value) {
+ return "true".equals(value) || "false".equals(value);
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ if (validateLiteral(value)) {
+ if (returnType.isAssignableFrom(Boolean.class)) {
+ return returnType.cast(Boolean.valueOf("true".equals(value)));
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+ }
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ if (value instanceof Boolean) {
+ return Boolean.toString((Boolean) value);
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByte.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByte.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByte.java
new file mode 100644
index 0000000..6c105eb
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByte.java
@@ -0,0 +1,101 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Byte.
+ */
+public final class EdmByte extends SingletonPrimitiveType {
+
+ private static final EdmByte INSTANCE = new EdmByte();
+
+ public static EdmByte getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return primitiveType instanceof Uint7
+ || primitiveType instanceof EdmByte;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Short.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ Short valueShort;
+ try {
+ valueShort = Short.parseShort(value);
+ } catch (final NumberFormatException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+ }
+ if (valueShort < 0 || valueShort >= 1 << Byte.SIZE) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+
+ try {
+ return EdmInt64.convertNumber(valueShort, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) {
+ if (((Number) value).longValue() >= 0 && ((Number) value).longValue() < 1 << Byte.SIZE) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else if (value instanceof BigInteger) {
+ if (((BigInteger) value).compareTo(BigInteger.ZERO) >= 0
+ && ((BigInteger) value).compareTo(BigInteger.valueOf(1 << Byte.SIZE)) < 0) {
+ return value.toString();
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDate.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDate.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDate.java
new file mode 100644
index 0000000..5f141c0
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDate.java
@@ -0,0 +1,95 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.util.Calendar;
+import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type Date.
+ */
+public final class EdmDate extends SingletonPrimitiveType {
+
+ private static final Pattern PATTERN = Pattern.compile("(-?\\p{Digit}{4,})-(\\p{Digit}{2})-(\\p{Digit}{2})");
+
+ private static final EdmDate INSTANCE = new EdmDate();
+
+ public static EdmDate getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Calendar.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ final Calendar dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
+ dateTimeValue.clear();
+
+ final Matcher matcher = PATTERN.matcher(value);
+ if (!matcher.matches()) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+
+ dateTimeValue.set(
+ Integer.parseInt(matcher.group(1)),
+ Byte.parseByte(matcher.group(2)) - 1, // month is zero-based
+ Byte.parseByte(matcher.group(3)));
+
+ try {
+ return EdmDateTimeOffset.convertDateTime(dateTimeValue, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ final Calendar dateTimeValue = EdmDateTimeOffset.createDateTime(value);
+
+ final StringBuilder result = new StringBuilder(10); // Ten characters are enough for "normal" dates.
+ final int year = dateTimeValue.get(Calendar.YEAR);
+ if (year < 0 || year >= 10000) {
+ result.append(year);
+ } else {
+ EdmDateTimeOffset.appendTwoDigits(result, (year / 100) % 100);
+ EdmDateTimeOffset.appendTwoDigits(result, year % 100);
+ }
+ result.append('-');
+ EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.MONTH) + 1); // month is zero-based
+ result.append('-');
+ EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.DAY_OF_MONTH));
+ return result.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java
new file mode 100644
index 0000000..7a511d6
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java
@@ -0,0 +1,239 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+/**
+ * Implementation of the EDM primitive type DateTimeOffset.
+ */
+public final class EdmDateTimeOffset extends SingletonPrimitiveType {
+
+ private static final Pattern PATTERN = Pattern.compile(
+ "(-?\\p{Digit}{4,})-(\\p{Digit}{2})-(\\p{Digit}{2})"
+ + "T(\\p{Digit}{2}):(\\p{Digit}{2})(?::(\\p{Digit}{2})(\\.(\\p{Digit}{0,3}?)0*)?)?"
+ + "(Z|([-+]\\p{Digit}{2}:\\p{Digit}{2}))?");
+
+ private static final EdmDateTimeOffset INSTANCE = new EdmDateTimeOffset();
+
+ public static EdmDateTimeOffset getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return Calendar.class;
+ }
+
+ @Override
+ protected <T> T internalValueOfString(final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
+
+ final Matcher matcher = PATTERN.matcher(value);
+ if (!matcher.matches()) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+
+ final String timeZoneOffset = matcher.group(9) != null && matcher.group(10) != null
+ && !matcher.group(10).matches("[-+]0+:0+") ? matcher.group(10) : null;
+ final Calendar dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT" + timeZoneOffset));
+ if (dateTimeValue.get(Calendar.ZONE_OFFSET) == 0 && timeZoneOffset != null) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+ dateTimeValue.clear();
+
+ dateTimeValue.set(
+ Short.parseShort(matcher.group(1)),
+ Byte.parseByte(matcher.group(2)) - 1, // month is zero-based
+ Byte.parseByte(matcher.group(3)),
+ Byte.parseByte(matcher.group(4)),
+ Byte.parseByte(matcher.group(5)),
+ matcher.group(6) == null ? 0 : Byte.parseByte(matcher.group(6)));
+
+ if (matcher.group(7) != null) {
+ if (matcher.group(7).length() == 1 || matcher.group(7).length() > 13) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+ final String decimals = matcher.group(8);
+ if (decimals.length() > (precision == null ? 0 : precision)) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
+ }
+ final String milliSeconds = decimals + "000".substring(decimals.length());
+ dateTimeValue.set(Calendar.MILLISECOND, Short.parseShort(milliSeconds));
+ }
+
+ try {
+ return convertDateTime(dateTimeValue, returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ /**
+ * Converts a {@link Calendar} value into the requested return type if possible.
+ *
+ * @param dateTimeValue the value
+ * @param returnType the class of the returned value; it must be one of {@link Calendar}, {@link Long}, or
+ * {@link Date}
+ * @return the converted value
+ * @throws IllegalArgumentException if the Calendar value is not valid
+ * @throws ClassCastException if the return type is not allowed
+ */
+ protected static <T> T convertDateTime(final Calendar dateTimeValue, final Class<T> returnType)
+ throws IllegalArgumentException, ClassCastException {
+
+ // The Calendar class does not check any values until a get method is called,
+ // so we do just that to validate the fields that may have been set,
+ // not because we want to return something else.
+ // For strict checks, the lenient mode is switched off.
+ dateTimeValue.setLenient(false);
+
+ if (returnType.isAssignableFrom(Calendar.class)) {
+ // Ensure that all fields are recomputed.
+ dateTimeValue.get(Calendar.MILLISECOND); // may throw IllegalArgumentException
+ // Reset the lenient mode to its default.
+ dateTimeValue.setLenient(true);
+ return returnType.cast(dateTimeValue);
+ } else if (returnType.isAssignableFrom(Long.class)) {
+ return returnType.cast(dateTimeValue.getTimeInMillis()); // may throw IllegalArgumentException
+ } else if (returnType.isAssignableFrom(Date.class)) {
+ return returnType.cast(dateTimeValue.getTime()); // may throw IllegalArgumentException
+ } else {
+ throw new ClassCastException("unsupported return type " + returnType.getSimpleName());
+ }
+ }
+
+ @Override
+ protected <T> String internalValueToString(final T value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ final Calendar dateTimeValue = createDateTime(value);
+
+ final StringBuilder result = new StringBuilder(23); // 23 characters are enough for millisecond precision.
+ final int year = dateTimeValue.get(Calendar.YEAR);
+ appendTwoDigits(result, year / 100);
+ appendTwoDigits(result, year % 100);
+ result.append('-');
+ appendTwoDigits(result, dateTimeValue.get(Calendar.MONTH) + 1); // month is zero-based
+ result.append('-');
+ appendTwoDigits(result, dateTimeValue.get(Calendar.DAY_OF_MONTH));
+ result.append('T');
+ appendTwoDigits(result, dateTimeValue.get(Calendar.HOUR_OF_DAY));
+ result.append(':');
+ appendTwoDigits(result, dateTimeValue.get(Calendar.MINUTE));
+ result.append(':');
+ appendTwoDigits(result, dateTimeValue.get(Calendar.SECOND));
+
+ try {
+ appendMilliseconds(result, dateTimeValue.get(Calendar.MILLISECOND), precision);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets), e");
+ }
+
+ final int offsetInMinutes = (dateTimeValue.get(Calendar.ZONE_OFFSET)
+ + dateTimeValue.get(Calendar.DST_OFFSET)) / 60 / 1000;
+ final int offsetHours = offsetInMinutes / 60;
+ final int offsetMinutes = Math.abs(offsetInMinutes % 60);
+ final String offsetString = offsetInMinutes == 0 ? "Z" : String.format("%+03d:%02d", offsetHours, offsetMinutes);
+ result.append(offsetString);
+
+ return result.toString();
+ }
+
+ /**
+ * Creates a date/time value from the given value.
+ *
+ * @param value the value as {@link Calendar}, {@link Date}, or {@link Long}
+ * @return the value as {@link Calendar}
+ * @throws EdmPrimitiveTypeException if the type of the value is not supported
+ */
+ protected static <T> Calendar createDateTime(final T value) throws EdmPrimitiveTypeException {
+ Calendar dateTimeValue;
+ if (value instanceof Date) {
+ // Although java.util.Date, as stated in its documentation,
+ // "is intended to reflect coordinated universal time (UTC)",
+ // its toString() method uses the default time zone. And so do we.
+ dateTimeValue = Calendar.getInstance();
+ dateTimeValue.setTime((Date) value);
+ } else if (value instanceof Calendar) {
+ dateTimeValue = (Calendar) ((Calendar) value).clone();
+ } else if (value instanceof Long) {
+ dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
+ dateTimeValue.setTimeInMillis((Long) value);
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ return dateTimeValue;
+ }
+
+ /**
+ * Appends the given number to the given string builder, assuming that the number has at most two digits,
+ * performance-optimized.
+ *
+ * @param result a {@link StringBuilder}
+ * @param number an integer that must satisfy <code>0 <= number <= 99</code>
+ */
+ protected static void appendTwoDigits(final StringBuilder result, final int number) {
+ result.append((char) ('0' + number / 10));
+ result.append((char) ('0' + number % 10));
+ }
+
+ /**
+ * Appends the given number of milliseconds to the given string builder, assuming that the number has at most three
+ * digits, performance-optimized.
+ *
+ * @param result a {@link StringBuilder}
+ * @param milliseconds an integer that must satisfy <code>0 <= milliseconds <= 999</code>
+ * @param precision the upper limit for decimal digits (optional, defaults to zero)
+ */
+ protected static void appendMilliseconds(final StringBuilder result, final long milliseconds,
+ final Integer precision) throws IllegalArgumentException {
+ final int digits = milliseconds % 1000 == 0 ? 0 : milliseconds % 100 == 0 ? 1 : milliseconds % 10 == 0 ? 2 : 3;
+ if (digits > 0) {
+ result.append('.');
+ for (int d = 100; d > 0; d /= 10) {
+ final byte digit = (byte) (milliseconds % (d * 10) / d);
+ if (digit > 0 || milliseconds % d > 0) {
+ result.append((char) ('0' + digit));
+ }
+ }
+
+ if (precision == null || precision < digits) {
+ throw new IllegalArgumentException();
+ }
+ }
+ }
+}
[16/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmServiceMetadata.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmServiceMetadata.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmServiceMetadata.java
deleted file mode 100644
index be6f2c4..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmServiceMetadata.java
+++ /dev/null
@@ -1,59 +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.commons.api.edm;
-
-import java.io.InputStream;
-import java.util.List;
-
-/**
- * This interface gives access to the metadata of a service, the calculated Data Service Version and an info list of all
- * entity sets, singletons, and function imports inside this EntityDataModel.
- */
-public interface EdmServiceMetadata {
-
- /**
- * @return {@link InputStream} containing the metadata document
- */
- InputStream getMetadata();
-
- /**
- * @return <b>String</b> data service version of this service
- */
- String getDataServiceVersion();
-
- /**
- * @return a list of {@link EdmEntitySetInfo} objects inside the data model
- */
- List<EdmEntitySetInfo> getEntitySetInfos();
-
- /**
- * @return a list of {@link EdmSingletonInfo} objects inside the data model
- */
- List<EdmSingletonInfo> getSingletonInfos();
-
- /**
- * @return a list of {@link EdmActionImportInfo} objects inside the data model
- */
- List<EdmActionImportInfo> getActionImportInfos();
-
- /**
- * @return a list of {@link EdmFunctionImportInfo} objects inside the data model
- */
- List<EdmFunctionImportInfo> getFunctionImportInfos();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmSingleton.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmSingleton.java
deleted file mode 100644
index 1fa60ab..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmSingleton.java
+++ /dev/null
@@ -1,26 +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.commons.api.edm;
-
-/**
- * An {@link EdmSingleton} represents a single entity inside the entity model.
- */
-public interface EdmSingleton extends EdmBindingTarget {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmSingletonInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmSingletonInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmSingletonInfo.java
deleted file mode 100644
index c709d72..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmSingletonInfo.java
+++ /dev/null
@@ -1,45 +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.commons.api.edm;
-
-import java.net.URI;
-
-/**
- * Objects of this class contain information about one singleton inside the EntityDataModel.
- */
-public interface EdmSingletonInfo {
-
- /**
- * @return the entity container name which contains this singleton.
- */
- String getEntityContainerName();
-
- /**
- * @return the singleton name
- */
- String getSingletonName();
-
- /**
- * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
- * toASCIIString() method can be used.
- *
- * @return the uri to this singleton e.g. "EmployeeOfTheMonth"
- */
- URI getEntitySetUri();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmStructuredType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmStructuredType.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmStructuredType.java
deleted file mode 100644
index b515957..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmStructuredType.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.commons.api.edm;
-
-import java.util.List;
-
-/**
- * EdmStructuralType is the base for a complex type or an entity type.
- *
- * Complex types and entity types are described in the Conceptual Schema Definition of the OData protocol.
- */
-public interface EdmStructuredType extends EdmType {
-
- /**
- * Get property by name
- *
- * @param name
- * @return simple, complex or navigation property as {@link EdmTyped}
- */
- EdmElement getProperty(String name);
-
- /**
- * Get all simple and complex property names.
- *
- * @return property names as type List<String>
- */
- List<String> getPropertyNames();
-
- /**
- * Get structural property by name.
- *
- * @param name
- * @return simple or complex property as {@link EdmTyped}
- */
- EdmProperty getStructuralProperty(String name);
-
- /**
- * Get navigation property by name.
- *
- * @param name
- * @return navigation property as {@link EdmTyped}
- */
- EdmNavigationProperty getNavigationProperty(String name);
-
- /**
- * Get all navigation property names.
- *
- * @return navigation property names as type List<String>
- */
- List<String> getNavigationPropertyNames();
-
- /**
- * Base types are described in the OData protocol specification.
- *
- * @return {@link EdmStructuredType}
- */
- EdmStructuredType getBaseType();
-
- /**
- * Checks if this type is convertible to parameter {@link targetType}
- *
- * @param targetType
- * @return true if this type is compatible to the testType ( i.e. this type is a subtype of targetType )
- */
- boolean compatibleTo(EdmType targetType);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTerm.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTerm.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTerm.java
deleted file mode 100644
index 3a84bd0..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTerm.java
+++ /dev/null
@@ -1,50 +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.commons.api.edm;
-
-/**
- * An {@link EdmTerm} defines a term in a vocabulary.
- */
-public interface EdmTerm extends EdmNamed {
-
- /**
- * @return true if nullable or null if not specified
- */
- Boolean isNullable();
-
- /**
- * @return the maximum length as an Integer or null if not specified
- */
- Integer getMaxLength();
-
- /**
- * @return the precision as an Integer or null if not specified
- */
- Integer getPrecision();
-
- /**
- * @return the scale as an Integer or null if not specified
- */
- Integer getScale();
-
- /**
- * @return the default value as a String or null if not specified
- */
- String getDefaultValue();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmType.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmType.java
deleted file mode 100644
index bee2fa5..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmType.java
+++ /dev/null
@@ -1,40 +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.commons.api.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-/**
- * EdmType holds the namespace of a given type and its type as {@link EdmTypeKind}.
- */
-public interface EdmType extends EdmNamed {
-
- /**
- * Namespace of this {@link EdmType}.
- *
- * @return namespace as String
- */
- String getNamespace();
-
- /**
- * @return {@link EdmTypeKind} of this {@link EdmType}
- */
- EdmTypeKind getKind();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTypeDefinition.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTypeDefinition.java
deleted file mode 100644
index ce3103c..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTypeDefinition.java
+++ /dev/null
@@ -1,52 +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.commons.api.edm;
-
-/**
- * An {@link EdmTypeDefinition} defines a specialization of one of the possible primitive types.
- * <br/>
- * For more information on primitive types refer to {@link EdmPrimitiveType}.
- */
-public interface EdmTypeDefinition extends EdmPrimitiveType {
-
- /**
- * @return {@link EdmPrimitiveType} this type definition is based upon
- */
- EdmPrimitiveType getUnderlyingType();
-
- /**
- * @return the maximum length as an Integer or null if not specified
- */
- Integer getMaxLength();
-
- /**
- * @return the precision as an Integer or null if not specified
- */
- Integer getPrecision();
-
- /**
- * @return the scale as an Integer or null if not specified
- */
- Integer getScale();
-
- /**
- * @return true if unicode or null if not specified
- */
- Boolean isUnicode();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTyped.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTyped.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTyped.java
deleted file mode 100644
index 010d231..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/EdmTyped.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.commons.api.edm;
-
-/**
- * EdmTyped indicates if an EDM element is of a special type and holds the multiplicity of that type.
- */
-public interface EdmTyped {
-
- /**
- * See {@link EdmType} for more information about possible types.
- *
- * @return {@link EdmType}
- */
- EdmType getType();
-
- /**
- * @return true if this typed element is a collection
- */
- boolean isCollection();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/FullQualifiedName.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/FullQualifiedName.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/FullQualifiedName.java
deleted file mode 100644
index f7f6358..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/FullQualifiedName.java
+++ /dev/null
@@ -1,84 +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.commons.api.edm;
-
-/**
- * A full qualified name of any element in the EDM consists of a name and a namespace.
- */
-public class FullQualifiedName {
-
- private final String namespace;
-
- private final String name;
-
- private final String fqn;
-
- /**
- * @param namespace
- * @param name
- */
- public FullQualifiedName(final String namespace, final String name) {
- this.namespace = namespace;
- this.name = name;
- fqn = namespace + "." + name;
- }
-
- /**
- * @return namespace
- */
- public String getNamespace() {
- return namespace;
- }
-
- /**
- * @return name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @return namespace.name
- */
- public String getFullQualifiedNameAsString() {
- return fqn;
- }
-
- @Override
- public int hashCode() {
- return toString().hashCode();
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if ((obj == null) || !(obj instanceof FullQualifiedName)) {
- return false;
- }
- final FullQualifiedName other = (FullQualifiedName) obj;
- return namespace.equals(other.getNamespace()) && name.equals(other.getName());
- }
-
- @Override
- public String toString() {
- return fqn;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/Target.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/Target.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/Target.java
deleted file mode 100644
index 5acadc4..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/Target.java
+++ /dev/null
@@ -1,71 +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.commons.api.edm;
-
-public class Target {
-
- private String targetName;
-
- private FullQualifiedName entityContainer;
-
- public static class Builder {
-
- private final Target instance;
-
- public Builder(final String target, final EdmEntityContainer defaultContainer) {
- final String[] bindingTargetParts = target.split("/");
-
- instance = new Target();
- if (bindingTargetParts.length == 1) {
- instance.
- setEntityContainer(new FullQualifiedName(defaultContainer.getNamespace(), defaultContainer.getName())).
- setTargetName(bindingTargetParts[0]);
- } else {
- final int idx = bindingTargetParts[0].lastIndexOf('.');
- instance.
- setEntityContainer(new FullQualifiedName(
- bindingTargetParts[0].substring(0, idx), bindingTargetParts[0].substring(idx))).
- setTargetName(bindingTargetParts[1]);
- }
- }
-
- public Target build() {
- return instance;
- }
- }
-
- public String getTargetName() {
- return targetName;
- }
-
- public Target setTargetName(final String targetPathName) {
- targetName = targetPathName;
- return this;
- }
-
- public FullQualifiedName getEntityContainer() {
- return entityContainer;
- }
-
- public Target setEntityContainer(final FullQualifiedName entityContainer) {
- this.entityContainer = entityContainer;
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ConcurrencyMode.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ConcurrencyMode.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ConcurrencyMode.java
deleted file mode 100644
index 335ae8d..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ConcurrencyMode.java
+++ /dev/null
@@ -1,26 +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.commons.api.edm.constants;
-
-public enum ConcurrencyMode {
-
- None,
- Fixed
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmContentKind.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmContentKind.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmContentKind.java
deleted file mode 100644
index 9ec3c7a..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmContentKind.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 org.apache.olingo.odata4.commons.api.edm.constants;
-
-/**
- * Specifies the content type of the value of the property being mapped via a customizable feed mapping.
- */
-public enum EdmContentKind {
-
- text,
- html,
- xhtml;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmOnDelete.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmOnDelete.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmOnDelete.java
deleted file mode 100644
index 0ee60c6..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmOnDelete.java
+++ /dev/null
@@ -1,25 +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.commons.api.edm.constants;
-
-public enum EdmOnDelete {
-
- Cascade, None, SetNull, SetDefault;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmTargetPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmTargetPath.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmTargetPath.java
deleted file mode 100644
index 4028f84..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmTargetPath.java
+++ /dev/null
@@ -1,50 +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.commons.api.edm.constants;
-
-/**
- * EdmTargetPath specifies the possible default targets for an EDM property which is mapped to an atom element.
- */
-public class EdmTargetPath {
-
- public static final String SYNDICATION_AUTHORNAME = "SyndicationAuthorName";
-
- public static final String SYNDICATION_AUTHOREMAIL = "SyndicationAuthorEmail";
-
- public static final String SYNDICATION_AUTHORURI = "SyndicationAuthorUri";
-
- public static final String SYNDICATION_PUBLISHED = "SyndicationPublished";
-
- public static final String SYNDICATION_RIGHTS = "SyndicationRights";
-
- public static final String SYNDICATION_TITLE = "SyndicationTitle";
-
- public static final String SYNDICATION_UPDATED = "SyndicationUpdated";
-
- public static final String SYNDICATION_CONTRIBUTORNAME = "SyndicationContributorName";
-
- public static final String SYNDICATION_CONTRIBUTOREMAIL = "SyndicationContributorEmail";
-
- public static final String SYNDICATION_CONTRIBUTORURI = "SyndicationContributorUri";
-
- public static final String SYNDICATION_SOURCE = "SyndicationSource";
-
- public static final String SYNDICATION_SUMMARY = "SyndicationSummary";
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmTypeKind.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmTypeKind.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmTypeKind.java
deleted file mode 100644
index 6134851..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/EdmTypeKind.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.commons.api.edm.constants;
-
-/**
- * EdmTypeKind specifies the type of an EDM element.
- */
-public enum EdmTypeKind {
-
- UNDEFINED, PRIMITIVE, ENUM, DEFINITION, COMPLEX, ENTITY, NAVIGATION, ACTION, FUNCTION, SYSTEM;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ODataServiceVersion.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ODataServiceVersion.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ODataServiceVersion.java
deleted file mode 100644
index 4f35ebd..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/ODataServiceVersion.java
+++ /dev/null
@@ -1,140 +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.commons.api.edm.constants;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * This class is a container for the supported ODataServiceVersions.
- */
-public enum ODataServiceVersion {
-
- V10("1.0"),
- V20("2.0"),
- V30("3.0"),
- V40("4.0");
-
- private static final Pattern DATASERVICEVERSIONPATTERN = Pattern.compile("(\\p{Digit}+\\.\\p{Digit}+)(:?;.*)?");
-
- public static final String NS_DATASERVICES = "dataservices";
-
- public static final String NS_METADATA = "metadata";
-
- public static final String NS_DATA = "data";
-
- public static final String NS_SCHEME = "scheme";
-
- public static final String NAVIGATION_LINK_REL = "navigationLinkRel";
-
- public static final String ASSOCIATION_LINK_REL = "associationLinkRel";
-
- public static final String MEDIA_EDIT_LINK_REL = "mediaEditLinkRel";
-
- private static final Map<String, String> V30_NAMESPACES = Collections.unmodifiableMap(new HashMap<String, String>() {
-
- private static final long serialVersionUID = 3109256773218160485L;
-
- {
- put(NS_DATASERVICES, "http://schemas.microsoft.com/ado/2007/08/dataservices");
- put(NS_METADATA, "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata");
- put(NS_SCHEME, "http://schemas.microsoft.com/ado/2007/08/dataservices/scheme");
- put(NAVIGATION_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/related/");
- put(ASSOCIATION_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/");
- put(MEDIA_EDIT_LINK_REL, "http://schemas.microsoft.com/ado/2007/08/dataservices/edit-media/");
- }
- });
-
- private static final Map<String, String> V40_NAMESPACES = Collections.unmodifiableMap(new HashMap<String, String>() {
-
- private static final long serialVersionUID = 3109256773218160485L;
-
- {
- put(NS_METADATA, "http://docs.oasis-open.org/odata/ns/metadata");
- put(NS_DATA, "http://docs.oasis-open.org/odata/ns/data");
- }
- });
-
- /**
- * Validates format and range of a data service version string.
- *
- * @param version version string
- * @return <code>true</code> for a valid version
- */
- public static boolean validateDataServiceVersion(final String version) {
- final Matcher matcher = DATASERVICEVERSIONPATTERN.matcher(version);
- if (matcher.matches()) {
- final String possibleDataServiceVersion = matcher.group(1);
- return V10.toString().equals(possibleDataServiceVersion)
- || V20.toString().equals(possibleDataServiceVersion)
- || V30.toString().equals(possibleDataServiceVersion)
- || V40.toString().equals(possibleDataServiceVersion);
- } else {
- throw new IllegalArgumentException(version);
- }
- }
-
- /**
- * actual > comparedTo
- *
- * @param actual
- * @param comparedTo
- * @return <code>true</code> if actual is bigger than comparedTo
- */
- public static boolean isBiggerThan(final String actual, final String comparedTo) {
- if (!validateDataServiceVersion(comparedTo) || !validateDataServiceVersion(actual)) {
- throw new IllegalArgumentException("Illegal arguments: " + comparedTo + " and " + actual);
- }
-
- final double me = Double.parseDouble(extractDataServiceVersionString(actual));
- final double other = Double.parseDouble(extractDataServiceVersionString(comparedTo));
-
- return me > other;
- }
-
- private static String extractDataServiceVersionString(final String rawDataServiceVersion) {
- if (rawDataServiceVersion != null) {
- final String[] pattern = rawDataServiceVersion.split(";");
- return pattern[0];
- }
-
- return null;
- }
- private final String version;
-
- private ODataServiceVersion(final String version) {
- this.version = version;
- }
-
- public Map<String, String> getNamespaceMap() {
- return this == V10 || this == V20
- ? Collections.<String, String>emptyMap()
- : this == V30
- ? V30_NAMESPACES
- : V40_NAMESPACES;
- }
-
- @Override
- public String toString() {
- return version;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/StoreGeneratedPattern.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/StoreGeneratedPattern.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/StoreGeneratedPattern.java
deleted file mode 100644
index 3dad36b..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/constants/StoreGeneratedPattern.java
+++ /dev/null
@@ -1,27 +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.commons.api.edm.constants;
-
-public enum StoreGeneratedPattern {
-
- None,
- Identity,
- Computed
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/package-info.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/package-info.java b/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/package-info.java
deleted file mode 100644
index 3f32294..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/odata4/commons/api/edm/package-info.java
+++ /dev/null
@@ -1,19 +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.commons.api.edm;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java
new file mode 100644
index 0000000..bb7dd98
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmBindingTarget.java
@@ -0,0 +1,55 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmBindingTarget;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public abstract class AbstractEdmBindingTarget extends EdmNamedImpl implements EdmBindingTarget {
+
+ protected final EdmEntityContainer container;
+
+ private final FullQualifiedName type;
+
+ public AbstractEdmBindingTarget(final Edm edm, final EdmEntityContainer container,
+ final String name, final FullQualifiedName type) {
+
+ super(edm, name);
+ this.container = container;
+ this.type = type;
+ }
+
+ @Override
+ public EdmEntityContainer getEntityContainer() {
+ return container;
+ }
+
+ @Override
+ public EdmEntityType getEntityType() {
+ final EdmEntityType entityType = edm.getEntityType(this.type);
+ if (entityType == null) {
+ throw new EdmException("Can´t find entity type: " + type + " for entity set or singleton: " + getName());
+ }
+ return entityType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmComplexType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmComplexType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmComplexType.java
new file mode 100644
index 0000000..346eb2e
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmComplexType.java
@@ -0,0 +1,50 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmStructuredType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public abstract class AbstractEdmComplexType extends AbstractEdmStructuredType implements EdmComplexType {
+
+ public AbstractEdmComplexType(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName) {
+ super(edm, fqn, EdmTypeKind.COMPLEX, baseTypeName);
+ }
+
+ @Override
+ protected EdmStructuredType buildBaseType(final FullQualifiedName baseTypeName) {
+ EdmComplexType baseType = null;
+ if (baseTypeName != null) {
+ baseType = edm.getComplexType(baseTypeName);
+ if (baseType == null) {
+ throw new EdmException("Can't find base type with name: " + baseTypeName + " for complex type: " + getName());
+ }
+ }
+ return baseType;
+ }
+
+ @Override
+ public EdmComplexType getBaseType() {
+ return (EdmComplexType) baseType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEntityContainer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEntityContainer.java
new file mode 100644
index 0000000..5d108cb
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEntityContainer.java
@@ -0,0 +1,102 @@
+/*
+ * 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.commons.core.edm;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmActionImport;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+import org.apache.olingo.commons.api.edm.EdmSingleton;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public abstract class AbstractEdmEntityContainer extends EdmNamedImpl implements EdmEntityContainer {
+
+ protected final FullQualifiedName entityContainerName;
+
+ private final Map<String, EdmSingleton> singletons = new HashMap<String, EdmSingleton>();
+
+ private final Map<String, EdmEntitySet> entitySets = new HashMap<String, EdmEntitySet>();
+
+ private final Map<String, EdmActionImport> actionImports = new HashMap<String, EdmActionImport>();
+
+ private final Map<String, EdmFunctionImport> functionImports = new HashMap<String, EdmFunctionImport>();
+
+ public AbstractEdmEntityContainer(final Edm edm, final FullQualifiedName entityContainerName) {
+ super(edm, entityContainerName.getName());
+ this.entityContainerName = entityContainerName;
+ }
+
+ @Override
+ public String getNamespace() {
+ return entityContainerName.getNamespace();
+ }
+
+ protected abstract EdmSingleton createSingleton(String singletonName);
+
+ @Override
+ public EdmSingleton getSingleton(final String singletonName) {
+ EdmSingleton singleton = singletons.get(singletonName);
+ if (singleton == null) {
+ singleton = createSingleton(singletonName);
+ singletons.put(singletonName, singleton);
+ }
+ return singleton;
+ }
+
+ protected abstract EdmEntitySet createEntitySet(String entitySetName);
+
+ @Override
+ public EdmEntitySet getEntitySet(final String entitySetName) {
+ EdmEntitySet entitySet = entitySets.get(entitySetName);
+ if (entitySet == null) {
+ entitySet = createEntitySet(entitySetName);
+ entitySets.put(entitySetName, entitySet);
+ }
+ return entitySet;
+ }
+
+ protected abstract EdmActionImport createActionImport(String actionImportName);
+
+ @Override
+ public EdmActionImport getActionImport(final String actionImportName) {
+ EdmActionImport actionImport = actionImports.get(actionImportName);
+ if (actionImport == null) {
+ actionImport = createActionImport(actionImportName);
+ actionImports.put(actionImportName, actionImport);
+ }
+ return actionImport;
+ }
+
+ protected abstract EdmFunctionImport createFunctionImport(String functionImportName);
+
+ @Override
+ public EdmFunctionImport getFunctionImport(final String functionImportName) {
+ EdmFunctionImport functionImport = functionImports.get(functionImportName);
+ if (functionImport == null) {
+ functionImport = createFunctionImport(functionImportName);
+ functionImports.put(functionImportName, functionImport);
+ }
+ return functionImport;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEntityType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEntityType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEntityType.java
new file mode 100644
index 0000000..eb9d170
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEntityType.java
@@ -0,0 +1,114 @@
+/*
+ * 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.commons.core.edm;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
+import org.apache.olingo.commons.api.edm.EdmStructuredType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public abstract class AbstractEdmEntityType extends AbstractEdmStructuredType implements EdmEntityType {
+
+ private final boolean hasStream;
+
+ protected EdmEntityType entityBaseType;
+
+ private final List<String> keyPredicateNames = new ArrayList<String>();
+
+ private final Map<String, EdmKeyPropertyRef> keyPropertyRefs = new LinkedHashMap<String, EdmKeyPropertyRef>();
+
+ private List<EdmKeyPropertyRef> keyPropertyRefsList;
+
+ protected AbstractEdmEntityType(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName,
+ final boolean hashStream) {
+
+ super(edm, fqn, EdmTypeKind.ENTITY, baseTypeName);
+ this.hasStream = hashStream;
+ }
+
+ protected void setEdmKeyPropertyRef(final List<EdmKeyPropertyRef> edmKey) {
+ for (EdmKeyPropertyRef ref : edmKey) {
+ if (ref.getAlias() == null) {
+ keyPredicateNames.add(ref.getKeyPropertyName());
+ keyPropertyRefs.put(ref.getKeyPropertyName(), ref);
+ } else {
+ keyPredicateNames.add(ref.getAlias());
+ keyPropertyRefs.put(ref.getAlias(), ref);
+ }
+ }
+ }
+
+ @Override
+ protected EdmStructuredType buildBaseType(final FullQualifiedName baseTypeName) {
+ EdmEntityType baseType = null;
+ if (baseTypeName != null) {
+ baseType = edm.getEntityType(baseTypeName);
+ if (baseType == null) {
+ throw new EdmException("Cannot find base type with name: " + baseTypeName + " for entity type: " + getName());
+ }
+ }
+ return baseType;
+ }
+
+ @Override
+ public EdmEntityType getBaseType() {
+ return entityBaseType;
+ }
+
+ @Override
+ public List<String> getKeyPredicateNames() {
+ if (keyPredicateNames.isEmpty() && baseType != null) {
+ return entityBaseType.getKeyPredicateNames();
+ }
+ return keyPredicateNames;
+ }
+
+ @Override
+ public List<EdmKeyPropertyRef> getKeyPropertyRefs() {
+ if (keyPropertyRefsList == null) {
+ keyPropertyRefsList = new ArrayList<EdmKeyPropertyRef>(keyPropertyRefs.values());
+ }
+ if (keyPropertyRefsList.isEmpty() && entityBaseType != null) {
+ return entityBaseType.getKeyPropertyRefs();
+ }
+ return keyPropertyRefsList;
+ }
+
+ @Override
+ public EdmKeyPropertyRef getKeyPropertyRef(final String keyPredicateName) {
+ final EdmKeyPropertyRef edmKeyPropertyRef = keyPropertyRefs.get(keyPredicateName);
+ if (edmKeyPropertyRef == null && entityBaseType != null) {
+ return entityBaseType.getKeyPropertyRef(keyPredicateName);
+ }
+ return edmKeyPropertyRef;
+ }
+
+ @Override
+ public boolean hasStream() {
+ return hasStream;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEnumType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEnumType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEnumType.java
new file mode 100644
index 0000000..8fcf143
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEnumType.java
@@ -0,0 +1,206 @@
+/*
+ * 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.commons.core.edm;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmMember;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmInt64;
+
+public abstract class AbstractEdmEnumType extends EdmTypeImpl implements EdmEnumType {
+
+ private final boolean isFlags;
+
+ private final String uriPrefix;
+
+ private final String uriSuffix;
+
+ private List<String> memberNames;
+
+ private Map<String, EdmMember> members;
+
+ public AbstractEdmEnumType(final Edm edm, final FullQualifiedName fqn, final boolean isFlags) {
+ super(edm, fqn, EdmTypeKind.ENUM);
+
+ this.isFlags = isFlags;
+ this.uriPrefix = fqn.getFullQualifiedNameAsString() + '\'';
+ this.uriSuffix = "'";
+ }
+
+ protected abstract Collection<? extends EdmMember> getMembers();
+
+ @Override
+ public EdmMember getMember(final String name) {
+ if (members == null) {
+ members = new LinkedHashMap<String, EdmMember>();
+ for (final EdmMember member : getMembers()) {
+ members.put(member.getName(), member);
+ }
+ }
+ return members.get(name);
+ }
+
+ @Override
+ public List<String> getMemberNames() {
+ if (memberNames == null) {
+ memberNames = new ArrayList<String>();
+ for (final EdmMember member : getMembers()) {
+ memberNames.add(member.getName());
+ }
+ }
+ return memberNames;
+ }
+
+ @Override
+ public abstract EdmPrimitiveType getUnderlyingType();
+
+ @Override
+ public boolean isCompatible(final EdmPrimitiveType primitiveType) {
+ return equals(primitiveType);
+ }
+
+ @Override
+ public Class<?> getDefaultType() {
+ return getUnderlyingType().getDefaultType();
+ }
+
+ @Override
+ public boolean validate(final String value, final Boolean isNullable, final Integer maxLength,
+ final Integer precision, final Integer scale, final Boolean isUnicode) {
+
+ try {
+ valueOfString(value, isNullable, maxLength, precision, scale, isUnicode, getDefaultType());
+ return true;
+ } catch (final EdmPrimitiveTypeException e) {
+ return false;
+ }
+ }
+
+ private Long parseEnumValue(final String value) throws EdmPrimitiveTypeException {
+ Long result = null;
+ for (final String memberValue : value.split(",", isFlags ? -1 : 1)) {
+ Long memberValueLong = null;
+ for (final EdmMember member : getMembers()) {
+ if (member.getName().equals(memberValue) || member.getValue().equals(memberValue)) {
+ memberValueLong = Long.decode(member.getValue());
+ }
+ }
+ if (memberValueLong == null) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+ }
+ result = result == null ? memberValueLong : result | memberValueLong;
+ }
+ return result;
+ }
+
+ @Override
+ public <T> T valueOfString(final String value, final Boolean isNullable, final Integer maxLength,
+ final Integer precision, final Integer scale, final Boolean isUnicode, final Class<T> returnType)
+ throws EdmPrimitiveTypeException {
+
+ if (value == null) {
+ if (isNullable != null && !isNullable) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_NULL_NOT_ALLOWED");
+ }
+ return null;
+ }
+
+ try {
+ return EdmInt64.convertNumber(parseEnumValue(value), returnType);
+ } catch (final IllegalArgumentException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+ } catch (final ClassCastException e) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+ }
+ }
+
+ protected String constructEnumValue(final long value) throws EdmPrimitiveTypeException {
+ long remaining = value;
+ StringBuilder result = new StringBuilder();
+
+ for (final EdmMember member : getMembers()) {
+ final long memberValue = Long.parseLong(member.getValue());
+ if ((memberValue & remaining) == memberValue) {
+ if (result.length() > 0) {
+ result.append(',');
+ }
+ result.append(member.getName());
+ remaining ^= memberValue;
+ }
+ }
+
+ if (remaining != 0) {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+ }
+ return result.toString();
+ }
+
+ @Override
+ public String valueToString(final Object value, final Boolean isNullable, final Integer maxLength,
+ final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
+
+ if (value == null) {
+ if (isNullable != null && !isNullable) {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_NULL_NOT_ALLOWED");
+ }
+ return null;
+ }
+ if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) {
+ return constructEnumValue(((Number) value).longValue());
+ } else {
+ throw new EdmPrimitiveTypeException(
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+ }
+ }
+
+ @Override
+ public String toUriLiteral(final String literal) {
+ return literal == null ? null
+ : uriPrefix.isEmpty() && uriSuffix.isEmpty() ? literal : uriPrefix + literal + uriSuffix;
+ }
+
+ @Override
+ public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
+ if (literal == null) {
+ return null;
+ } else if (uriPrefix.isEmpty() && uriSuffix.isEmpty()) {
+ return literal;
+ } else if (literal.length() >= uriPrefix.length() + uriSuffix.length()
+ && literal.startsWith(uriPrefix) && literal.endsWith(uriSuffix)) {
+ return literal.substring(uriPrefix.length(), literal.length() - uriSuffix.length());
+ } else {
+ throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(literal)");
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmImpl.java
new file mode 100644
index 0000000..9890dac
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmImpl.java
@@ -0,0 +1,252 @@
+/*
+ * 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.commons.core.edm;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmServiceMetadata;
+import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public abstract class AbstractEdmImpl implements Edm {
+
+ private final Map<FullQualifiedName, EdmEntityContainer> entityContainers
+ = new HashMap<FullQualifiedName, EdmEntityContainer>();
+
+ private final Map<FullQualifiedName, EdmEnumType> enumTypes
+ = new HashMap<FullQualifiedName, EdmEnumType>();
+
+ private final Map<FullQualifiedName, EdmTypeDefinition> typeDefinitions
+ = new HashMap<FullQualifiedName, EdmTypeDefinition>();
+
+ private final Map<FullQualifiedName, EdmEntityType> entityTypes
+ = new HashMap<FullQualifiedName, EdmEntityType>();
+
+ private final Map<FullQualifiedName, EdmComplexType> complexTypes
+ = new HashMap<FullQualifiedName, EdmComplexType>();
+
+ private final Map<FullQualifiedName, EdmAction> unboundActions
+ = new HashMap<FullQualifiedName, EdmAction>();
+
+ private final Map<FunctionMapKey, EdmFunction> unboundFunctions
+ = new HashMap<FunctionMapKey, EdmFunction>();
+
+ private final Map<ActionMapKey, EdmAction> boundActions
+ = new HashMap<ActionMapKey, EdmAction>();
+
+ private final Map<FunctionMapKey, EdmFunction> boundFunctions
+ = new HashMap<FunctionMapKey, EdmFunction>();
+
+ private EdmServiceMetadata serviceMetadata;
+
+ private Map<String, String> aliasToNamespaceInfo;
+
+ @Override
+ public EdmEntityContainer getEntityContainer(final FullQualifiedName namespaceOrAliasFQN) {
+ final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
+ EdmEntityContainer container = entityContainers.get(fqn);
+ if (container == null) {
+ container = createEntityContainer(fqn);
+ if (container != null) {
+ entityContainers.put(fqn, container);
+ if (fqn == null) {
+ entityContainers.put(new FullQualifiedName(container.getNamespace(), container.getName()), container);
+ }
+ }
+ }
+ return container;
+ }
+
+ @Override
+ public EdmEnumType getEnumType(final FullQualifiedName namespaceOrAliasFQN) {
+ final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
+ EdmEnumType enumType = enumTypes.get(fqn);
+ if (enumType == null) {
+ enumType = createEnumType(fqn);
+ if (enumType != null) {
+ enumTypes.put(fqn, enumType);
+ }
+ }
+ return enumType;
+ }
+
+ @Override
+ public EdmTypeDefinition getTypeDefinition(final FullQualifiedName namespaceOrAliasFQN) {
+ final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
+ EdmTypeDefinition typeDefinition = typeDefinitions.get(fqn);
+ if (typeDefinition == null) {
+ typeDefinition = createTypeDefinition(fqn);
+ if (typeDefinition != null) {
+ typeDefinitions.put(fqn, typeDefinition);
+ }
+ }
+ return typeDefinition;
+ }
+
+ @Override
+ public EdmEntityType getEntityType(final FullQualifiedName namespaceOrAliasFQN) {
+ final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
+ EdmEntityType entityType = entityTypes.get(fqn);
+ if (entityType == null) {
+ entityType = createEntityType(fqn);
+ if (entityType != null) {
+ entityTypes.put(fqn, entityType);
+ }
+ }
+ return entityType;
+ }
+
+ @Override
+ public EdmComplexType getComplexType(final FullQualifiedName namespaceOrAliasFQN) {
+ final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
+ EdmComplexType complexType = complexTypes.get(fqn);
+ if (complexType == null) {
+ complexType = createComplexType(fqn);
+ if (complexType != null) {
+ complexTypes.put(fqn, complexType);
+ }
+ }
+ return complexType;
+ }
+
+ @Override
+ public EdmAction getAction(final FullQualifiedName actionName, final FullQualifiedName bindingParameterTypeName,
+ final Boolean isBindingParameterCollection) {
+
+ EdmAction action = null;
+
+ final FullQualifiedName actionFqn = resolvePossibleAlias(actionName);
+ if (bindingParameterTypeName == null) {
+ action = unboundActions.get(actionName);
+ if (action == null) {
+ action = createUnboundAction(actionFqn);
+ if (action != null) {
+ unboundActions.put(actionName, action);
+ }
+ }
+ } else {
+ final FullQualifiedName bindingParameterTypeFqn = resolvePossibleAlias(bindingParameterTypeName);
+ final ActionMapKey key = new ActionMapKey(actionFqn, bindingParameterTypeFqn, isBindingParameterCollection);
+ action = boundActions.get(key);
+ if (action == null) {
+ action = createBoundAction(actionFqn, bindingParameterTypeFqn, isBindingParameterCollection);
+ if (action != null) {
+ boundActions.put(key, action);
+ }
+ }
+ }
+
+ return action;
+ }
+
+ @Override
+ public EdmFunction getFunction(final FullQualifiedName functionName,
+ final FullQualifiedName bindingParameterTypeName,
+ final Boolean isBindingParameterCollection, final List<String> parameterNames) {
+
+ EdmFunction function = null;
+
+ final FullQualifiedName functionFqn = resolvePossibleAlias(functionName);
+ if (bindingParameterTypeName == null) {
+ final FunctionMapKey key = new FunctionMapKey(
+ functionFqn, bindingParameterTypeName, isBindingParameterCollection, parameterNames);
+ function = unboundFunctions.get(key);
+ if (function == null) {
+ function = createUnboundFunction(functionFqn, parameterNames);
+ if (function != null) {
+ unboundFunctions.put(key, function);
+ }
+ }
+ } else {
+ final FullQualifiedName bindingParameterTypeFqn = resolvePossibleAlias(bindingParameterTypeName);
+ final FunctionMapKey key
+ = new FunctionMapKey(functionFqn, bindingParameterTypeFqn, isBindingParameterCollection, parameterNames);
+ function = boundFunctions.get(key);
+ if (function == null) {
+ function = createBoundFunction(functionFqn, bindingParameterTypeFqn, isBindingParameterCollection,
+ parameterNames);
+ if (function != null) {
+ boundFunctions.put(key, function);
+ }
+ }
+ }
+
+ return function;
+ }
+
+ @Override
+ public EdmServiceMetadata getServiceMetadata() {
+ if (serviceMetadata == null) {
+ serviceMetadata = createServiceMetadata();
+ }
+ return serviceMetadata;
+ }
+
+ private FullQualifiedName resolvePossibleAlias(final FullQualifiedName namespaceOrAliasFQN) {
+ if (aliasToNamespaceInfo == null) {
+ aliasToNamespaceInfo = createAliasToNamespaceInfo();
+ }
+ FullQualifiedName finalFQN = null;
+ if (namespaceOrAliasFQN != null) {
+ final String namespace = aliasToNamespaceInfo.get(namespaceOrAliasFQN.getNamespace());
+ // If not contained in info it must be a namespace
+ if (namespace == null) {
+ finalFQN = namespaceOrAliasFQN;
+ } else {
+ finalFQN = new FullQualifiedName(namespace, namespaceOrAliasFQN.getName());
+ }
+ }
+ return finalFQN;
+ }
+
+ protected abstract Map<String, String> createAliasToNamespaceInfo();
+
+ protected abstract EdmEntityContainer createEntityContainer(FullQualifiedName containerName);
+
+ protected abstract EdmEnumType createEnumType(FullQualifiedName enumName);
+
+ protected abstract EdmTypeDefinition createTypeDefinition(FullQualifiedName typeDefinitionName);
+
+ protected abstract EdmEntityType createEntityType(FullQualifiedName entityTypeName);
+
+ protected abstract EdmComplexType createComplexType(FullQualifiedName complexTypeName);
+
+ protected abstract EdmAction createUnboundAction(FullQualifiedName actionName);
+
+ protected abstract EdmFunction createUnboundFunction(FullQualifiedName functionName, List<String> parameterNames);
+
+ protected abstract EdmAction createBoundAction(FullQualifiedName actionName,
+ FullQualifiedName bindingParameterTypeName,
+ Boolean isBindingParameterCollection);
+
+ protected abstract EdmFunction createBoundFunction(FullQualifiedName functionName,
+ FullQualifiedName bindingParameterTypeName, Boolean isBindingParameterCollection,
+ List<String> parameterNames);
+
+ protected abstract EdmServiceMetadata createServiceMetadata();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmKeyPropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmKeyPropertyRef.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmKeyPropertyRef.java
new file mode 100644
index 0000000..7e4597e
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmKeyPropertyRef.java
@@ -0,0 +1,80 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.EdmStructuredType;
+
+public abstract class AbstractEdmKeyPropertyRef implements EdmKeyPropertyRef {
+
+ private final EdmEntityType edmEntityType;
+
+ private EdmProperty property;
+
+ public AbstractEdmKeyPropertyRef(final EdmEntityType edmEntityType) {
+ this.edmEntityType = edmEntityType;
+ }
+
+ @Override
+ public abstract String getKeyPropertyName();
+
+ @Override
+ public abstract String getAlias();
+
+ @Override
+ public abstract String getPath();
+
+ @Override
+ public EdmProperty getProperty() {
+ if (property == null) {
+ if (getAlias() == null) {
+ property = edmEntityType.getStructuralProperty(getKeyPropertyName());
+ if (property == null) {
+ throw new EdmException("Invalid key property ref specified. Can´t find property with name: "
+ + getKeyPropertyName());
+ }
+ } else {
+ if (getPath() == null || getPath().isEmpty()) {
+ throw new EdmException("Alias but no path specified for propertyRef");
+ }
+ final String[] splitPath = getPath().split("/");
+ EdmStructuredType structType = edmEntityType;
+ for (int i = 0; i < splitPath.length - 1; i++) {
+ final EdmProperty _property = structType.getStructuralProperty(splitPath[i]);
+ if (_property == null) {
+ throw new EdmException("Invalid property ref specified. Can´t find property with name: " + splitPath[i]
+ + " at type: " + structType.getNamespace() + "." + structType.getName());
+ }
+ structType = (EdmStructuredType) _property.getType();
+ }
+ property = structType.getStructuralProperty(splitPath[splitPath.length - 1]);
+ if (property == null) {
+ throw new EdmException("Invalid property ref specified. Can´t find property with name: "
+ + splitPath[splitPath.length - 1] + " at type: " + structType.getNamespace() + "."
+ + structType.getName());
+ }
+ }
+ }
+
+ return property;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmNavigationProperty.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmNavigationProperty.java
new file mode 100644
index 0000000..dca80bd
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmNavigationProperty.java
@@ -0,0 +1,76 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmStructuredType;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public abstract class AbstractEdmNavigationProperty extends EdmElementImpl implements EdmNavigationProperty {
+
+ private EdmEntityType typeImpl;
+
+ private EdmNavigationProperty partnerNavigationProperty;
+
+ public AbstractEdmNavigationProperty(final Edm edm, final String name) {
+ super(edm, name);
+ }
+
+ protected abstract FullQualifiedName getTypeFQN();
+
+ @Override
+ public EdmType getType() {
+ if (typeImpl == null) {
+ typeImpl = edm.getEntityType(getTypeFQN());
+ if (typeImpl == null) {
+ throw new EdmException("Cannot find type with name: " + getTypeFQN());
+ }
+ }
+ return typeImpl;
+ }
+
+ protected abstract String internatGetPartner();
+
+ @Override
+ public EdmNavigationProperty getPartner() {
+ if (partnerNavigationProperty == null) {
+ String partner = internatGetPartner();
+ if (partner != null) {
+ EdmStructuredType type = (EdmStructuredType) getType();
+ EdmNavigationProperty property = null;
+ final String[] split = partner.split("/");
+ for (String element : split) {
+ property = type.getNavigationProperty(element);
+ if (property == null) {
+ throw new EdmException("Cannot find property with name: " + element + " at type " + type.getName());
+ }
+ type = (EdmStructuredType) property.getType();
+ }
+ partnerNavigationProperty = property;
+ }
+ }
+ return partnerNavigationProperty;
+ }
+
+ public abstract String getReferencingPropertyName(String referencedPropertyName);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperation.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperation.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperation.java
new file mode 100644
index 0000000..b848540
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperation.java
@@ -0,0 +1,114 @@
+/*
+ * 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.commons.core.edm;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmBindingTarget;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmOperation;
+import org.apache.olingo.commons.api.edm.EdmParameter;
+import org.apache.olingo.commons.api.edm.EdmReturnType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public abstract class AbstractEdmOperation extends EdmTypeImpl implements EdmOperation {
+
+ private final Map<String, EdmParameter> parameters = new LinkedHashMap<String, EdmParameter>();
+
+ private String entitySetPath;
+
+ private boolean isBound;
+
+ private EdmReturnType returnType;
+
+ private List<String> parameterNames;
+
+ protected AbstractEdmOperation(final Edm edm, final FullQualifiedName fqn, final EdmTypeKind kind) {
+ super(edm, fqn, kind);
+ }
+
+ protected void setParameters(final List<EdmParameter> _parameters) {
+ for (EdmParameter parameter : _parameters) {
+ parameters.put(parameter.getName(), parameter);
+ }
+ }
+
+ protected void setEntitySetPath(final String entitySetPath) {
+ this.entitySetPath = entitySetPath;
+ }
+
+ protected void setIsBound(final boolean isBound) {
+ this.isBound = isBound;
+ }
+
+ protected void setReturnType(final EdmReturnType returnType) {
+ this.returnType = returnType;
+ }
+
+ @Override
+ public EdmParameter getParameter(final String name) {
+ return parameters.get(name);
+ }
+
+ @Override
+ public List<String> getParameterNames() {
+ if (parameterNames == null) {
+ parameterNames = new ArrayList<String>(parameters.size());
+ for (String parameterName : parameters.keySet()) {
+ parameterNames.add(parameterName);
+ }
+ }
+ return parameterNames;
+ }
+
+ @Override
+ public EdmEntitySet getReturnedEntitySet(final EdmEntitySet bindingParameterEntitySet) {
+ EdmEntitySet returnedEntitySet = null;
+ if (bindingParameterEntitySet != null && entitySetPath != null) {
+ final EdmBindingTarget relatedBindingTarget = bindingParameterEntitySet.
+ getRelatedBindingTarget(entitySetPath);
+ if (relatedBindingTarget == null) {
+ throw new EdmException("Cannot find entity set with path: " + entitySetPath);
+ }
+ if (relatedBindingTarget instanceof EdmEntitySet) {
+ returnedEntitySet = (EdmEntitySet) relatedBindingTarget;
+ } else {
+ throw new EdmException("BindingTarget with name: " + relatedBindingTarget.getName() + " must be an entity set");
+ }
+ }
+ return returnedEntitySet;
+ }
+
+ @Override
+ public EdmReturnType getReturnType() {
+ return returnType;
+ }
+
+ @Override
+ public boolean isBound() {
+ return isBound;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperationImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperationImport.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperationImport.java
new file mode 100644
index 0000000..96aa49f
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmOperationImport.java
@@ -0,0 +1,63 @@
+/*
+ * 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.commons.core.edm;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmOperationImport;
+import org.apache.olingo.commons.api.edm.Target;
+
+public abstract class AbstractEdmOperationImport extends EdmNamedImpl implements EdmOperationImport {
+
+ protected final EdmEntityContainer container;
+
+ private final Target entitySet;
+
+ private EdmEntitySet returnedEntitySet;
+
+ public AbstractEdmOperationImport(final Edm edm, final EdmEntityContainer container, final String name,
+ final Target entitySet) {
+
+ super(edm, name);
+ this.container = container;
+ this.entitySet = entitySet;
+ }
+
+ @Override
+ public EdmEntitySet getReturnedEntitySet() {
+ if (entitySet != null && returnedEntitySet == null) {
+ EdmEntityContainer entityContainer = edm.getEntityContainer(entitySet.getEntityContainer());
+ if (entityContainer == null) {
+ throw new EdmException("Can´t find entity container with name: " + entitySet.getEntityContainer());
+ }
+ returnedEntitySet = entityContainer.getEntitySet(entitySet.getTargetName());
+ if (returnedEntitySet == null) {
+ throw new EdmException("Can´t find entity set with name: " + entitySet.getTargetName());
+ }
+ }
+ return returnedEntitySet;
+ }
+
+ @Override
+ public EdmEntityContainer getEntityContainer() {
+ return container;
+ }
+}
[13/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEnumType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEnumType.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEnumType.java
deleted file mode 100644
index dd89349..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmEnumType.java
+++ /dev/null
@@ -1,205 +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.commons.core.edm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-import org.apache.olingo.odata4.commons.api.edm.EdmMember;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmInt64;
-
-public abstract class AbstractEdmEnumType extends EdmTypeImpl implements EdmEnumType {
-
- private final boolean isFlags;
-
- private final String uriPrefix;
-
- private final String uriSuffix;
-
- private List<String> memberNames;
-
- private Map<String, EdmMember> members;
-
- public AbstractEdmEnumType(final Edm edm, final FullQualifiedName fqn, final boolean isFlags) {
- super(edm, fqn, EdmTypeKind.ENUM);
-
- this.isFlags = isFlags;
- this.uriPrefix = fqn.getFullQualifiedNameAsString() + '\'';
- this.uriSuffix = "'";
- }
-
- protected abstract Collection<? extends EdmMember> getMembers();
-
- @Override
- public EdmMember getMember(final String name) {
- if (members == null) {
- members = new LinkedHashMap<String, EdmMember>();
- for (final EdmMember member : getMembers()) {
- members.put(member.getName(), member);
- }
- }
- return members.get(name);
- }
-
- @Override
- public List<String> getMemberNames() {
- if (memberNames == null) {
- memberNames = new ArrayList<String>();
- for (final EdmMember member : getMembers()) {
- memberNames.add(member.getName());
- }
- }
- return memberNames;
- }
-
- @Override
- public abstract EdmPrimitiveType getUnderlyingType();
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return equals(primitiveType);
- }
-
- @Override
- public Class<?> getDefaultType() {
- return getUnderlyingType().getDefaultType();
- }
-
- @Override
- public boolean validate(final String value, final Boolean isNullable, final Integer maxLength,
- final Integer precision, final Integer scale, final Boolean isUnicode) {
-
- try {
- valueOfString(value, isNullable, maxLength, precision, scale, isUnicode, getDefaultType());
- return true;
- } catch (final EdmPrimitiveTypeException e) {
- return false;
- }
- }
-
- private Long parseEnumValue(final String value) throws EdmPrimitiveTypeException {
- Long result = null;
- for (final String memberValue : value.split(",", isFlags ? -1 : 1)) {
- Long memberValueLong = null;
- for (final EdmMember member : getMembers()) {
- if (member.getName().equals(memberValue) || member.getValue().equals(memberValue)) {
- memberValueLong = Long.decode(member.getValue());
- }
- }
- if (memberValueLong == null) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
- result = result == null ? memberValueLong : result | memberValueLong;
- }
- return result;
- }
-
- @Override
- public <T> T valueOfString(final String value, final Boolean isNullable, final Integer maxLength,
- final Integer precision, final Integer scale, final Boolean isUnicode, final Class<T> returnType)
- throws EdmPrimitiveTypeException {
-
- if (value == null) {
- if (isNullable != null && !isNullable) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_NULL_NOT_ALLOWED");
- }
- return null;
- }
-
- try {
- return EdmInt64.convertNumber(parseEnumValue(value), returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- protected String constructEnumValue(final long value) throws EdmPrimitiveTypeException {
- long remaining = value;
- StringBuilder result = new StringBuilder();
-
- for (final EdmMember member : getMembers()) {
- final long memberValue = Long.parseLong(member.getValue());
- if ((memberValue & remaining) == memberValue) {
- if (result.length() > 0) {
- result.append(',');
- }
- result.append(member.getName());
- remaining ^= memberValue;
- }
- }
-
- if (remaining != 0) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- return result.toString();
- }
-
- @Override
- public String valueToString(final Object value, final Boolean isNullable, final Integer maxLength,
- final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- if (value == null) {
- if (isNullable != null && !isNullable) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_NULL_NOT_ALLOWED");
- }
- return null;
- }
- if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) {
- return constructEnumValue(((Number) value).longValue());
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-
- @Override
- public String toUriLiteral(final String literal) {
- return literal == null ? null
- : uriPrefix.isEmpty() && uriSuffix.isEmpty() ? literal : uriPrefix + literal + uriSuffix;
- }
-
- @Override
- public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
- if (literal == null) {
- return null;
- } else if (uriPrefix.isEmpty() && uriSuffix.isEmpty()) {
- return literal;
- } else if (literal.length() >= uriPrefix.length() + uriSuffix.length()
- && literal.startsWith(uriPrefix) && literal.endsWith(uriSuffix)) {
- return literal.substring(uriPrefix.length(), literal.length() - uriSuffix.length());
- } else {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(literal)");
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmImpl.java
deleted file mode 100644
index 34eba4b..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmImpl.java
+++ /dev/null
@@ -1,252 +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.commons.core.edm;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.EdmServiceMetadata;
-import org.apache.olingo.odata4.commons.api.edm.EdmTypeDefinition;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public abstract class AbstractEdmImpl implements Edm {
-
- private final Map<FullQualifiedName, EdmEntityContainer> entityContainers
- = new HashMap<FullQualifiedName, EdmEntityContainer>();
-
- private final Map<FullQualifiedName, EdmEnumType> enumTypes
- = new HashMap<FullQualifiedName, EdmEnumType>();
-
- private final Map<FullQualifiedName, EdmTypeDefinition> typeDefinitions
- = new HashMap<FullQualifiedName, EdmTypeDefinition>();
-
- private final Map<FullQualifiedName, EdmEntityType> entityTypes
- = new HashMap<FullQualifiedName, EdmEntityType>();
-
- private final Map<FullQualifiedName, EdmComplexType> complexTypes
- = new HashMap<FullQualifiedName, EdmComplexType>();
-
- private final Map<FullQualifiedName, EdmAction> unboundActions
- = new HashMap<FullQualifiedName, EdmAction>();
-
- private final Map<FunctionMapKey, EdmFunction> unboundFunctions
- = new HashMap<FunctionMapKey, EdmFunction>();
-
- private final Map<ActionMapKey, EdmAction> boundActions
- = new HashMap<ActionMapKey, EdmAction>();
-
- private final Map<FunctionMapKey, EdmFunction> boundFunctions
- = new HashMap<FunctionMapKey, EdmFunction>();
-
- private EdmServiceMetadata serviceMetadata;
-
- private Map<String, String> aliasToNamespaceInfo;
-
- @Override
- public EdmEntityContainer getEntityContainer(final FullQualifiedName namespaceOrAliasFQN) {
- final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
- EdmEntityContainer container = entityContainers.get(fqn);
- if (container == null) {
- container = createEntityContainer(fqn);
- if (container != null) {
- entityContainers.put(fqn, container);
- if (fqn == null) {
- entityContainers.put(new FullQualifiedName(container.getNamespace(), container.getName()), container);
- }
- }
- }
- return container;
- }
-
- @Override
- public EdmEnumType getEnumType(final FullQualifiedName namespaceOrAliasFQN) {
- final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
- EdmEnumType enumType = enumTypes.get(fqn);
- if (enumType == null) {
- enumType = createEnumType(fqn);
- if (enumType != null) {
- enumTypes.put(fqn, enumType);
- }
- }
- return enumType;
- }
-
- @Override
- public EdmTypeDefinition getTypeDefinition(final FullQualifiedName namespaceOrAliasFQN) {
- final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
- EdmTypeDefinition typeDefinition = typeDefinitions.get(fqn);
- if (typeDefinition == null) {
- typeDefinition = createTypeDefinition(fqn);
- if (typeDefinition != null) {
- typeDefinitions.put(fqn, typeDefinition);
- }
- }
- return typeDefinition;
- }
-
- @Override
- public EdmEntityType getEntityType(final FullQualifiedName namespaceOrAliasFQN) {
- final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
- EdmEntityType entityType = entityTypes.get(fqn);
- if (entityType == null) {
- entityType = createEntityType(fqn);
- if (entityType != null) {
- entityTypes.put(fqn, entityType);
- }
- }
- return entityType;
- }
-
- @Override
- public EdmComplexType getComplexType(final FullQualifiedName namespaceOrAliasFQN) {
- final FullQualifiedName fqn = resolvePossibleAlias(namespaceOrAliasFQN);
- EdmComplexType complexType = complexTypes.get(fqn);
- if (complexType == null) {
- complexType = createComplexType(fqn);
- if (complexType != null) {
- complexTypes.put(fqn, complexType);
- }
- }
- return complexType;
- }
-
- @Override
- public EdmAction getAction(final FullQualifiedName actionName, final FullQualifiedName bindingParameterTypeName,
- final Boolean isBindingParameterCollection) {
-
- EdmAction action = null;
-
- final FullQualifiedName actionFqn = resolvePossibleAlias(actionName);
- if (bindingParameterTypeName == null) {
- action = unboundActions.get(actionName);
- if (action == null) {
- action = createUnboundAction(actionFqn);
- if (action != null) {
- unboundActions.put(actionName, action);
- }
- }
- } else {
- final FullQualifiedName bindingParameterTypeFqn = resolvePossibleAlias(bindingParameterTypeName);
- final ActionMapKey key = new ActionMapKey(actionFqn, bindingParameterTypeFqn, isBindingParameterCollection);
- action = boundActions.get(key);
- if (action == null) {
- action = createBoundAction(actionFqn, bindingParameterTypeFqn, isBindingParameterCollection);
- if (action != null) {
- boundActions.put(key, action);
- }
- }
- }
-
- return action;
- }
-
- @Override
- public EdmFunction getFunction(final FullQualifiedName functionName,
- final FullQualifiedName bindingParameterTypeName,
- final Boolean isBindingParameterCollection, final List<String> parameterNames) {
-
- EdmFunction function = null;
-
- final FullQualifiedName functionFqn = resolvePossibleAlias(functionName);
- if (bindingParameterTypeName == null) {
- final FunctionMapKey key = new FunctionMapKey(
- functionFqn, bindingParameterTypeName, isBindingParameterCollection, parameterNames);
- function = unboundFunctions.get(key);
- if (function == null) {
- function = createUnboundFunction(functionFqn, parameterNames);
- if (function != null) {
- unboundFunctions.put(key, function);
- }
- }
- } else {
- final FullQualifiedName bindingParameterTypeFqn = resolvePossibleAlias(bindingParameterTypeName);
- final FunctionMapKey key
- = new FunctionMapKey(functionFqn, bindingParameterTypeFqn, isBindingParameterCollection, parameterNames);
- function = boundFunctions.get(key);
- if (function == null) {
- function = createBoundFunction(functionFqn, bindingParameterTypeFqn, isBindingParameterCollection,
- parameterNames);
- if (function != null) {
- boundFunctions.put(key, function);
- }
- }
- }
-
- return function;
- }
-
- @Override
- public EdmServiceMetadata getServiceMetadata() {
- if (serviceMetadata == null) {
- serviceMetadata = createServiceMetadata();
- }
- return serviceMetadata;
- }
-
- private FullQualifiedName resolvePossibleAlias(final FullQualifiedName namespaceOrAliasFQN) {
- if (aliasToNamespaceInfo == null) {
- aliasToNamespaceInfo = createAliasToNamespaceInfo();
- }
- FullQualifiedName finalFQN = null;
- if (namespaceOrAliasFQN != null) {
- final String namespace = aliasToNamespaceInfo.get(namespaceOrAliasFQN.getNamespace());
- // If not contained in info it must be a namespace
- if (namespace == null) {
- finalFQN = namespaceOrAliasFQN;
- } else {
- finalFQN = new FullQualifiedName(namespace, namespaceOrAliasFQN.getName());
- }
- }
- return finalFQN;
- }
-
- protected abstract Map<String, String> createAliasToNamespaceInfo();
-
- protected abstract EdmEntityContainer createEntityContainer(FullQualifiedName containerName);
-
- protected abstract EdmEnumType createEnumType(FullQualifiedName enumName);
-
- protected abstract EdmTypeDefinition createTypeDefinition(FullQualifiedName typeDefinitionName);
-
- protected abstract EdmEntityType createEntityType(FullQualifiedName entityTypeName);
-
- protected abstract EdmComplexType createComplexType(FullQualifiedName complexTypeName);
-
- protected abstract EdmAction createUnboundAction(FullQualifiedName actionName);
-
- protected abstract EdmFunction createUnboundFunction(FullQualifiedName functionName, List<String> parameterNames);
-
- protected abstract EdmAction createBoundAction(FullQualifiedName actionName,
- FullQualifiedName bindingParameterTypeName,
- Boolean isBindingParameterCollection);
-
- protected abstract EdmFunction createBoundFunction(FullQualifiedName functionName,
- FullQualifiedName bindingParameterTypeName, Boolean isBindingParameterCollection,
- List<String> parameterNames);
-
- protected abstract EdmServiceMetadata createServiceMetadata();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmKeyPropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmKeyPropertyRef.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmKeyPropertyRef.java
deleted file mode 100644
index 157dd73..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmKeyPropertyRef.java
+++ /dev/null
@@ -1,80 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmKeyPropertyRef;
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmStructuredType;
-
-public abstract class AbstractEdmKeyPropertyRef implements EdmKeyPropertyRef {
-
- private final EdmEntityType edmEntityType;
-
- private EdmProperty property;
-
- public AbstractEdmKeyPropertyRef(final EdmEntityType edmEntityType) {
- this.edmEntityType = edmEntityType;
- }
-
- @Override
- public abstract String getKeyPropertyName();
-
- @Override
- public abstract String getAlias();
-
- @Override
- public abstract String getPath();
-
- @Override
- public EdmProperty getProperty() {
- if (property == null) {
- if (getAlias() == null) {
- property = edmEntityType.getStructuralProperty(getKeyPropertyName());
- if (property == null) {
- throw new EdmException("Invalid key property ref specified. Can´t find property with name: "
- + getKeyPropertyName());
- }
- } else {
- if (getPath() == null || getPath().isEmpty()) {
- throw new EdmException("Alias but no path specified for propertyRef");
- }
- final String[] splitPath = getPath().split("/");
- EdmStructuredType structType = edmEntityType;
- for (int i = 0; i < splitPath.length - 1; i++) {
- final EdmProperty _property = structType.getStructuralProperty(splitPath[i]);
- if (_property == null) {
- throw new EdmException("Invalid property ref specified. Can´t find property with name: " + splitPath[i]
- + " at type: " + structType.getNamespace() + "." + structType.getName());
- }
- structType = (EdmStructuredType) _property.getType();
- }
- property = structType.getStructuralProperty(splitPath[splitPath.length - 1]);
- if (property == null) {
- throw new EdmException("Invalid property ref specified. Can´t find property with name: "
- + splitPath[splitPath.length - 1] + " at type: " + structType.getNamespace() + "."
- + structType.getName());
- }
- }
- }
-
- return property;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmNavigationProperty.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmNavigationProperty.java
deleted file mode 100644
index 3140ef7..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmNavigationProperty.java
+++ /dev/null
@@ -1,76 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmStructuredType;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public abstract class AbstractEdmNavigationProperty extends EdmElementImpl implements EdmNavigationProperty {
-
- private EdmEntityType typeImpl;
-
- private EdmNavigationProperty partnerNavigationProperty;
-
- public AbstractEdmNavigationProperty(final Edm edm, final String name) {
- super(edm, name);
- }
-
- protected abstract FullQualifiedName getTypeFQN();
-
- @Override
- public EdmType getType() {
- if (typeImpl == null) {
- typeImpl = edm.getEntityType(getTypeFQN());
- if (typeImpl == null) {
- throw new EdmException("Cannot find type with name: " + getTypeFQN());
- }
- }
- return typeImpl;
- }
-
- protected abstract String internatGetPartner();
-
- @Override
- public EdmNavigationProperty getPartner() {
- if (partnerNavigationProperty == null) {
- String partner = internatGetPartner();
- if (partner != null) {
- EdmStructuredType type = (EdmStructuredType) getType();
- EdmNavigationProperty property = null;
- final String[] split = partner.split("/");
- for (String element : split) {
- property = type.getNavigationProperty(element);
- if (property == null) {
- throw new EdmException("Cannot find property with name: " + element + " at type " + type.getName());
- }
- type = (EdmStructuredType) property.getType();
- }
- partnerNavigationProperty = property;
- }
- }
- return partnerNavigationProperty;
- }
-
- public abstract String getReferencingPropertyName(String referencedPropertyName);
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmOperation.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmOperation.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmOperation.java
deleted file mode 100644
index 933714f..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmOperation.java
+++ /dev/null
@@ -1,113 +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.commons.core.edm;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmBindingTarget;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmOperation;
-import org.apache.olingo.odata4.commons.api.edm.EdmParameter;
-import org.apache.olingo.odata4.commons.api.edm.EdmReturnType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public abstract class AbstractEdmOperation extends EdmTypeImpl implements EdmOperation {
-
- private final Map<String, EdmParameter> parameters = new LinkedHashMap<String, EdmParameter>();
-
- private String entitySetPath;
-
- private boolean isBound;
-
- private EdmReturnType returnType;
-
- private List<String> parameterNames;
-
- protected AbstractEdmOperation(final Edm edm, final FullQualifiedName fqn, final EdmTypeKind kind) {
- super(edm, fqn, kind);
- }
-
- protected void setParameters(final List<EdmParameter> _parameters) {
- for (EdmParameter parameter : _parameters) {
- parameters.put(parameter.getName(), parameter);
- }
- }
-
- protected void setEntitySetPath(final String entitySetPath) {
- this.entitySetPath = entitySetPath;
- }
-
- protected void setIsBound(final boolean isBound) {
- this.isBound = isBound;
- }
-
- protected void setReturnType(final EdmReturnType returnType) {
- this.returnType = returnType;
- }
-
- @Override
- public EdmParameter getParameter(final String name) {
- return parameters.get(name);
- }
-
- @Override
- public List<String> getParameterNames() {
- if (parameterNames == null) {
- parameterNames = new ArrayList<String>(parameters.size());
- for (String parameterName : parameters.keySet()) {
- parameterNames.add(parameterName);
- }
- }
- return parameterNames;
- }
-
- @Override
- public EdmEntitySet getReturnedEntitySet(final EdmEntitySet bindingParameterEntitySet) {
- EdmEntitySet returnedEntitySet = null;
- if (bindingParameterEntitySet != null && entitySetPath != null) {
- final EdmBindingTarget relatedBindingTarget = bindingParameterEntitySet.
- getRelatedBindingTarget(entitySetPath);
- if (relatedBindingTarget == null) {
- throw new EdmException("Cannot find entity set with path: " + entitySetPath);
- }
- if (relatedBindingTarget instanceof EdmEntitySet) {
- returnedEntitySet = (EdmEntitySet) relatedBindingTarget;
- } else {
- throw new EdmException("BindingTarget with name: " + relatedBindingTarget.getName() + " must be an entity set");
- }
- }
- return returnedEntitySet;
- }
-
- @Override
- public EdmReturnType getReturnType() {
- return returnType;
- }
-
- @Override
- public boolean isBound() {
- return isBound;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmOperationImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmOperationImport.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmOperationImport.java
deleted file mode 100644
index 07bfb7c..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmOperationImport.java
+++ /dev/null
@@ -1,63 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmOperationImport;
-import org.apache.olingo.odata4.commons.api.edm.Target;
-
-public abstract class AbstractEdmOperationImport extends EdmNamedImpl implements EdmOperationImport {
-
- protected final EdmEntityContainer container;
-
- private final Target entitySet;
-
- private EdmEntitySet returnedEntitySet;
-
- public AbstractEdmOperationImport(final Edm edm, final EdmEntityContainer container, final String name,
- final Target entitySet) {
-
- super(edm, name);
- this.container = container;
- this.entitySet = entitySet;
- }
-
- @Override
- public EdmEntitySet getReturnedEntitySet() {
- if (entitySet != null && returnedEntitySet == null) {
- EdmEntityContainer entityContainer = edm.getEntityContainer(entitySet.getEntityContainer());
- if (entityContainer == null) {
- throw new EdmException("Can´t find entity container with name: " + entitySet.getEntityContainer());
- }
- returnedEntitySet = entityContainer.getEntitySet(entitySet.getTargetName());
- if (returnedEntitySet == null) {
- throw new EdmException("Can´t find entity set with name: " + entitySet.getTargetName());
- }
- }
- return returnedEntitySet;
- }
-
- @Override
- public EdmEntityContainer getEntityContainer() {
- return container;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmParameter.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmParameter.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmParameter.java
deleted file mode 100644
index e4adb41..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmParameter.java
+++ /dev/null
@@ -1,87 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmMapping;
-import org.apache.olingo.odata4.commons.api.edm.EdmParameter;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
-
-public abstract class AbstractEdmParameter extends EdmElementImpl implements EdmParameter {
-
- private final FullQualifiedName paramType;
-
- private EdmType typeImpl;
-
- public AbstractEdmParameter(final Edm edm, final String name, final FullQualifiedName paramType) {
- super(edm, name);
- this.paramType = paramType;
- }
-
- @Override
- public EdmType getType() {
- if (typeImpl == null) {
- if (EdmPrimitiveType.EDM_NAMESPACE.equals(paramType.getNamespace())) {
- try {
- typeImpl = EdmPrimitiveTypeKind.valueOf(paramType.getName()).getEdmPrimitiveTypeInstance();
- } catch (IllegalArgumentException e) {
- throw new EdmException("Cannot find type with name: " + paramType, e);
- }
- } else {
- typeImpl = edm.getComplexType(paramType);
- if (typeImpl == null) {
- typeImpl = edm.getEntityType(paramType);
- if (typeImpl == null) {
- typeImpl = edm.getEnumType(paramType);
- if (typeImpl == null) {
- typeImpl = edm.getTypeDefinition(paramType);
- if (typeImpl == null) {
- throw new EdmException("Cannot find type with name: " + paramType);
- }
- }
- }
- }
- }
- }
- return typeImpl;
- }
-
- @Override
- public abstract boolean isCollection();
-
- @Override
- public abstract EdmMapping getMapping();
-
- @Override
- public abstract Boolean isNullable();
-
- @Override
- public abstract Integer getMaxLength();
-
- @Override
- public abstract Integer getPrecision();
-
- @Override
- public abstract Integer getScale();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmProperty.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmProperty.java
deleted file mode 100644
index ba28f6c..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmProperty.java
+++ /dev/null
@@ -1,70 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
-
-public abstract class AbstractEdmProperty extends EdmElementImpl implements EdmProperty {
-
- private EdmType propertyType;
-
- public AbstractEdmProperty(final Edm edm, final String name) {
- super(edm, name);
- }
-
- protected abstract FullQualifiedName getTypeFQN();
-
- @Override
- public boolean isPrimitive() {
- return EdmPrimitiveType.EDM_NAMESPACE.equals(getTypeFQN().getNamespace());
- }
-
- @Override
- public EdmType getType() {
- if (propertyType == null) {
- final FullQualifiedName typeName = getTypeFQN();
- if (isPrimitive()) {
- try {
- propertyType = EdmPrimitiveTypeKind.valueOf(typeName.getName()).getEdmPrimitiveTypeInstance();
- } catch (IllegalArgumentException e) {
- throw new EdmException("Cannot find type with name: " + typeName, e);
- }
- } else {
- propertyType = edm.getComplexType(typeName);
- if (propertyType == null) {
- propertyType = edm.getEnumType(typeName);
- if (propertyType == null) {
- propertyType = edm.getTypeDefinition(typeName);
- if (propertyType == null) {
- throw new EdmException("Cannot find type with name: " + typeName);
- }
- }
- }
- }
- }
-
- return propertyType;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmReturnType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmReturnType.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmReturnType.java
deleted file mode 100644
index 7f2fb39..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmReturnType.java
+++ /dev/null
@@ -1,85 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmReturnType;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
-
-public abstract class AbstractEdmReturnType implements EdmReturnType {
-
- private final Edm edm;
-
- private final FullQualifiedName typeName;
-
- private EdmType typeImpl;
-
- public AbstractEdmReturnType(final Edm edm, final FullQualifiedName typeName) {
- this.edm = edm;
- this.typeName = typeName;
- }
-
- @Override
- public EdmType getType() {
- if (typeImpl == null) {
- if (EdmPrimitiveType.EDM_NAMESPACE.equals(typeName.getNamespace())) {
- try {
- typeImpl = EdmPrimitiveTypeKind.valueOf(typeName.getName()).getEdmPrimitiveTypeInstance();
- } catch (IllegalArgumentException e) {
- throw new EdmException("Cannot find type with name: " + typeName, e);
- }
- } else {
- typeImpl = edm.getComplexType(typeName);
- if (typeImpl == null) {
- typeImpl = edm.getEntityType(typeName);
- if (typeImpl == null) {
- typeImpl = edm.getEnumType(typeName);
- if (typeImpl == null) {
- typeImpl = edm.getTypeDefinition(typeName);
- if (typeImpl == null) {
- throw new EdmException("Cant find type with name: " + typeName);
- }
- }
- }
- }
- }
- }
- return typeImpl;
- }
-
- @Override
- public abstract Boolean isNullable();
-
- @Override
- public abstract Integer getMaxLength();
-
- @Override
- public abstract Integer getPrecision();
-
- @Override
- public abstract Integer getScale();
-
- @Override
- public abstract boolean isCollection();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmStructuredType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmStructuredType.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmStructuredType.java
deleted file mode 100644
index 2a3df7c..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmStructuredType.java
+++ /dev/null
@@ -1,128 +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.commons.core.edm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmElement;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmStructuredType;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public abstract class AbstractEdmStructuredType extends EdmTypeImpl implements EdmStructuredType {
-
- protected EdmStructuredType baseType;
-
- private List<String> propertyNames;
-
- private List<String> navigationPropertyNames;
-
- public AbstractEdmStructuredType(final Edm edm, final FullQualifiedName fqn, final EdmTypeKind kind,
- final FullQualifiedName baseTypeName) {
-
- super(edm, fqn, kind);
- }
-
- protected abstract EdmStructuredType buildBaseType(FullQualifiedName baseTypeName);
-
- protected abstract Map<String, EdmProperty> getProperties();
-
- protected abstract Map<String, EdmNavigationProperty> getNavigationProperties();
-
- @Override
- public List<String> getPropertyNames() {
- if (propertyNames == null) {
- propertyNames = new ArrayList<String>();
- if (baseType != null) {
- propertyNames.addAll(baseType.getPropertyNames());
- }
- propertyNames.addAll(getProperties().keySet());
- }
- return propertyNames;
- }
-
- @Override
- public List<String> getNavigationPropertyNames() {
- if (navigationPropertyNames == null) {
- navigationPropertyNames = new ArrayList<String>();
- if (baseType != null) {
- navigationPropertyNames.addAll(baseType.getNavigationPropertyNames());
- }
- navigationPropertyNames.addAll(getNavigationProperties().keySet());
- }
- return navigationPropertyNames;
- }
-
- @Override
- public EdmElement getProperty(final String name) {
- EdmElement property = getStructuralProperty(name);
- if (property == null) {
- property = getNavigationProperty(name);
- }
- return property;
- }
-
- @Override
- public EdmProperty getStructuralProperty(final String name) {
- EdmProperty property = null;
- if (baseType != null) {
- property = baseType.getStructuralProperty(name);
- }
- if (property == null) {
- property = getProperties().get(name);
- }
- return property;
- }
-
- @Override
- public EdmNavigationProperty getNavigationProperty(final String name) {
- EdmNavigationProperty property = null;
- if (baseType != null) {
- property = baseType.getNavigationProperty(name);
- }
- if (property == null) {
- property = getNavigationProperties().get(name);
- }
- return property;
- }
-
- @Override
- public boolean compatibleTo(final EdmType targetType) {
- EdmStructuredType sourceType = this;
- if (targetType == null) {
- throw new EdmException("Target type must not be null");
- }
- while (!sourceType.getName().equals(targetType.getName())
- || !sourceType.getNamespace().equals(targetType.getNamespace())) {
-
- sourceType = sourceType.getBaseType();
- if (sourceType == null) {
- return false;
- }
- }
-
- return true;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmTypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmTypeDefinition.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmTypeDefinition.java
deleted file mode 100644
index 6a4c03a..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/AbstractEdmTypeDefinition.java
+++ /dev/null
@@ -1,107 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.odata4.commons.api.edm.EdmTypeDefinition;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public abstract class AbstractEdmTypeDefinition extends EdmNamedImpl implements EdmTypeDefinition {
-
- private final String namespace;
-
- public AbstractEdmTypeDefinition(final Edm edm, final FullQualifiedName typeDefinitionName) {
- super(edm, typeDefinitionName.getName());
- this.namespace = typeDefinitionName.getNamespace();
- }
-
- @Override
- public abstract EdmPrimitiveType getUnderlyingType();
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return getUnderlyingType().isCompatible(primitiveType);
- }
-
- @Override
- public Class<?> getDefaultType() {
- return getUnderlyingType().getDefaultType();
- }
-
- @Override
- public boolean validate(final String value, final Boolean isNullable, final Integer maxLength,
- final Integer precision, final Integer scale,
- final Boolean isUnicode) {
-
- return getUnderlyingType().validate(value, isNullable, maxLength, precision, scale, isUnicode);
- }
-
- @Override
- public <T> T valueOfString(final String value, final Boolean isNullable, final Integer maxLength,
- final Integer precision, final Integer scale,
- final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- return getUnderlyingType().
- valueOfString(value, isNullable, maxLength, precision, scale, isUnicode, returnType);
- }
-
- @Override
- public String valueToString(final Object value, final Boolean isNullable, final Integer maxLength,
- final Integer precision, final Integer scale,
- final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- return getUnderlyingType().valueToString(value, isNullable, maxLength, precision, scale, isUnicode);
- }
-
- @Override
- public String toUriLiteral(final String literal) {
- return getUnderlyingType().toUriLiteral(literal);
- }
-
- @Override
- public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
- return getUnderlyingType().fromUriLiteral(literal);
- }
-
- @Override
- public String getNamespace() {
- return namespace;
- }
-
- @Override
- public EdmTypeKind getKind() {
- return EdmTypeKind.DEFINITION;
- }
-
- @Override
- public abstract Integer getMaxLength();
-
- @Override
- public abstract Integer getPrecision();
-
- @Override
- public abstract Integer getScale();
-
- @Override
- public abstract Boolean isUnicode();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/ActionMapKey.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/ActionMapKey.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/ActionMapKey.java
deleted file mode 100644
index cbecb09..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/ActionMapKey.java
+++ /dev/null
@@ -1,67 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class ActionMapKey {
-
- private final FullQualifiedName actionName;
-
- private final FullQualifiedName bindingParameterTypeName;
-
- private final Boolean isBindingParameterCollection;
-
- public ActionMapKey(final FullQualifiedName actionName, final FullQualifiedName bindingParameterTypeName,
- final Boolean isBindingParameterCollection) {
-
- if (actionName == null || bindingParameterTypeName == null || isBindingParameterCollection == null) {
- throw new EdmException("Action name, binding parameter type and binding parameter collection "
- + "must not be null for bound actions");
- }
- this.actionName = actionName;
- this.bindingParameterTypeName = bindingParameterTypeName;
- this.isBindingParameterCollection = isBindingParameterCollection;
- }
-
- @Override
- public int hashCode() {
- final String forHash = actionName.toString()
- + bindingParameterTypeName.toString()
- + isBindingParameterCollection.toString();
- return forHash.hashCode();
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if ((obj == null) || !(obj instanceof ActionMapKey)) {
- return false;
- }
- final ActionMapKey other = (ActionMapKey) obj;
- if (actionName.equals(other.actionName) && bindingParameterTypeName.equals(other.bindingParameterTypeName)
- && isBindingParameterCollection.equals(other.isBindingParameterCollection)) {
- return true;
- }
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmActionImportInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmActionImportInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmActionImportInfoImpl.java
deleted file mode 100644
index 4e60a7f..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmActionImportInfoImpl.java
+++ /dev/null
@@ -1,45 +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.commons.core.edm;
-
-import java.net.URI;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImportInfo;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-
-public class EdmActionImportInfoImpl extends EdmOperationImportInfoImpl implements EdmActionImportInfo {
-
- private String actionImportName;
-
- public EdmActionImportInfoImpl(final String entityContainerName, final String actionImportName) {
- super(entityContainerName);
- this.actionImportName = actionImportName;
- }
-
- @Override
- public String getActionImportName() {
- return actionImportName;
- }
-
- @Override
- public URI getActionImportUri() {
- throw new EdmException("Not yet implemented");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmElementImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmElementImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmElementImpl.java
deleted file mode 100644
index d931853..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmElementImpl.java
+++ /dev/null
@@ -1,29 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmElement;
-
-public abstract class EdmElementImpl extends EdmNamedImpl implements EdmElement {
-
- public EdmElementImpl(final Edm edm, final String name) {
- super(edm, name);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmEntitySetInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmEntitySetInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmEntitySetInfoImpl.java
deleted file mode 100644
index 768960a..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmEntitySetInfoImpl.java
+++ /dev/null
@@ -1,52 +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.commons.core.edm;
-
-import java.net.URI;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySetInfo;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-
-public class EdmEntitySetInfoImpl implements EdmEntitySetInfo {
-
- private final String entityContainerName;
-
- private final String entitySetName;
-
- public EdmEntitySetInfoImpl(final String entityContainerName, final String entitySetName) {
- this.entityContainerName = entityContainerName;
- this.entitySetName = entitySetName;
- }
-
- @Override
- public String getEntityContainerName() {
- return entityContainerName;
- }
-
- @Override
- public String getEntitySetName() {
- return entitySetName;
- }
-
- @Override
- public URI getEntitySetUri() {
- throw new EdmException("Not yet implemented");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmFunctionImportInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmFunctionImportInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmFunctionImportInfoImpl.java
deleted file mode 100644
index 7facfe1..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmFunctionImportInfoImpl.java
+++ /dev/null
@@ -1,45 +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.commons.core.edm;
-
-import java.net.URI;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImportInfo;
-
-public class EdmFunctionImportInfoImpl extends EdmOperationImportInfoImpl implements EdmFunctionImportInfo {
-
- private String functionImportName;
-
- public EdmFunctionImportInfoImpl(final String entityContainerName, final String functionImportName) {
- super(entityContainerName);
- this.functionImportName = functionImportName;
- }
-
- @Override
- public String getFunctionImportName() {
- return functionImportName;
- }
-
- @Override
- public URI getFunctionImportUri() {
- throw new EdmException("Not yet implemented");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmMemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmMemberImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmMemberImpl.java
deleted file mode 100644
index 7e6c998..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmMemberImpl.java
+++ /dev/null
@@ -1,38 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmMember;
-
-public class EdmMemberImpl extends EdmNamedImpl implements EdmMember {
-
- private final String value;
-
- public EdmMemberImpl(final Edm edm, final String name, final String value) {
- super(edm, name);
- this.value = value;
- }
-
- @Override
- public String getValue() {
- return value;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmNamedImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmNamedImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmNamedImpl.java
deleted file mode 100644
index 5f0ac2c..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmNamedImpl.java
+++ /dev/null
@@ -1,40 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmNamed;
-
-public abstract class EdmNamedImpl implements EdmNamed {
-
- protected final Edm edm;
-
- private final String name;
-
- public EdmNamedImpl(final Edm edm, final String name) {
- this.edm = edm;
- this.name = name;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmOperationImportInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmOperationImportInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmOperationImportInfoImpl.java
deleted file mode 100644
index 334669b..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmOperationImportInfoImpl.java
+++ /dev/null
@@ -1,36 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmOperationImportInfo;
-
-public abstract class EdmOperationImportInfoImpl implements EdmOperationImportInfo {
-
- protected String entityContainerName;
-
- public EdmOperationImportInfoImpl(final String entityContainerName) {
- this.entityContainerName = entityContainerName;
- }
-
- @Override
- public String getEntityContainerName() {
- return this.entityContainerName;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmSingletonInfoImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmSingletonInfoImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmSingletonInfoImpl.java
deleted file mode 100644
index 6cb8a26..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmSingletonInfoImpl.java
+++ /dev/null
@@ -1,52 +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.commons.core.edm;
-
-import java.net.URI;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmSingletonInfo;
-
-public class EdmSingletonInfoImpl implements EdmSingletonInfo {
-
- private final String entityContainerName;
-
- private final String singletonName;
-
- public EdmSingletonInfoImpl(final String entityContainerName, final String singletonName) {
- this.entityContainerName = entityContainerName;
- this.singletonName = singletonName;
- }
-
- @Override
- public String getEntityContainerName() {
- return entityContainerName;
- }
-
- @Override
- public String getSingletonName() {
- return singletonName;
- }
-
- @Override
- public URI getEntitySetUri() {
- throw new EdmException("Not yet implemented");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmStructuredTypeHelper.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmStructuredTypeHelper.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmStructuredTypeHelper.java
deleted file mode 100644
index 8b732aa..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmStructuredTypeHelper.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 org.apache.olingo.odata4.commons.core.edm;
-
-import java.util.Map;
-import org.apache.olingo.odata4.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-
-public interface EdmStructuredTypeHelper {
-
- Map<String, EdmProperty> getProperties();
-
- Map<String, EdmNavigationProperty> getNavigationProperties();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmTypeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmTypeImpl.java
deleted file mode 100644
index c2f635a..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/EdmTypeImpl.java
+++ /dev/null
@@ -1,48 +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.commons.core.edm;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public class EdmTypeImpl extends EdmNamedImpl implements EdmType {
-
- protected final FullQualifiedName fqn;
-
- protected final EdmTypeKind kind;
-
- public EdmTypeImpl(final Edm edm, final FullQualifiedName fqn, final EdmTypeKind kind) {
- super(edm, fqn.getName());
- this.fqn = fqn;
- this.kind = kind;
- }
-
- @Override
- public String getNamespace() {
- return fqn.getNamespace();
- }
-
- @Override
- public EdmTypeKind getKind() {
- return kind;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/FunctionMapKey.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/FunctionMapKey.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/FunctionMapKey.java
deleted file mode 100644
index 3cb96a2..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/FunctionMapKey.java
+++ /dev/null
@@ -1,113 +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.commons.core.edm;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class FunctionMapKey {
-
- private final FullQualifiedName functionName;
-
- private final FullQualifiedName bindingParameterTypeName;
-
- private final Boolean isBindingParameterCollection;
-
- private final List<String> parameterNames;
-
- public FunctionMapKey(final FullQualifiedName functionName, final FullQualifiedName bindingParameterTypeName,
- final Boolean isBindingParameterCollection, final List<String> parameterNames) {
-
- this.functionName = functionName;
- if (bindingParameterTypeName != null && isBindingParameterCollection == null) {
- throw new EdmException(
- "Indicator that the bindingparameter is a collection must not be null if its an bound function.");
- }
- this.bindingParameterTypeName = bindingParameterTypeName;
- this.isBindingParameterCollection = isBindingParameterCollection;
- this.parameterNames = new ArrayList<String>();
- if (parameterNames != null) {
- this.parameterNames.addAll(parameterNames);
- Collections.sort(this.parameterNames);
- }
- }
-
- @Override
- public int hashCode() {
- String hash = functionName.toString();
-
- if (bindingParameterTypeName != null) {
- hash = hash + bindingParameterTypeName.toString();
- } else {
- hash = hash + "typeNull";
- }
-
- if (isBindingParameterCollection != null) {
- hash = hash + isBindingParameterCollection.toString();
- } else {
- hash = hash + "collectionNull";
- }
-
- if (!parameterNames.isEmpty()) {
- for (String name : parameterNames) {
- hash = hash + name;
- }
- } else {
- hash = hash + "parameterNamesEmpty";
- }
-
- return hash.hashCode();
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if ((obj == null) || !(obj instanceof FunctionMapKey)) {
- return false;
- }
- final FunctionMapKey other = (FunctionMapKey) obj;
-
- if (functionName.equals(other.functionName)
- && (bindingParameterTypeName == null && other.bindingParameterTypeName == null)
- || (bindingParameterTypeName != null && bindingParameterTypeName.equals(other.bindingParameterTypeName))
- && (isBindingParameterCollection == null
- && other.isBindingParameterCollection == null)
- || (isBindingParameterCollection != null
- && isBindingParameterCollection.equals(other.isBindingParameterCollection))) {
-
- if (parameterNames == null && other.parameterNames == null) {
- return true;
- } else if (parameterNames.size() == other.parameterNames.size()) {
- for (String name : parameterNames) {
- if (!other.parameterNames.contains(name)) {
- return false;
- }
- }
- return true;
- }
- }
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/AbstractPrimitiveType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/AbstractPrimitiveType.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/AbstractPrimitiveType.java
deleted file mode 100644
index bb4c5c9..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/AbstractPrimitiveType.java
+++ /dev/null
@@ -1,116 +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.commons.core.edm.primitivetype;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-/**
- * Abstract implementation of the EDM primitive-type interface.
- */
-abstract class AbstractPrimitiveType implements EdmPrimitiveType {
-
- protected String uriPrefix = "";
-
- protected String uriSuffix = "";
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return equals(primitiveType);
- }
-
- @Override
- public boolean validate(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
- final Boolean isUnicode) {
-
- try {
- valueOfString(value, isNullable, maxLength, precision, scale, isUnicode, getDefaultType());
- return true;
- } catch (final EdmPrimitiveTypeException e) {
- return false;
- }
- }
-
- @Override
- public final <T> T valueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType)
- throws EdmPrimitiveTypeException {
-
- if (value == null) {
- if (isNullable != null && !isNullable) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_NULL_NOT_ALLOWED");
- }
- return null;
- }
- return internalValueOfString(value, isNullable, maxLength, precision, scale, isUnicode, returnType);
- }
-
- protected abstract <T> T internalValueOfString(String value,
- Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode,
- Class<T> returnType) throws EdmPrimitiveTypeException;
-
- @Override
- public final String valueToString(final Object value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
- if (value == null) {
- if (isNullable != null && !isNullable) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_NULL_NOT_ALLOWED");
- }
- return null;
- }
- return internalValueToString(value, isNullable, maxLength, precision, scale, isUnicode);
- }
-
- protected abstract <T> String internalValueToString(T value,
- Boolean isNullable, Integer maxLength, Integer precision, Integer scale,
- Boolean isUnicode) throws EdmPrimitiveTypeException;
-
- @Override
- public String toUriLiteral(final String literal) {
- return literal == null
- ? null
- : uriPrefix.isEmpty() && uriSuffix.isEmpty()
- ? literal
- : uriPrefix + literal + uriSuffix;
- }
-
- @Override
- public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
- if (literal == null) {
- return null;
- } else if (uriPrefix.isEmpty() && uriSuffix.isEmpty()) {
- return literal;
- } else if (literal.length() >= uriPrefix.length() + uriSuffix.length()
- && literal.startsWith(uriPrefix) && literal.endsWith(uriSuffix)) {
-
- return literal.substring(uriPrefix.length(), literal.length() - uriSuffix.length());
- } else {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(literal)");
- }
- }
-
- @Override
- public String toString() {
- return new FullQualifiedName(getNamespace(), getName()).getFullQualifiedNameAsString();
- }
-}
[21/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/demo-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/demo-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/demo-metadata.xml
new file mode 100644
index 0000000..9b21e2f
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/demo-metadata.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
+ <edmx:DataServices>
+ <Schema Namespace="ODataDemo" xmlns="http://docs.oasis-open.org/odata/ns/edm">
+ <EntityType Name="Product">
+ <Key>
+ <PropertyRef Name="ID" />
+ </Key>
+ <Property Name="ID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" />
+ <Property Name="Description" Type="Edm.String" />
+ <Property Name="ReleaseDate" Type="Edm.DateTimeOffset" Nullable="false" />
+ <Property Name="DiscontinuedDate" Type="Edm.DateTimeOffset" />
+ <Property Name="Rating" Type="Edm.Int16" Nullable="false" />
+ <Property Name="Price" Type="Edm.Double" Nullable="false" />
+ <NavigationProperty Name="Categories" Type="Collection(ODataDemo.Category)" Partner="Products" />
+ <NavigationProperty Name="Supplier" Type="ODataDemo.Supplier" Partner="Products" />
+ <NavigationProperty Name="ProductDetail" Type="ODataDemo.ProductDetail" Partner="Product" />
+ </EntityType>
+ <EntityType Name="FeaturedProduct" BaseType="ODataDemo.Product">
+ <NavigationProperty Name="Advertisement" Type="ODataDemo.Advertisement" Partner="FeaturedProduct" />
+ </EntityType>
+ <EntityType Name="ProductDetail">
+ <Key>
+ <PropertyRef Name="ProductID" />
+ </Key>
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Details" Type="Edm.String" />
+ <NavigationProperty Name="Product" Type="ODataDemo.Product" Partner="ProductDetail" />
+ </EntityType>
+ <EntityType Name="Category" OpenType="true">
+ <Key>
+ <PropertyRef Name="ID" />
+ </Key>
+ <Property Name="ID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" />
+ <NavigationProperty Name="Products" Type="Collection(ODataDemo.Product)" Partner="Categories" />
+ </EntityType>
+ <EntityType Name="Supplier">
+ <Key>
+ <PropertyRef Name="ID" />
+ </Key>
+ <Property Name="ID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" />
+ <Property Name="Address" Type="ODataDemo.Address" />
+ <Property Name="Location" Type="Edm.GeographyPoint" SRID="Variable" />
+ <Property Name="Concurrency" Type="Edm.Int32" ConcurrencyMode="Fixed" Nullable="false" />
+ <NavigationProperty Name="Products" Type="Collection(ODataDemo.Product)" Partner="Supplier" />
+ </EntityType>
+ <ComplexType Name="Address">
+ <Property Name="Street" Type="Edm.String" />
+ <Property Name="City" Type="Edm.String" />
+ <Property Name="State" Type="Edm.String" />
+ <Property Name="ZipCode" Type="Edm.String" />
+ <Property Name="Country" Type="Edm.String" />
+ </ComplexType>
+ <EntityType Name="Person">
+ <Key>
+ <PropertyRef Name="ID" />
+ </Key>
+ <Property Name="ID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" />
+ <NavigationProperty Name="PersonDetail" Type="ODataDemo.PersonDetail" Partner="Person" />
+ </EntityType>
+ <EntityType Name="Customer" BaseType="ODataDemo.Person">
+ <Property Name="TotalExpense" Type="Edm.Decimal" Nullable="false" />
+ </EntityType>
+ <EntityType Name="Employee" BaseType="ODataDemo.Person">
+ <Property Name="EmployeeID" Type="Edm.Int64" Nullable="false" />
+ <Property Name="HireDate" Type="Edm.DateTimeOffset" Nullable="false" />
+ <Property Name="Salary" Type="Edm.Single" Nullable="false" />
+ </EntityType>
+ <EntityType Name="PersonDetail">
+ <Key>
+ <PropertyRef Name="PersonID" />
+ </Key>
+ <Property Name="PersonID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Age" Type="Edm.Byte" Nullable="false" />
+ <Property Name="Gender" Type="Edm.Boolean" Nullable="false" />
+ <Property Name="Phone" Type="Edm.String" />
+ <Property Name="Address" Type="ODataDemo.Address" />
+ <Property Name="Photo" Type="Edm.Stream" Nullable="false" />
+ <NavigationProperty Name="Person" Type="ODataDemo.Person" Partner="PersonDetail" />
+ </EntityType>
+ <EntityType Name="Advertisement" HasStream="true">
+ <Key>
+ <PropertyRef Name="ID" />
+ </Key>
+ <Property Name="ID" Type="Edm.Guid" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" />
+ <Property Name="AirDate" Type="Edm.DateTimeOffset" Nullable="false" />
+ <NavigationProperty Name="FeaturedProduct" Type="ODataDemo.FeaturedProduct" Partner="Advertisement" />
+ </EntityType>
+ <EntityContainer Name="DemoService">
+ <EntitySet Name="Products" EntityType="ODataDemo.Product">
+ <NavigationPropertyBinding Path="ODataDemo.FeaturedProduct/Advertisement" Target="Advertisements" />
+ <NavigationPropertyBinding Path="Categories" Target="Categories" />
+ <NavigationPropertyBinding Path="Supplier" Target="Suppliers" />
+ <NavigationPropertyBinding Path="ProductDetail" Target="ProductDetails" />
+ </EntitySet>
+ <EntitySet Name="ProductDetails" EntityType="ODataDemo.ProductDetail">
+ <NavigationPropertyBinding Path="Product" Target="Products" />
+ </EntitySet>
+ <EntitySet Name="Categories" EntityType="ODataDemo.Category">
+ <NavigationPropertyBinding Path="Products" Target="Products" />
+ </EntitySet>
+ <EntitySet Name="Suppliers" EntityType="ODataDemo.Supplier">
+ <NavigationPropertyBinding Path="Products" Target="Products" />
+ </EntitySet>
+ <EntitySet Name="Persons" EntityType="ODataDemo.Person">
+ <NavigationPropertyBinding Path="PersonDetail" Target="PersonDetails" />
+ </EntitySet>
+ <EntitySet Name="PersonDetails" EntityType="ODataDemo.PersonDetail">
+ <NavigationPropertyBinding Path="Person" Target="Persons" />
+ </EntitySet>
+ <EntitySet Name="Advertisements" EntityType="ODataDemo.Advertisement">
+ <NavigationPropertyBinding Path="FeaturedProduct" Target="Products" />
+ </EntitySet>
+ </EntityContainer>
+ <Annotations Target="ODataDemo.DemoService">
+ <Annotation Term="Org.OData.Display.V1.Description" String="This is a sample OData service with vocabularies" />
+ </Annotations>
+ <Annotations Target="ODataDemo.Product">
+ <Annotation Term="Org.OData.Display.V1.Description" String="All Products available in the online store" />
+ </Annotations>
+ <Annotations Target="ODataDemo.Product/Name">
+ <Annotation Term="Org.OData.Display.V1.DisplayName" String="Product Name" />
+ </Annotations>
+ <Annotations Target="ODataDemo.DemoService/Suppliers">
+ <Annotation Term="Org.OData.Publication.V1.PublisherName" String="Microsoft Corp." />
+ <Annotation Term="Org.OData.Publication.V1.PublisherId" String="MSFT" />
+ <Annotation Term="Org.OData.Publication.V1.Keywords" String="Inventory, Supplier, Advertisers, Sales, Finance" />
+ <Annotation Term="Org.OData.Publication.V1.AttributionUrl" String="http://www.odata.org/" />
+ <Annotation Term="Org.OData.Publication.V1.AttributionDescription" String="All rights reserved" />
+ <Annotation Term="Org.OData.Publication.V1.DocumentationUrl " String="http://www.odata.org/" />
+ <Annotation Term="Org.OData.Publication.V1.TermsOfUseUrl" String="All rights reserved" />
+ <Annotation Term="Org.OData.Publication.V1.PrivacyPolicyUrl" String="http://www.odata.org/" />
+ <Annotation Term="Org.OData.Publication.V1.LastModified" String="4/2/2013" />
+ <Annotation Term="Org.OData.Publication.V1.ImageUrl " String="http://www.odata.org/" />
+ </Annotations>
+ </Schema>
+ </edmx:DataServices>
+</edmx:Edmx>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc1-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc1-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc1-metadata.xml
new file mode 100644
index 0000000..ed46844
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc1-metadata.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
+ <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs01/vocabularies/Org.OData.Core.V1.xml">
+ <edmx:Include Namespace="Org.OData.Core.V1" Alias="Core"/>
+ </edmx:Reference>
+ <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs01/vocabularies/Org.OData.Measures.V1.xml">
+ <edmx:Include Alias="UoM" Namespace="Org.OData.Measures.V1"/>
+ </edmx:Reference>
+ <edmx:DataServices>
+ <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="ODataDemo">
+ <TypeDefinition Name="Length" UnderlyingType="Edm.Int32">
+ <Annotation Term="Org.OData.Measures.V1.Unit" String="Centimeters"/>
+ </TypeDefinition>
+ <TypeDefinition Name="Weight" UnderlyingType="Edm.Int32">
+ <Annotation Term="Org.OData.Measures.V1.Unit" String="Kilograms"/>
+ </TypeDefinition>
+ <ComplexType Name="Size">
+ <Property Name="Height" Type="Self.Length" />
+ <Property Name="Weight" Type="Self.Weight" />
+ </ComplexType>
+ <EntityType Name="Product" HasStream="true">
+ <Key>
+ <PropertyRef Name="ID"/>
+ </Key>
+ <Property Name="ID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Description" Type="Edm.String" >
+ <Annotation Term="Core.IsLanguageDependent"/>
+ </Property>
+ <Property Name="ReleaseDate" Type="Edm.Date"/>
+ <Property Name="DiscontinuedDate" Type="Edm.Date"/>
+ <Property Name="Rating" Type="Edm.Int32"/>
+ <Property Name="Price" Type="Edm.Decimal">
+ <Annotation Term="UoM.ISOCurrency" Path="Currency"/>
+ </Property>
+ <Property Name="Currency" Type="Edm.String" MaxLength="3"/>
+ <NavigationProperty Name="Category" Type="ODataDemo.Category" Nullable="false" Partner="Products"/>
+ <NavigationProperty Name="Supplier" Type="ODataDemo.Supplier" Partner="Products"/>
+ </EntityType>
+ <EntityType Name="Category">
+ <Key>
+ <PropertyRef Name="ID"/>
+ </Key>
+ <Property Name="ID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String">
+ <Annotation Term="Core.IsLanguageDependent"/>
+ </Property>
+ <NavigationProperty Name="Products" Partner="Category" Type="Collection(ODataDemo.Product)">
+ <OnDelete Action="Cascade"/>
+ </NavigationProperty>
+ </EntityType>
+ <EntityType Name="Supplier">
+ <Key>
+ <PropertyRef Name="ID"/>
+ </Key>
+ <Property Name="ID" Type="Edm.String" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
+ <Property Name="Address" Type="ODataDemo.Address" Nullable="false"/>
+ <Property Name="Concurrency" Type="Edm.Int32" Nullable="false"/>
+ <NavigationProperty Name="Products" Partner="Supplier"/> Type="Collection(ODataDemo.Product)"/>
+ </EntityType>
+ <EntityType Name="Country">
+ <Key>
+ <PropertyRef Name="Code"/>
+ </Key>
+ <Property Name="Code" Type="Edm.String" MaxLength="2" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
+ </EntityType>
+ <ComplexType Name="Address">
+ <Property Name="Street" Type="Edm.String"/>
+ <Property Name="City" Type="Edm.String"/>
+ <Property Name="State" Type="Edm.String"/>
+ <Property Name="ZipCode" Type="Edm.String"/>
+ <Property Name="CountryName" Type="Edm.String"/>
+ <NavigationProperty Name="Country" Type="ODataDemo.Country">
+ <ReferentialConstraint Property="CountryName" ReferencedProperty="Name"/>
+ </NavigationProperty>
+ </ComplexType>
+ <Function Name="ProductsByRating">
+ <Parameter Name="Rating" Type="Edm.Int32"/>
+ <ReturnType Type="Collection(ODataDemo.Product)"/>
+ </Function>
+ <EntityContainer Name="DemoService">
+ <EntitySet Name="Products" EntityType="ODataDemo.Product">
+ <NavigationPropertyBinding Path="Category" Target="Categories"/>
+ </EntitySet>
+ <EntitySet Name="Categories" EntityType="ODataDemo.Category">
+ <NavigationPropertyBinding Path="Products" Target="Products"/>
+ </EntitySet>
+ <EntitySet Name="Suppliers" EntityType="ODataDemo.Supplier">
+ <NavigationPropertyBinding Path="Products" Target="Products"/>
+ <NavigationPropertyBinding Path="Address/Country" Target="Countries"/>
+ <Annotation Term="Core.OptimisticConcurrencyControl">
+ <Collection>
+ <PropertyPath>Concurrency</PropertyPath>
+ </Collection>
+ </Annotation>
+ </EntitySet>
+ <Singleton Name="Contoso" Type="Self.Supplier">
+ <NavigationPropertyBinding Path="Products" Target="Products"/>
+ </Singleton>
+ <EntitySet Name="Countries" EntityType="ODataDemo.Country"/>
+ <FunctionImport Name="ProductsByRating" EntitySet="Products" Function="ODataDemo.ProductsByRating"/>
+ </EntityContainer>
+ </Schema>
+ </edmx:DataServices>
+</edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc2-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc2-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc2-metadata.xml
new file mode 100644
index 0000000..60387f2
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc2-metadata.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
+ <edmx:Reference Uri="http://host/service/$metadata">
+ <edmx:Include Namespace="ODataDemo"/>
+ </edmx:Reference>
+ <edmx:Reference Uri="http://somewhere/Vocabulary/V1">
+ <edmx:Include Alias="Vocabulary1" Namespace="Some.Vocabulary.V1"/>
+ </edmx:Reference>
+ <edmx:DataServices>
+ <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Annotations">
+ <Annotations Target="ODataDemo.Supplier">
+ <Annotation Term="Vocabulary1.EMail">
+ <Null/>
+ </Annotation>
+ <Annotation Term="Vocabulary1.AccountID" Path="ID"/>
+ <Annotation Term="Vocabulary1.Title" String="Supplier Info"/>
+ <Annotation Term="Vocabulary1.DisplayName">
+ <Apply Function="odata.concat">
+ <Path>Name</Path>
+ <String> in </String>
+ <Path>Address/CountryName</Path>
+ </Apply>
+ </Annotation>
+ </Annotations>
+ <Annotations Target="ODataDemo.Product">
+ <Annotation Term="Vocabulary1.Tags">
+ <Collection>
+ <String>MasterData</String>
+ </Collection>
+ </Annotation>
+ </Annotations>
+ </Schema>
+ </edmx:DataServices>
+</edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc3-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc3-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc3-metadata.xml
new file mode 100644
index 0000000..2a00bd8
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/fromdoc3-metadata.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
+ <edmx:Reference Uri="http://host/service/$metadata">
+ <edmx:Include Namespace="ODataDemo"/>
+ </edmx:Reference>
+ <edmx:Reference Uri="http://somewhere/Vocabulary/V1">
+ <edmx:Include Alias="Vocabulary1" Namespace="Some.Vocabulary.V1"/>
+ </edmx:Reference>
+ <edmx:DataServices>
+ <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Annotations">
+ <Annotations Target="Test">
+ <Annotation Term="org.example.display.EndTime" TimeOfDay="21:45:00"/>,
+ <Annotation Term="org.example.display.EndTime">
+ <TimeOfDay>21:45:00</TimeOfDay>
+ </Annotation>,
+ <Annotation Term='Test' Path="IsMale"/>,
+ <Annotation Term='Test'>
+ <Not>
+ <Path>IsMale</Path>
+ </Not>
+ </Annotation>,
+ <Annotation Term='Test'>
+ <And>
+ <Path>IsMale</Path>
+ <Path>IsMarried</Path>
+ </And>
+ </Annotation>,
+ <Annotation Term="UI.ReferenceFacet" AnnotationPath="Product/Supplier/@UI.LineItem"/>,
+ <Annotation Term="UI.ReferenceFacet">
+ <AnnotationPath>Product/Supplier/@UI.LineItem</AnnotationPath>
+ </Annotation>,
+ <Annotation Term="Vocabulary1.DisplayName">
+ <Apply Function="odata.concat">
+ <Path>Name</Path>
+ <String> in </String>
+ <Path>Address/CountryName</Path>
+ </Apply>
+ </Annotation>,
+ <Annotation Term="org.example.display.Threshold">
+ <Cast Type="Edm.Decimal">
+ <Path>Average</Path>
+ </Cast>
+ </Annotation>,
+ <Annotation Term="Vocabulary1.Tags">
+ <Collection>
+ <String>MasterData</String>
+ </Collection>
+ </Annotation>,
+ <Annotation Term="org.example.person.Gender">
+ <If>
+ <Bool>true</Bool>
+ <String>Female</String>
+ <String>Male</String>
+ </If>
+ </Annotation>,
+ <Annotation Term="org.example.person.Gender">
+ <If>
+ <Path>IsFemale</Path>
+ <String>Female</String>
+ <String>Male</String>
+ </If>
+ </Annotation>,
+ <Annotation Term="Self.IsPreferredCustomer">
+ <IsOf Type="Self.PreferredCustomer">
+ <Path>Customer</Path>
+ </IsOf>
+ </Annotation>,
+ <Annotation Term="org.example.display.DisplayName">
+ <LabeledElement Name="CustomerFirstName" Path="FirstName" />
+ </Annotation>,
+ <Annotation Term="org.example.display.DisplayName">
+ <LabeledElement Name="CustomerFirstName">
+ <Path>FirstName</Path>
+ </LabeledElement>
+ </Annotation>,
+ <Annotation Term="org.example.person.Employee">
+ <Record>
+ <PropertyValue Property="GivenName" Path="FirstName" />
+ <PropertyValue Property="Surname" Path="LastName" />
+ <PropertyValue Property="Manager" Path="DirectSupervisor" />
+ <PropertyValue Property="CostCenter">
+ <UrlRef>
+ <Apply Function="odata.fillUriTemplate">
+ <String>http://host/anotherservice/CostCenters('{ccid}')</String>
+ <LabeledElement Name="ccid" Path="CostCenterID" />
+ </Apply>
+ </UrlRef>
+ </PropertyValue>
+ </Record>
+ </Annotation>,
+ <Annotation Term="Vocab.Supplier">
+ <UrlRef>
+ <Apply Function="odata.fillUriTemplate">
+ <String>http://host/service/Suppliers({suppID})</String>
+ <LabeledElement Name="suppID">
+ <Apply Function="odata.uriEncode">
+ <Path>SupplierId</Path>
+ </Apply>
+ </LabeledElement>
+ </Apply>
+ </UrlRef>
+ </Annotation>,
+ <Annotation Term="Core.LongDescription">
+ <UrlRef>
+ <String>http://host/wiki/HowToUse</String>
+ </UrlRef>
+ </Annotation>
+ </Annotations>
+ </Schema>
+ </edmx:DataServices>
+</edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/metadata.xml
new file mode 100644
index 0000000..3f992ac
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/metadata.xml
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
+ <edmx:DataServices m:DataServiceVersion="4.0" m:MaxDataServiceVersion="4.0" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata">
+ <Schema Namespace="Microsoft.Exchange.Services.OData.Model" xmlns="http://docs.oasis-open.org/odata/ns/edm">
+ <EnumType Name="BodyType">
+ <Member Name="Text" Value="0" />
+ <Member Name="HTML" Value="1" />
+ </EnumType>
+ <EnumType Name="Importance">
+ <Member Name="Normal" Value="0" />
+ <Member Name="Low" Value="1" />
+ <Member Name="High" Value="2" />
+ </EnumType>
+ <EnumType Name="AttendeeType">
+ <Member Name="Required" Value="1" />
+ <Member Name="Optional" Value="2" />
+ <Member Name="Resource" Value="3" />
+ </EnumType>
+ <EnumType Name="ResponseType">
+ <Member Name="None" Value="0" />
+ <Member Name="Organizer" Value="1" />
+ <Member Name="TentativelyAccepted" Value="2" />
+ <Member Name="Accepted" Value="3" />
+ <Member Name="Declined" Value="4" />
+ <Member Name="NotResponded" Value="5" />
+ </EnumType>
+ <EnumType Name="EventType">
+ <Member Name="SingleInstance" Value="0" />
+ <Member Name="Occurrence" Value="1" />
+ <Member Name="Exception" Value="2" />
+ <Member Name="SeriesMaster" Value="3" />
+ </EnumType>
+ <EnumType Name="FreeBusyStatus">
+ <Member Name="Free" Value="0" />
+ <Member Name="Tentative" Value="1" />
+ <Member Name="Busy" Value="2" />
+ <Member Name="Oof" Value="3" />
+ <Member Name="WorkingElsewhere" Value="4" />
+ <Member Name="Unknown" Value="-1" />
+ </EnumType>
+ <ComplexType Name="Recipient">
+ <Property Name="Name" Type="Edm.String" />
+ <Property Name="Address" Type="Edm.String" />
+ </ComplexType>
+ <ComplexType Name="Attendee" BaseType="Microsoft.Exchange.Services.OData.Model.Recipient">
+ <Property Name="Status" Type="Microsoft.Exchange.Services.OData.Model.ResponseStatus" />
+ <Property Name="Type" Type="Microsoft.Exchange.Services.OData.Model.AttendeeType" />
+ </ComplexType>
+ <ComplexType Name="ItemBody">
+ <Property Name="ContentType" Type="Microsoft.Exchange.Services.OData.Model.BodyType" />
+ <Property Name="Content" Type="Edm.String" />
+ </ComplexType>
+ <ComplexType Name="Location">
+ <Property Name="DisplayName" Type="Edm.String" />
+ </ComplexType>
+ <ComplexType Name="ResponseStatus" BaseType="Microsoft.Exchange.Services.OData.Model.Recipient">
+ <Property Name="Response" Type="Microsoft.Exchange.Services.OData.Model.ResponseType" />
+ <Property Name="Time" Type="Edm.DateTimeOffset" />
+ </ComplexType>
+ <EntityType Name="Entity" Abstract="true">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Id" Type="Edm.String" Nullable="false" />
+ </EntityType>
+ <EntityType Name="User" BaseType="Microsoft.Exchange.Services.OData.Model.Entity">
+ <Property Name="DisplayName" Type="Edm.String" />
+ <Property Name="Alias" Type="Edm.String" />
+ <Property Name="MailboxGuid" Type="Edm.Guid" />
+ <NavigationProperty Name="Folders" Type="Collection(Microsoft.Exchange.Services.OData.Model.Folder)" />
+ <NavigationProperty Name="Messages" Type="Collection(Microsoft.Exchange.Services.OData.Model.EmailMessage)" />
+ <NavigationProperty Name="RootFolder" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
+ <NavigationProperty Name="Inbox" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
+ <NavigationProperty Name="Drafts" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
+ <NavigationProperty Name="SentItems" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
+ <NavigationProperty Name="DeletedItems" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
+ <NavigationProperty Name="Calendars" Type="Collection(Microsoft.Exchange.Services.OData.Model.Calendar)" />
+ <NavigationProperty Name="CalendarGroups" Type="Collection(Microsoft.Exchange.Services.OData.Model.CalendarGroup)" />
+ <NavigationProperty Name="Events" Type="Collection(Microsoft.Exchange.Services.OData.Model.Event)" />
+ </EntityType>
+ <EntityType Name="Folder" BaseType="Microsoft.Exchange.Services.OData.Model.Entity">
+ <Property Name="ParentFolderId" Type="Edm.String" />
+ <Property Name="DisplayName" Type="Edm.String" />
+ <Property Name="ClassName" Type="Edm.String" />
+ <Property Name="TotalCount" Type="Edm.Int32" />
+ <Property Name="ChildFolderCount" Type="Edm.Int32" />
+ <Property Name="UnreadItemCount" Type="Edm.Int32" />
+ <NavigationProperty Name="ChildFolders" Type="Collection(Microsoft.Exchange.Services.OData.Model.Folder)" />
+ <NavigationProperty Name="Messages" Type="Collection(Microsoft.Exchange.Services.OData.Model.EmailMessage)" />
+ </EntityType>
+ <Action Name="Copy" IsBound="true" EntitySetPath="bindingParameter" ReturnType="Microsoft.Exchange.Services.OData.Model.Folder">
+ <Parameter Name="bindingParameter" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
+ <Parameter Name="DestinationId" Type="Edm.String" />
+ </Action>
+ <Action Name="Move" IsBound="true" EntitySetPath="bindingParameter" ReturnType="Microsoft.Exchange.Services.OData.Model.Folder">
+ <Parameter Name="bindingParameter" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
+ <Parameter Name="DestinationId" Type="Edm.String" />
+ </Action>
+ <EntityType Name="Item" BaseType="Microsoft.Exchange.Services.OData.Model.Entity" Abstract="true">
+ <Property Name="ChangeKey" Type="Edm.String" />
+ <Property Name="ClassName" Type="Edm.String" />
+ <Property Name="Subject" Type="Edm.String" />
+ <Property Name="Body" Type="Microsoft.Exchange.Services.OData.Model.ItemBody" />
+ <Property Name="BodyPreview" Type="Edm.String" />
+ <Property Name="Importance" Type="Microsoft.Exchange.Services.OData.Model.Importance" />
+ <Property Name="Categories" Type="Collection(Edm.String)" />
+ <Property Name="HasAttachments" Type="Edm.Boolean" />
+ <Property Name="DateTimeCreated" Type="Edm.DateTimeOffset" />
+ <Property Name="LastModifiedTime" Type="Edm.DateTimeOffset" />
+ <NavigationProperty Name="Attachments" Type="Collection(Microsoft.Exchange.Services.OData.Model.Attachment)" />
+ </EntityType>
+ <EntityType Name="EmailMessage" BaseType="Microsoft.Exchange.Services.OData.Model.Item">
+ <Property Name="ParentFolderId" Type="Edm.String" />
+ <Property Name="From" Type="Microsoft.Exchange.Services.OData.Model.Recipient" />
+ <Property Name="Sender" Type="Microsoft.Exchange.Services.OData.Model.Recipient" />
+ <Property Name="ToRecipients" Type="Collection(Microsoft.Exchange.Services.OData.Model.Recipient)" />
+ <Property Name="CcRecipients" Type="Collection(Microsoft.Exchange.Services.OData.Model.Recipient)" />
+ <Property Name="BccRecipients" Type="Collection(Microsoft.Exchange.Services.OData.Model.Recipient)" />
+ <Property Name="ReplyTo" Type="Collection(Microsoft.Exchange.Services.OData.Model.Recipient)" />
+ <Property Name="ConversationIndex" Type="Edm.String" />
+ <Property Name="UniqueBody" Type="Microsoft.Exchange.Services.OData.Model.ItemBody" />
+ <Property Name="DateTimeReceived" Type="Edm.DateTimeOffset" />
+ <Property Name="DateTimeSent" Type="Edm.DateTimeOffset" />
+ <Property Name="IsDeliveryReceiptRequested" Type="Edm.Boolean" />
+ <Property Name="IsReadReceiptRequested" Type="Edm.Boolean" />
+ <Property Name="IsDraft" Type="Edm.Boolean" />
+ <Property Name="IsRead" Type="Edm.Boolean" />
+ </EntityType>
+ <Action Name="Copy" IsBound="true" EntitySetPath="bindingParameter" ReturnType="Microsoft.Exchange.Services.OData.Model.EmailMessage">
+ <Parameter Name="bindingParameter" Type="Microsoft.Exchange.Services.OData.Model.EmailMessage" />
+ <Parameter Name="DestinationId" Type="Edm.String" />
+ </Action>
+ <Action Name="Move" IsBound="true" EntitySetPath="bindingParameter" ReturnType="Microsoft.Exchange.Services.OData.Model.EmailMessage">
+ <Parameter Name="bindingParameter" Type="Microsoft.Exchange.Services.OData.Model.EmailMessage" />
+ <Parameter Name="DestinationId" Type="Edm.String" />
+ </Action>
+ <EntityType Name="Attachment" BaseType="Microsoft.Exchange.Services.OData.Model.Entity" Abstract="true">
+ <Property Name="Name" Type="Edm.String" />
+ <Property Name="ContentType" Type="Edm.String" />
+ <Property Name="IsInline" Type="Edm.Boolean" Nullable="false" />
+ <Property Name="LastModifiedTime" Type="Edm.DateTimeOffset" />
+ </EntityType>
+ <EntityType Name="FileAttachment" BaseType="Microsoft.Exchange.Services.OData.Model.Attachment">
+ <Property Name="ContentId" Type="Edm.String" />
+ <Property Name="ContentLocation" Type="Edm.String" />
+ <Property Name="Size" Type="Edm.Int32" Nullable="false" />
+ <Property Name="IsContactPhoto" Type="Edm.Boolean" Nullable="false" />
+ <Property Name="ContentBytes" Type="Edm.Binary" MaxLength="Max" FixedLength="false" />
+ </EntityType>
+ <EntityType Name="ItemAttachment" BaseType="Microsoft.Exchange.Services.OData.Model.Attachment">
+ <NavigationProperty Name="Item" Type="Microsoft.Exchange.Services.OData.Model.Item" />
+ </EntityType>
+ <EntityType Name="Calendar" BaseType="Microsoft.Exchange.Services.OData.Model.Entity">
+ <Property Name="Name" Type="Edm.String" />
+ <Property Name="ChangeKey" Type="Edm.String" />
+ <NavigationProperty Name="Events" Type="Collection(Microsoft.Exchange.Services.OData.Model.Event)" />
+ </EntityType>
+ <EntityType Name="CalendarGroup" BaseType="Microsoft.Exchange.Services.OData.Model.Entity">
+ <Property Name="Name" Type="Edm.String" />
+ <Property Name="ChangeKey" Type="Edm.String" />
+ <Property Name="ClassId" Type="Edm.Guid" />
+ </EntityType>
+ <EntityType Name="Event" BaseType="Microsoft.Exchange.Services.OData.Model.Item">
+ <Property Name="Start" Type="Edm.DateTimeOffset" />
+ <Property Name="End" Type="Edm.DateTimeOffset" />
+ <Property Name="Location" Type="Microsoft.Exchange.Services.OData.Model.Location" />
+ <Property Name="ShowAs" Type="Microsoft.Exchange.Services.OData.Model.FreeBusyStatus" />
+ <Property Name="IsAllDay" Type="Edm.Boolean" />
+ <Property Name="IsCancelled" Type="Edm.Boolean" />
+ <Property Name="IsOrganizer" Type="Edm.Boolean" />
+ <Property Name="ResponseRequested" Type="Edm.Boolean" />
+ <Property Name="Type" Type="Microsoft.Exchange.Services.OData.Model.EventType" />
+ <Property Name="SeriesId" Type="Edm.String" />
+ <Property Name="Attendees" Type="Collection(Microsoft.Exchange.Services.OData.Model.Attendee)" />
+ <NavigationProperty Name="Calendar" Type="Microsoft.Exchange.Services.OData.Model.Calendar" />
+ </EntityType>
+ <EntityContainer Name="EntityContainer" m:IsDefaultEntityContainer="true">
+ <EntitySet Name="Users" EntityType="Microsoft.Exchange.Services.OData.Model.User">
+ <NavigationPropertyBinding Path="Folders" Target="Folders" />
+ <NavigationPropertyBinding Path="Messages" Target="Messages" />
+ <NavigationPropertyBinding Path="RootFolder" Target="Folders" />
+ <NavigationPropertyBinding Path="Inbox" Target="Folders" />
+ <NavigationPropertyBinding Path="Drafts" Target="Folders" />
+ <NavigationPropertyBinding Path="SentItems" Target="Folders" />
+ <NavigationPropertyBinding Path="DeletedItems" Target="Folders" />
+ <NavigationPropertyBinding Path="Calendars" Target="Calendars" />
+ <NavigationPropertyBinding Path="CalendarGroups" Target="CalendarGroups" />
+ <NavigationPropertyBinding Path="Events" Target="Events" />
+ </EntitySet>
+ <EntitySet Name="Folders" EntityType="Microsoft.Exchange.Services.OData.Model.Folder">
+ <NavigationPropertyBinding Path="ChildFolders" Target="Folders" />
+ <NavigationPropertyBinding Path="Messages" Target="Messages" />
+ </EntitySet>
+ <EntitySet Name="Items" EntityType="Microsoft.Exchange.Services.OData.Model.Item" />
+ <EntitySet Name="Messages" EntityType="Microsoft.Exchange.Services.OData.Model.EmailMessage">
+ <NavigationPropertyBinding Path="Attachments" Target="Attachments" />
+ </EntitySet>
+ <EntitySet Name="Attachments" EntityType="Microsoft.Exchange.Services.OData.Model.Attachment">
+ <NavigationPropertyBinding Path="Microsoft.Exchange.Services.OData.Model.ItemAttachment/Item" Target="Items" />
+ </EntitySet>
+ <EntitySet Name="Calendars" EntityType="Microsoft.Exchange.Services.OData.Model.Calendar">
+ <NavigationPropertyBinding Path="Events" Target="Events" />
+ </EntitySet>
+ <EntitySet Name="CalendarGroups" EntityType="Microsoft.Exchange.Services.OData.Model.CalendarGroup" />
+ <EntitySet Name="Events" EntityType="Microsoft.Exchange.Services.OData.Model.Event">
+ <NavigationPropertyBinding Path="Attachments" Target="Attachments" />
+ <NavigationPropertyBinding Path="Calendar" Target="Calendars" />
+ </EntitySet>
+ </EntityContainer>
+ </Schema>
+ </edmx:DataServices>
+</edmx:Edmx>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/northwind-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/northwind-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/northwind-metadata.xml
new file mode 100644
index 0000000..f65815d
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/northwind-metadata.xml
@@ -0,0 +1,471 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
+ <edmx:DataServices>
+ <Schema Namespace="NorthwindModel" xmlns="http://docs.oasis-open.org/odata/ns/edm">
+ <EntityType Name="Category">
+ <Key>
+ <PropertyRef Name="CategoryID" />
+ </Key>
+ <Property Name="CategoryID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
+ <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
+ <Property Name="Description" Type="Edm.String" MaxLength="max" />
+ <Property Name="Picture" Type="Edm.Binary" MaxLength="max" />
+ <NavigationProperty Name="Products" Type="Collection(NorthwindModel.Product)" Partner="Category" />
+ </EntityType>
+ <EntityType Name="CustomerDemographic">
+ <Key>
+ <PropertyRef Name="CustomerTypeID" />
+ </Key>
+ <Property Name="CustomerTypeID" Type="Edm.String" Nullable="false" MaxLength="10" />
+ <Property Name="CustomerDesc" Type="Edm.String" MaxLength="max" />
+ <NavigationProperty Name="Customers" Type="Collection(NorthwindModel.Customer)" Partner="CustomerDemographics" />
+ </EntityType>
+ <EntityType Name="Customer">
+ <Key>
+ <PropertyRef Name="CustomerID" />
+ </Key>
+ <Property Name="CustomerID" Type="Edm.String" Nullable="false" MaxLength="5" />
+ <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="ContactName" Type="Edm.String" MaxLength="30" />
+ <Property Name="ContactTitle" Type="Edm.String" MaxLength="30" />
+ <Property Name="Address" Type="Edm.String" MaxLength="60" />
+ <Property Name="City" Type="Edm.String" MaxLength="15" />
+ <Property Name="Region" Type="Edm.String" MaxLength="15" />
+ <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
+ <Property Name="Country" Type="Edm.String" MaxLength="15" />
+ <Property Name="Phone" Type="Edm.String" MaxLength="24" />
+ <Property Name="Fax" Type="Edm.String" MaxLength="24" />
+ <NavigationProperty Name="Orders" Type="Collection(NorthwindModel.Order)" Partner="Customer" />
+ <NavigationProperty Name="CustomerDemographics" Type="Collection(NorthwindModel.CustomerDemographic)" Partner="Customers" />
+ </EntityType>
+ <EntityType Name="Employee">
+ <Key>
+ <PropertyRef Name="EmployeeID" />
+ </Key>
+ <Property Name="EmployeeID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
+ <Property Name="LastName" Type="Edm.String" Nullable="false" MaxLength="20" />
+ <Property Name="FirstName" Type="Edm.String" Nullable="false" MaxLength="10" />
+ <Property Name="Title" Type="Edm.String" MaxLength="30" />
+ <Property Name="TitleOfCourtesy" Type="Edm.String" MaxLength="25" />
+ <Property Name="BirthDate" Type="Edm.DateTimeOffset" />
+ <Property Name="HireDate" Type="Edm.DateTimeOffset" />
+ <Property Name="Address" Type="Edm.String" MaxLength="60" />
+ <Property Name="City" Type="Edm.String" MaxLength="15" />
+ <Property Name="Region" Type="Edm.String" MaxLength="15" />
+ <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
+ <Property Name="Country" Type="Edm.String" MaxLength="15" />
+ <Property Name="HomePhone" Type="Edm.String" MaxLength="24" />
+ <Property Name="Extension" Type="Edm.String" MaxLength="4" />
+ <Property Name="Photo" Type="Edm.Binary" MaxLength="max" />
+ <Property Name="Notes" Type="Edm.String" MaxLength="max" />
+ <Property Name="ReportsTo" Type="Edm.Int32" />
+ <Property Name="PhotoPath" Type="Edm.String" MaxLength="255" />
+ <NavigationProperty Name="Employees1" Type="Collection(NorthwindModel.Employee)" Partner="Employee1" />
+ <NavigationProperty Name="Employee1" Type="NorthwindModel.Employee" Partner="Employees1">
+ <ReferentialConstraint Property="ReportsTo" ReferencedProperty="EmployeeID" />
+ </NavigationProperty>
+ <NavigationProperty Name="Orders" Type="Collection(NorthwindModel.Order)" Partner="Employee" />
+ <NavigationProperty Name="Territories" Type="Collection(NorthwindModel.Territory)" Partner="Employees" />
+ </EntityType>
+ <EntityType Name="Order_Detail">
+ <Key>
+ <PropertyRef Name="OrderID" />
+ <PropertyRef Name="ProductID" />
+ </Key>
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" />
+ <Property Name="Quantity" Type="Edm.Int16" Nullable="false" />
+ <Property Name="Discount" Type="Edm.Single" Nullable="false" />
+ <NavigationProperty Name="Order" Type="NorthwindModel.Order" Nullable="false" Partner="Order_Details">
+ <ReferentialConstraint Property="OrderID" ReferencedProperty="OrderID" />
+ </NavigationProperty>
+ <NavigationProperty Name="Product" Type="NorthwindModel.Product" Nullable="false" Partner="Order_Details">
+ <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID" />
+ </NavigationProperty>
+ </EntityType>
+ <EntityType Name="Order">
+ <Key>
+ <PropertyRef Name="OrderID" />
+ </Key>
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
+ <Property Name="CustomerID" Type="Edm.String" MaxLength="5" />
+ <Property Name="EmployeeID" Type="Edm.Int32" />
+ <Property Name="OrderDate" Type="Edm.DateTimeOffset" />
+ <Property Name="RequiredDate" Type="Edm.DateTimeOffset" />
+ <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
+ <Property Name="ShipVia" Type="Edm.Int32" />
+ <Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" />
+ <Property Name="ShipName" Type="Edm.String" MaxLength="40" />
+ <Property Name="ShipAddress" Type="Edm.String" MaxLength="60" />
+ <Property Name="ShipCity" Type="Edm.String" MaxLength="15" />
+ <Property Name="ShipRegion" Type="Edm.String" MaxLength="15" />
+ <Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" />
+ <Property Name="ShipCountry" Type="Edm.String" MaxLength="15" />
+ <NavigationProperty Name="Customer" Type="NorthwindModel.Customer" Partner="Orders">
+ <ReferentialConstraint Property="CustomerID" ReferencedProperty="CustomerID" />
+ </NavigationProperty>
+ <NavigationProperty Name="Employee" Type="NorthwindModel.Employee" Partner="Orders">
+ <ReferentialConstraint Property="EmployeeID" ReferencedProperty="EmployeeID" />
+ </NavigationProperty>
+ <NavigationProperty Name="Order_Details" Type="Collection(NorthwindModel.Order_Detail)" Partner="Order" />
+ <NavigationProperty Name="Shipper" Type="NorthwindModel.Shipper" Partner="Orders">
+ <ReferentialConstraint Property="ShipVia" ReferencedProperty="ShipperID" />
+ </NavigationProperty>
+ </EntityType>
+ <EntityType Name="Product">
+ <Key>
+ <PropertyRef Name="ProductID" />
+ </Key>
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
+ <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="SupplierID" Type="Edm.Int32" />
+ <Property Name="CategoryID" Type="Edm.Int32" />
+ <Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" />
+ <Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
+ <Property Name="UnitsInStock" Type="Edm.Int16" />
+ <Property Name="UnitsOnOrder" Type="Edm.Int16" />
+ <Property Name="ReorderLevel" Type="Edm.Int16" />
+ <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" />
+ <NavigationProperty Name="Category" Type="NorthwindModel.Category" Partner="Products">
+ <ReferentialConstraint Property="CategoryID" ReferencedProperty="CategoryID" />
+ </NavigationProperty>
+ <NavigationProperty Name="Order_Details" Type="Collection(NorthwindModel.Order_Detail)" Partner="Product" />
+ <NavigationProperty Name="Supplier" Type="NorthwindModel.Supplier" Partner="Products">
+ <ReferentialConstraint Property="SupplierID" ReferencedProperty="SupplierID" />
+ </NavigationProperty>
+ </EntityType>
+ <EntityType Name="Region">
+ <Key>
+ <PropertyRef Name="RegionID" />
+ </Key>
+ <Property Name="RegionID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="RegionDescription" Type="Edm.String" Nullable="false" MaxLength="50" />
+ <NavigationProperty Name="Territories" Type="Collection(NorthwindModel.Territory)" Partner="Region" />
+ </EntityType>
+ <EntityType Name="Shipper">
+ <Key>
+ <PropertyRef Name="ShipperID" />
+ </Key>
+ <Property Name="ShipperID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
+ <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="Phone" Type="Edm.String" MaxLength="24" />
+ <NavigationProperty Name="Orders" Type="Collection(NorthwindModel.Order)" Partner="Shipper" />
+ </EntityType>
+ <EntityType Name="Supplier">
+ <Key>
+ <PropertyRef Name="SupplierID" />
+ </Key>
+ <Property Name="SupplierID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
+ <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="ContactName" Type="Edm.String" MaxLength="30" />
+ <Property Name="ContactTitle" Type="Edm.String" MaxLength="30" />
+ <Property Name="Address" Type="Edm.String" MaxLength="60" />
+ <Property Name="City" Type="Edm.String" MaxLength="15" />
+ <Property Name="Region" Type="Edm.String" MaxLength="15" />
+ <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
+ <Property Name="Country" Type="Edm.String" MaxLength="15" />
+ <Property Name="Phone" Type="Edm.String" MaxLength="24" />
+ <Property Name="Fax" Type="Edm.String" MaxLength="24" />
+ <Property Name="HomePage" Type="Edm.String" MaxLength="max" />
+ <NavigationProperty Name="Products" Type="Collection(NorthwindModel.Product)" Partner="Supplier" />
+ </EntityType>
+ <EntityType Name="Territory">
+ <Key>
+ <PropertyRef Name="TerritoryID" />
+ </Key>
+ <Property Name="TerritoryID" Type="Edm.String" Nullable="false" MaxLength="20" />
+ <Property Name="TerritoryDescription" Type="Edm.String" Nullable="false" MaxLength="50" />
+ <Property Name="RegionID" Type="Edm.Int32" Nullable="false" />
+ <NavigationProperty Name="Region" Type="NorthwindModel.Region" Nullable="false" Partner="Territories">
+ <ReferentialConstraint Property="RegionID" ReferencedProperty="RegionID" />
+ </NavigationProperty>
+ <NavigationProperty Name="Employees" Type="Collection(NorthwindModel.Employee)" Partner="Territories" />
+ </EntityType>
+ <EntityType Name="Alphabetical_list_of_product">
+ <Key>
+ <PropertyRef Name="CategoryName" />
+ <PropertyRef Name="Discontinued" />
+ <PropertyRef Name="ProductID" />
+ <PropertyRef Name="ProductName" />
+ </Key>
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="SupplierID" Type="Edm.Int32" />
+ <Property Name="CategoryID" Type="Edm.Int32" />
+ <Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" />
+ <Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
+ <Property Name="UnitsInStock" Type="Edm.Int16" />
+ <Property Name="UnitsOnOrder" Type="Edm.Int16" />
+ <Property Name="ReorderLevel" Type="Edm.Int16" />
+ <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" />
+ <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
+ </EntityType>
+ <EntityType Name="Category_Sales_for_1997">
+ <Key>
+ <PropertyRef Name="CategoryName" />
+ </Key>
+ <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
+ <Property Name="CategorySales" Type="Edm.Decimal" Precision="19" Scale="4" />
+ </EntityType>
+ <EntityType Name="Current_Product_List">
+ <Key>
+ <PropertyRef Name="ProductID" />
+ <PropertyRef Name="ProductName" />
+ </Key>
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
+ <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ </EntityType>
+ <EntityType Name="Customer_and_Suppliers_by_City">
+ <Key>
+ <PropertyRef Name="CompanyName" />
+ <PropertyRef Name="Relationship" />
+ </Key>
+ <Property Name="City" Type="Edm.String" MaxLength="15" />
+ <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="ContactName" Type="Edm.String" MaxLength="30" />
+ <Property Name="Relationship" Type="Edm.String" Nullable="false" MaxLength="9" Unicode="false" />
+ </EntityType>
+ <EntityType Name="Invoice">
+ <Key>
+ <PropertyRef Name="CustomerName" />
+ <PropertyRef Name="Discount" />
+ <PropertyRef Name="OrderID" />
+ <PropertyRef Name="ProductID" />
+ <PropertyRef Name="ProductName" />
+ <PropertyRef Name="Quantity" />
+ <PropertyRef Name="Salesperson" />
+ <PropertyRef Name="ShipperName" />
+ <PropertyRef Name="UnitPrice" />
+ </Key>
+ <Property Name="ShipName" Type="Edm.String" MaxLength="40" />
+ <Property Name="ShipAddress" Type="Edm.String" MaxLength="60" />
+ <Property Name="ShipCity" Type="Edm.String" MaxLength="15" />
+ <Property Name="ShipRegion" Type="Edm.String" MaxLength="15" />
+ <Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" />
+ <Property Name="ShipCountry" Type="Edm.String" MaxLength="15" />
+ <Property Name="CustomerID" Type="Edm.String" MaxLength="5" />
+ <Property Name="CustomerName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="Address" Type="Edm.String" MaxLength="60" />
+ <Property Name="City" Type="Edm.String" MaxLength="15" />
+ <Property Name="Region" Type="Edm.String" MaxLength="15" />
+ <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
+ <Property Name="Country" Type="Edm.String" MaxLength="15" />
+ <Property Name="Salesperson" Type="Edm.String" Nullable="false" MaxLength="31" />
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="OrderDate" Type="Edm.DateTimeOffset" />
+ <Property Name="RequiredDate" Type="Edm.DateTimeOffset" />
+ <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
+ <Property Name="ShipperName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" />
+ <Property Name="Quantity" Type="Edm.Int16" Nullable="false" />
+ <Property Name="Discount" Type="Edm.Single" Nullable="false" />
+ <Property Name="ExtendedPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
+ <Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" />
+ </EntityType>
+ <EntityType Name="Order_Details_Extended">
+ <Key>
+ <PropertyRef Name="Discount" />
+ <PropertyRef Name="OrderID" />
+ <PropertyRef Name="ProductID" />
+ <PropertyRef Name="ProductName" />
+ <PropertyRef Name="Quantity" />
+ <PropertyRef Name="UnitPrice" />
+ </Key>
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" />
+ <Property Name="Quantity" Type="Edm.Int16" Nullable="false" />
+ <Property Name="Discount" Type="Edm.Single" Nullable="false" />
+ <Property Name="ExtendedPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
+ </EntityType>
+ <EntityType Name="Order_Subtotal">
+ <Key>
+ <PropertyRef Name="OrderID" />
+ </Key>
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" />
+ </EntityType>
+ <EntityType Name="Orders_Qry">
+ <Key>
+ <PropertyRef Name="CompanyName" />
+ <PropertyRef Name="OrderID" />
+ </Key>
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="CustomerID" Type="Edm.String" MaxLength="5" />
+ <Property Name="EmployeeID" Type="Edm.Int32" />
+ <Property Name="OrderDate" Type="Edm.DateTimeOffset" />
+ <Property Name="RequiredDate" Type="Edm.DateTimeOffset" />
+ <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
+ <Property Name="ShipVia" Type="Edm.Int32" />
+ <Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" />
+ <Property Name="ShipName" Type="Edm.String" MaxLength="40" />
+ <Property Name="ShipAddress" Type="Edm.String" MaxLength="60" />
+ <Property Name="ShipCity" Type="Edm.String" MaxLength="15" />
+ <Property Name="ShipRegion" Type="Edm.String" MaxLength="15" />
+ <Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" />
+ <Property Name="ShipCountry" Type="Edm.String" MaxLength="15" />
+ <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="Address" Type="Edm.String" MaxLength="60" />
+ <Property Name="City" Type="Edm.String" MaxLength="15" />
+ <Property Name="Region" Type="Edm.String" MaxLength="15" />
+ <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
+ <Property Name="Country" Type="Edm.String" MaxLength="15" />
+ </EntityType>
+ <EntityType Name="Product_Sales_for_1997">
+ <Key>
+ <PropertyRef Name="CategoryName" />
+ <PropertyRef Name="ProductName" />
+ </Key>
+ <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
+ <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="ProductSales" Type="Edm.Decimal" Precision="19" Scale="4" />
+ </EntityType>
+ <EntityType Name="Products_Above_Average_Price">
+ <Key>
+ <PropertyRef Name="ProductName" />
+ </Key>
+ <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
+ </EntityType>
+ <EntityType Name="Products_by_Category">
+ <Key>
+ <PropertyRef Name="CategoryName" />
+ <PropertyRef Name="Discontinued" />
+ <PropertyRef Name="ProductName" />
+ </Key>
+ <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
+ <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" />
+ <Property Name="UnitsInStock" Type="Edm.Int16" />
+ <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" />
+ </EntityType>
+ <EntityType Name="Sales_by_Category">
+ <Key>
+ <PropertyRef Name="CategoryID" />
+ <PropertyRef Name="CategoryName" />
+ <PropertyRef Name="ProductName" />
+ </Key>
+ <Property Name="CategoryID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
+ <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="ProductSales" Type="Edm.Decimal" Precision="19" Scale="4" />
+ </EntityType>
+ <EntityType Name="Sales_Totals_by_Amount">
+ <Key>
+ <PropertyRef Name="CompanyName" />
+ <PropertyRef Name="OrderID" />
+ </Key>
+ <Property Name="SaleAmount" Type="Edm.Decimal" Precision="19" Scale="4" />
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
+ <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
+ </EntityType>
+ <EntityType Name="Summary_of_Sales_by_Quarter">
+ <Key>
+ <PropertyRef Name="OrderID" />
+ </Key>
+ <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" />
+ </EntityType>
+ <EntityType Name="Summary_of_Sales_by_Year">
+ <Key>
+ <PropertyRef Name="OrderID" />
+ </Key>
+ <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" />
+ </EntityType>
+ <Annotations Target="ODataWebExperimental.Northwind.Model.NorthwindEntities">
+ <Annotation Term="Com.Microsoft.OData.Service.Conventions.V1.UrlConventions" String="KeyAsSegment" />
+ </Annotations>
+ </Schema>
+ <Schema Namespace="ODataWebExperimental.Northwind.Model" xmlns="http://docs.oasis-open.org/odata/ns/edm">
+ <EntityContainer Name="NorthwindEntities" p4:LazyLoadingEnabled="true" xmlns:p4="http://schemas.microsoft.com/ado/2009/02/edm/annotation">
+ <EntitySet Name="Categories" EntityType="NorthwindModel.Category">
+ <NavigationPropertyBinding Path="Products" Target="Products" />
+ </EntitySet>
+ <EntitySet Name="CustomerDemographics" EntityType="NorthwindModel.CustomerDemographic">
+ <NavigationPropertyBinding Path="Customers" Target="Customers" />
+ </EntitySet>
+ <EntitySet Name="Customers" EntityType="NorthwindModel.Customer">
+ <NavigationPropertyBinding Path="CustomerDemographics" Target="CustomerDemographics" />
+ <NavigationPropertyBinding Path="Orders" Target="Orders" />
+ </EntitySet>
+ <EntitySet Name="Employees" EntityType="NorthwindModel.Employee">
+ <NavigationPropertyBinding Path="Employees1" Target="Employees" />
+ <NavigationPropertyBinding Path="Employee1" Target="Employees" />
+ <NavigationPropertyBinding Path="Orders" Target="Orders" />
+ <NavigationPropertyBinding Path="Territories" Target="Territories" />
+ </EntitySet>
+ <EntitySet Name="Order_Details" EntityType="NorthwindModel.Order_Detail">
+ <NavigationPropertyBinding Path="Order" Target="Orders" />
+ <NavigationPropertyBinding Path="Product" Target="Products" />
+ </EntitySet>
+ <EntitySet Name="Orders" EntityType="NorthwindModel.Order">
+ <NavigationPropertyBinding Path="Customer" Target="Customers" />
+ <NavigationPropertyBinding Path="Employee" Target="Employees" />
+ <NavigationPropertyBinding Path="Order_Details" Target="Order_Details" />
+ <NavigationPropertyBinding Path="Shipper" Target="Shippers" />
+ </EntitySet>
+ <EntitySet Name="Products" EntityType="NorthwindModel.Product">
+ <NavigationPropertyBinding Path="Category" Target="Categories" />
+ <NavigationPropertyBinding Path="Order_Details" Target="Order_Details" />
+ <NavigationPropertyBinding Path="Supplier" Target="Suppliers" />
+ </EntitySet>
+ <EntitySet Name="Regions" EntityType="NorthwindModel.Region">
+ <NavigationPropertyBinding Path="Territories" Target="Territories" />
+ </EntitySet>
+ <EntitySet Name="Shippers" EntityType="NorthwindModel.Shipper">
+ <NavigationPropertyBinding Path="Orders" Target="Orders" />
+ </EntitySet>
+ <EntitySet Name="Suppliers" EntityType="NorthwindModel.Supplier">
+ <NavigationPropertyBinding Path="Products" Target="Products" />
+ </EntitySet>
+ <EntitySet Name="Territories" EntityType="NorthwindModel.Territory">
+ <NavigationPropertyBinding Path="Employees" Target="Employees" />
+ <NavigationPropertyBinding Path="Region" Target="Regions" />
+ </EntitySet>
+ <EntitySet Name="Alphabetical_list_of_products" EntityType="NorthwindModel.Alphabetical_list_of_product" />
+ <EntitySet Name="Category_Sales_for_1997" EntityType="NorthwindModel.Category_Sales_for_1997" />
+ <EntitySet Name="Current_Product_Lists" EntityType="NorthwindModel.Current_Product_List" />
+ <EntitySet Name="Customer_and_Suppliers_by_Cities" EntityType="NorthwindModel.Customer_and_Suppliers_by_City" />
+ <EntitySet Name="Invoices" EntityType="NorthwindModel.Invoice" />
+ <EntitySet Name="Order_Details_Extendeds" EntityType="NorthwindModel.Order_Details_Extended" />
+ <EntitySet Name="Order_Subtotals" EntityType="NorthwindModel.Order_Subtotal" />
+ <EntitySet Name="Orders_Qries" EntityType="NorthwindModel.Orders_Qry" />
+ <EntitySet Name="Product_Sales_for_1997" EntityType="NorthwindModel.Product_Sales_for_1997" />
+ <EntitySet Name="Products_Above_Average_Prices" EntityType="NorthwindModel.Products_Above_Average_Price" />
+ <EntitySet Name="Products_by_Categories" EntityType="NorthwindModel.Products_by_Category" />
+ <EntitySet Name="Sales_by_Categories" EntityType="NorthwindModel.Sales_by_Category" />
+ <EntitySet Name="Sales_Totals_by_Amounts" EntityType="NorthwindModel.Sales_Totals_by_Amount" />
+ <EntitySet Name="Summary_of_Sales_by_Quarters" EntityType="NorthwindModel.Summary_of_Sales_by_Quarter" />
+ <EntitySet Name="Summary_of_Sales_by_Years" EntityType="NorthwindModel.Summary_of_Sales_by_Year" />
+ </EntityContainer>
+ </Schema>
+ </edmx:DataServices>
+</edmx:Edmx>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/serviceDocument.json
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/serviceDocument.json b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/serviceDocument.json
new file mode 100644
index 0000000..2e7f066
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/serviceDocument.json
@@ -0,0 +1,32 @@
+{
+ "@odata.context": "http://host/service/$metadata",
+ "value": [
+ {
+ "name": "Orders",
+ "kind": "EntitySet",
+ "url": "Orders"
+ },
+ {
+ "name": "OrderItems",
+ "title": "Order Details",
+ "url": "OrderItems"
+ },
+ {
+ "name": "TopProducts",
+ "title": "Best-Selling Products",
+ "kind": "FunctionImport",
+ "url": "TopProducts"
+ },
+ {
+ "name": "Contoso",
+ "title": "Contoso Ltd.",
+ "kind": "Singleton",
+ "url": "Contoso"
+ },
+ {
+ "name": "Human Resources",
+ "kind": "ServiceDocument",
+ "url": "http://host/HR/"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/serviceDocument.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/serviceDocument.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/serviceDocument.xml
new file mode 100644
index 0000000..faddf9c
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v4/serviceDocument.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<app:service xmlns:app="http://www.w3.org/2007/app"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+ xmlns:metadata="http://docs.oasis-open.org/odata/ns/metadata"
+ xml:base="http://host/service/"
+ metadata:context="$metadata"
+ metadata:metadata-etag="W/"MjAxMy0wNS0xM1QxNDo1NFo="">
+ <app:workspace>
+ <atom:title type="text">Data</atom:title>
+ <app:collection href="Orders">
+ <atom:title type="text">Orders</atom:title>
+ </app:collection>
+ <app:collection href="OrderItems">
+ <atom:title type="text">Order Details</atom:title>
+ </app:collection>
+ <metadata:function-import href="TopProducts">
+ <atom:title>Best-Selling Products</atom:title>
+ </metadata:function-import>
+ <metadata:singleton href="Contoso">
+ <atom:title>Contoso Ltd.</atom:title>
+ </metadata:singleton>
+ <metadata:service-document href="http://host/HR/">
+ <atom:title>Human Resources</atom:title>
+ </metadata:service-document>
+ </app:workspace>
+</app:service>
[26/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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/op/impl/AbstractODataBinder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataBinder.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataBinder.java
deleted file mode 100644
index 8483df3..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataBinder.java
+++ /dev/null
@@ -1,581 +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.op.impl;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.ParserConfigurationException;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.ODataConstants;
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.api.data.ServiceDocumentItem;
-import org.apache.olingo.odata4.client.api.domain.ODataServiceDocument;
-import org.apache.olingo.odata4.client.api.op.ODataBinder;
-import org.apache.olingo.odata4.client.api.utils.XMLUtils;
-import org.apache.olingo.odata4.client.core.uri.URIUtils;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public abstract class AbstractODataBinder implements ODataBinder {
-
- private static final long serialVersionUID = 454285889193689536L;
-
- /**
- * Logger.
- */
- protected final Logger LOG = LoggerFactory.getLogger(AbstractODataBinder.class);
-
- protected final ODataClient client;
-
- protected AbstractODataBinder(final ODataClient client) {
- this.client = client;
- }
-
- protected Element newEntryContent() {
- Element properties = null;
- try {
- final DocumentBuilder builder = XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder();
- final Document doc = builder.newDocument();
- properties = doc.createElement(ODataConstants.ELEM_PROPERTIES);
- properties.setAttribute(ODataConstants.XMLNS_METADATA,
- client.getServiceVersion().getNamespaceMap().get(ODataServiceVersion.NS_METADATA));
- properties.setAttribute(ODataConstants.XMLNS_DATASERVICES,
- client.getServiceVersion().getNamespaceMap().get(ODataServiceVersion.NS_DATASERVICES));
- properties.setAttribute(ODataConstants.XMLNS_GML, ODataConstants.NS_GML);
- properties.setAttribute(ODataConstants.XMLNS_GEORSS, ODataConstants.NS_GEORSS);
- } catch (ParserConfigurationException e) {
- LOG.error("Failure building entry content", e);
- }
-
- return properties;
- }
-
- @Override
- public ODataServiceDocument getODataServiceDocument(final ServiceDocument resource) {
- final ODataServiceDocument serviceDocument = new ODataServiceDocument();
-
- for (ServiceDocumentItem entitySet : resource.getEntitySets()) {
- // handles V3 JSON format oddities, where title is not contained
- serviceDocument.getEntitySets().put(StringUtils.isBlank(entitySet.getTitle())
- ? entitySet.getName() : entitySet.getTitle(),
- URIUtils.getURI(resource.getBaseURI(), entitySet.getHref()));
- }
-
- return serviceDocument;
- }
-
-// @Override
-// public <T extends Feed> T getFeed(final ODataEntitySet feed, final Class<T> reference) {
-// final T feedResource = ResourceFactory.newFeed(reference);
-//
-// final List<Entry> entries = new ArrayList<Entry>();
-// feedResource.setEntries(entries);
-//
-// final URI next = feed.getNext();
-// if (next != null) {
-// feedResource.setNext(next);
-// }
-//
-// for (ODataEntity entity : feed.getEntities()) {
-// entries.add(getEntry(entity, ResourceFactory.entryClassForFeed(reference)));
-// }
-//
-// feedResource.setEntries(entries);
-//
-// return feedResource;
-// }
-//
-// @Override
-// public <T extends Entry> T getEntry(final ODataEntity entity, final Class<T> reference) {
-// return getEntry(entity, reference, true);
-// }
-//
-// @Override
-// @SuppressWarnings("unchecked")
-// public <T extends Entry> T getEntry(final ODataEntity entity, final Class<T> reference,
-// final boolean setType) {
-//
-// final T entry = ResourceFactory.newEntry(reference);
-// entry.setType(entity.getName());
-//
-// // -------------------------------------------------------------
-// // Add edit and self link
-// // -------------------------------------------------------------
-// final URI editLink = entity.getEditLink();
-// if (editLink != null) {
-// final Link entryEditLink = ResourceFactory.newLinkForEntry(reference);
-// entryEditLink.setTitle(entity.getName());
-// entryEditLink.setHref(editLink.toASCIIString());
-// entryEditLink.setRel(ODataConstants.EDIT_LINK_REL);
-// entry.setEditLink(entryEditLink);
-// }
-//
-// if (entity.isReadOnly()) {
-// final Link entrySelfLink = ResourceFactory.newLinkForEntry(reference);
-// entrySelfLink.setTitle(entity.getName());
-// entrySelfLink.setHref(entity.getLink().toASCIIString());
-// entrySelfLink.setRel(ODataConstants.SELF_LINK_REL);
-// entry.setSelfLink(entrySelfLink);
-// }
-// // -------------------------------------------------------------
-//
-// // -------------------------------------------------------------
-// // Append navigation links (handling inline entry / feed as well)
-// // -------------------------------------------------------------
-// // handle navigation links
-// for (ODataLink link : entity.getNavigationLinks()) {
-// // append link
-// LOG.debug("Append navigation link\n{}", link);
-// entry.addNavigationLink(getLinkResource(link, ResourceFactory.linkClassForEntry(reference)));
-// }
-// // -------------------------------------------------------------
-//
-// // -------------------------------------------------------------
-// // Append edit-media links
-// // -------------------------------------------------------------
-// for (ODataLink link : entity.getEditMediaLinks()) {
-// LOG.debug("Append edit-media link\n{}", link);
-// entry.addMediaEditLink(getLinkResource(link, ResourceFactory.linkClassForEntry(reference)));
-// }
-// // -------------------------------------------------------------
-//
-// // -------------------------------------------------------------
-// // Append association links
-// // -------------------------------------------------------------
-// for (ODataLink link : entity.getAssociationLinks()) {
-// LOG.debug("Append association link\n{}", link);
-// entry.addAssociationLink(getLinkResource(link, ResourceFactory.linkClassForEntry(reference)));
-// }
-// // -------------------------------------------------------------
-//
-// final Element content = newEntryContent();
-// if (entity.isMediaEntity()) {
-// entry.setMediaEntryProperties(content);
-// entry.setMediaContentSource(entity.getMediaContentSource());
-// entry.setMediaContentType(entity.getMediaContentType());
-// } else {
-// entry.setContent(content);
-// }
-//
-// for (ODataProperty prop : entity.getProperties()) {
-// content.appendChild(toDOMElement(prop, content.getOwnerDocument(), setType));
-// }
-//
-// return entry;
-// }
-//
-// @Override
-// public Element toDOMElement(final ODataProperty prop) {
-// try {
-// return toDOMElement(prop, XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder().newDocument(), true);
-// } catch (ParserConfigurationException e) {
-// LOG.error("Error retrieving property DOM", e);
-// throw new IllegalArgumentException(e);
-// }
-// }
-//
-// @Override
-// public ODataLinkCollection getLinkCollection(final LinkCollection linkCollection) {
-// final ODataLinkCollection collection = new ODataLinkCollection(linkCollection.getNext());
-// collection.setLinks(linkCollection.getLinks());
-// return collection;
-// }
-//
-// @Override
-// public ODataEntitySet getODataEntitySet(final Feed resource) {
-// return getODataEntitySet(resource, null);
-// }
-//
-// @Override
-// public ODataEntitySet getODataEntitySet(final Feed resource, final URI defaultBaseURI) {
-// if (LOG.isDebugEnabled()) {
-// final StringWriter writer = new StringWriter();
-// client.getSerializer().feed(resource, writer);
-// writer.flush();
-// LOG.debug("FeedResource -> ODataEntitySet:\n{}", writer.toString());
-// }
-//
-// final URI base = defaultBaseURI == null ? resource.getBaseURI() : defaultBaseURI;
-//
-// final URI next = resource.getNext();
-//
-// final ODataEntitySet entitySet = next == null
-// ? client.getObjectFactory().newEntitySet()
-// : client.getObjectFactory().newEntitySet(URIUtils.getURI(base, next.toASCIIString()));
-//
-// if (resource.getCount() != null) {
-// entitySet.setCount(resource.getCount());
-// }
-//
-// for (Entry entryResource : resource.getEntries()) {
-// entitySet.addEntity(getODataEntity(entryResource));
-// }
-//
-// return entitySet;
-// }
-//
-// @Override
-// public ODataEntity getODataEntity(final Entry resource) {
-// return getODataEntity(resource, null);
-// }
-//
-// @Override
-// public ODataEntity getODataEntity(final Entry resource, final URI defaultBaseURI) {
-// if (LOG.isDebugEnabled()) {
-// final StringWriter writer = new StringWriter();
-// client.getSerializer().entry(resource, writer);
-// writer.flush();
-// LOG.debug("EntryResource -> ODataEntity:\n{}", writer.toString());
-// }
-//
-// final URI base = defaultBaseURI == null ? resource.getBaseURI() : defaultBaseURI;
-//
-// final ODataEntity entity = resource.getSelfLink() == null
-// ? client.getObjectFactory().newEntity(resource.getType())
-// : client.getObjectFactory().newEntity(resource.getType(),
-// URIUtils.getURI(base, resource.getSelfLink().getHref()));
-//
-// if (StringUtils.isNotBlank(resource.getETag())) {
-// entity.setETag(resource.getETag());
-// }
-//
-// if (resource.getEditLink() != null) {
-// entity.setEditLink(URIUtils.getURI(base, resource.getEditLink().getHref()));
-// }
-//
-// for (Link link : resource.getAssociationLinks()) {
-// entity.addLink(client.getObjectFactory().newAssociationLink(link.getTitle(), base, link.getHref()));
-// }
-//
-// for (Link link : resource.getNavigationLinks()) {
-// final Entry inlineEntry = link.getInlineEntry();
-// final Feed inlineFeed = link.getInlineFeed();
-//
-// if (inlineEntry == null && inlineFeed == null) {
-// entity.addLink(
-// client.getObjectFactory().newEntityNavigationLink(link.getTitle(), base, link.getHref()));
-// } else if (inlineFeed == null) {
-// entity.addLink(client.getObjectFactory().newInlineEntity(
-// link.getTitle(), base, link.getHref(),
-// getODataEntity(inlineEntry,
-// inlineEntry.getBaseURI() == null ? base : inlineEntry.getBaseURI())));
-// } else {
-// entity.addLink(client.getObjectFactory().newInlineEntitySet(
-// link.getTitle(), base, link.getHref(),
-// getODataEntitySet(inlineFeed,
-// inlineFeed.getBaseURI() == null ? base : inlineFeed.getBaseURI())));
-// }
-// }
-//
-// for (Link link : resource.getMediaEditLinks()) {
-// entity.addLink(client.getObjectFactory().newMediaEditLink(link.getTitle(), base, link.getHref()));
-// }
-//
-// for (ODataOperation operation : resource.getOperations()) {
-// operation.setTarget(URIUtils.getURI(base, operation.getTarget()));
-// entity.addOperation(operation);
-// }
-//
-// final Element content;
-// if (resource.isMediaEntry()) {
-// entity.setMediaEntity(true);
-// entity.setMediaContentSource(resource.getMediaContentSource());
-// entity.setMediaContentType(resource.getMediaContentType());
-// content = resource.getMediaEntryProperties();
-// } else {
-// content = resource.getContent();
-// }
-// if (content != null) {
-// for (Node property : XMLUtils.getChildNodes(content, Node.ELEMENT_NODE)) {
-// try {
-// entity.addProperty(getProperty((Element) property));
-// } catch (IllegalArgumentException e) {
-// LOG.warn("Failure retrieving EdmType for {}", property.getTextContent(), e);
-// }
-// }
-// }
-//
-// return entity;
-// }
-//
-// @Override
-// public <T extends Link> T getLinkResource(final ODataLink link, final Class<T> reference) {
-// final T linkResource = ResourceFactory.newLink(reference);
-// linkResource.setRel(link.getRel());
-// linkResource.setTitle(link.getName());
-// linkResource.setHref(link.getLink() == null ? null : link.getLink().toASCIIString());
-// linkResource.setType(link.getType().toString());
-//
-// if (link instanceof ODataInlineEntity) {
-// // append inline entity
-// final ODataEntity inlineEntity = ((ODataInlineEntity) link).getEntity();
-// LOG.debug("Append in-line entity\n{}", inlineEntity);
-//
-// linkResource.setInlineEntry(getEntry(inlineEntity, ResourceFactory.entryClassForLink(reference)));
-// } else if (link instanceof ODataInlineEntitySet) {
-// // append inline feed
-// final ODataEntitySet InlineFeed = ((ODataInlineEntitySet) link).getEntitySet();
-// LOG.debug("Append in-line feed\n{}", InlineFeed);
-//
-// linkResource.setInlineFeed(getFeed(InlineFeed, ResourceFactory.feedClassForLink(reference)));
-// }
-//
-// return linkResource;
-// }
-//
-// @Override
-// public ODataProperty getProperty(final Element property) {
-// final ODataProperty res;
-//
-// final Node nullNode = property.getAttributes().getNamedItem(ODataConstants.ATTR_NULL);
-//
-// if (nullNode == null) {
-// final EdmType edmType = StringUtils.isBlank(property.getAttribute(ODataConstants.ATTR_M_TYPE))
-// ? null
-// : newEdmType(property.getAttribute(ODataConstants.ATTR_M_TYPE));
-//
-// final PropertyType propType = edmType == null
-// ? guessPropertyType(property)
-// : edmType.isCollection()
-// ? PropertyType.COLLECTION
-// : edmType.isSimpleType()
-// ? PropertyType.PRIMITIVE
-// : PropertyType.COMPLEX;
-//
-// switch (propType) {
-// case COLLECTION:
-// res = fromCollectionPropertyElement(property, edmType);
-// break;
-//
-// case COMPLEX:
-// res = fromComplexPropertyElement(property, edmType);
-// break;
-//
-// case PRIMITIVE:
-// res = fromPrimitivePropertyElement(property, edmType);
-// break;
-//
-// case EMPTY:
-// default:
-// res = client.getObjectFactory().newPrimitiveProperty(XMLUtils.getSimpleName(property), null);
-// }
-// } else {
-// res = client.getObjectFactory().newPrimitiveProperty(XMLUtils.getSimpleName(property), null);
-// }
-//
-// return res;
-// }
-//
-// protected PropertyType guessPropertyType(final Element property) {
-// PropertyType res = null;
-//
-// if (property.hasChildNodes()) {
-// final NodeList children = property.getChildNodes();
-//
-// for (int i = 0; res == null && i < children.getLength(); i++) {
-// final Node child = children.item(i);
-//
-// if (child.getNodeType() == Node.ELEMENT_NODE
-// && !child.getNodeName().startsWith(ODataConstants.PREFIX_GML)) {
-//
-// res = ODataConstants.ELEM_ELEMENT.equals(XMLUtils.getSimpleName(child))
-// ? PropertyType.COLLECTION
-// : PropertyType.COMPLEX;
-// }
-// }
-// } else {
-// res = PropertyType.EMPTY;
-// }
-//
-// if (res == null) {
-// res = PropertyType.PRIMITIVE;
-// }
-//
-// return res;
-// }
-//
-// protected Element toDOMElement(final ODataProperty prop, final Document doc, final boolean setType) {
-// final Element element;
-//
-// if (prop.hasNullValue()) {
-// // null property handling
-// element = toNullPropertyElement(prop, doc);
-// } else if (prop.hasPrimitiveValue()) {
-// // primitive property handling
-// element = toPrimitivePropertyElement(prop, doc, setType);
-// } else if (prop.hasCollectionValue()) {
-// // collection property handling
-// element = toCollectionPropertyElement(prop, doc, setType);
-// } else {
-// // complex property handling
-// element = toComplexPropertyElement(prop, doc, setType);
-// }
-//
-// element.setAttribute(ODataConstants.XMLNS_METADATA,
-// client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_METADATA));
-// element.setAttribute(ODataConstants.XMLNS_DATASERVICES,
-// client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_DATASERVICES));
-// element.setAttribute(ODataConstants.XMLNS_GML, ODataConstants.NS_GML);
-// element.setAttribute(ODataConstants.XMLNS_GEORSS, ODataConstants.NS_GEORSS);
-//
-// return element;
-// }
-//
-// protected Element toNullPropertyElement(final ODataProperty prop, final Document doc) {
-// final Element element = doc.createElement(ODataConstants.PREFIX_DATASERVICES + prop.getName());
-// element.setAttribute(ODataConstants.ATTR_NULL, Boolean.toString(true));
-// return element;
-// }
-//
-// protected Element toPrimitivePropertyElement(
-// final ODataProperty prop, final Document doc, final boolean setType) {
-//
-// return toPrimitivePropertyElement(prop.getName(), prop.getPrimitiveValue(), doc, setType);
-// }
-//
-// protected Element toPrimitivePropertyElement(
-// final String name, final ODataPrimitiveValue value, final Document doc, final boolean setType) {
-//
-// final Element element = doc.createElement(ODataConstants.PREFIX_DATASERVICES + name);
-// if (setType) {
-// element.setAttribute(ODataConstants.ATTR_M_TYPE, value.getTypeName());
-// }
-//
-// if (value instanceof ODataGeospatialValue) {
-// element.appendChild(doc.importNode(((ODataGeospatialValue) value).toTree(), true));
-// } else {
-// element.setTextContent(value.toString());
-// }
-//
-// return element;
-// }
-//
-// protected Element toCollectionPropertyElement(
-// final ODataProperty prop, final Document doc, final boolean setType) {
-//
-// if (!prop.hasCollectionValue()) {
-// throw new IllegalArgumentException("Invalid property value type "
-// + prop.getValue().getClass().getSimpleName());
-// }
-//
-// final ODataCollectionValue value = prop.getCollectionValue();
-//
-// final Element element = doc.createElement(ODataConstants.PREFIX_DATASERVICES + prop.getName());
-// if (value.getTypeName() != null && setType) {
-// element.setAttribute(ODataConstants.ATTR_M_TYPE, value.getTypeName());
-// }
-//
-// for (ODataValue el : value) {
-// if (el.isPrimitive()) {
-// element.appendChild(
-// toPrimitivePropertyElement(ODataConstants.ELEM_ELEMENT, el.asPrimitive(), doc, setType));
-// } else {
-// element.appendChild(
-// toComplexPropertyElement(ODataConstants.ELEM_ELEMENT, el.asComplex(), doc, setType));
-// }
-// }
-//
-// return element;
-// }
-//
-// protected Element toComplexPropertyElement(
-// final ODataProperty prop, final Document doc, final boolean setType) {
-//
-// return toComplexPropertyElement(prop.getName(), prop.getComplexValue(), doc, setType);
-// }
-//
-// protected Element toComplexPropertyElement(
-// final String name, final ODataComplexValue value, final Document doc, final boolean setType) {
-//
-// final Element element = doc.createElement(ODataConstants.PREFIX_DATASERVICES + name);
-// if (value.getTypeName() != null && setType) {
-// element.setAttribute(ODataConstants.ATTR_M_TYPE, value.getTypeName());
-// }
-//
-// for (ODataProperty field : value) {
-// element.appendChild(toDOMElement(field, doc, true));
-// }
-// return element;
-// }
-//
-// protected ODataPrimitiveValue fromPrimitiveValueElement(final Element prop, final EdmType edmType) {
-// final ODataPrimitiveValue value;
-// if (edmType != null && edmType.getSimpleType().isGeospatial()) {
-// final Element geoProp = ODataConstants.PREFIX_GML.equals(prop.getPrefix())
-// ? prop : (Element) XMLUtils.getChildNodes(prop, Node.ELEMENT_NODE).get(0);
-// value = client.getGeospatialValueBuilder().
-// setType(edmType.getSimpleType()).setTree(geoProp).build();
-// } else {
-// value = client.getPrimitiveValueBuilder().
-// setType(edmType == null ? null : edmType.getSimpleType()).setText(prop.getTextContent()).build();
-// }
-// return value;
-// }
-//
-// protected ODataProperty fromPrimitivePropertyElement(final Element prop, final EdmType edmType) {
-// return client.getObjectFactory().newPrimitiveProperty(
-// XMLUtils.getSimpleName(prop), fromPrimitiveValueElement(prop, edmType));
-// }
-//
-// protected ODataComplexValue fromComplexValueElement(final Element prop, final EdmType edmType) {
-// final ODataComplexValue value = new ODataComplexValue(edmType == null ? null : edmType.getTypeExpression());
-//
-// for (Node child : XMLUtils.getChildNodes(prop, Node.ELEMENT_NODE)) {
-// value.add(getProperty((Element) child));
-// }
-//
-// return value;
-// }
-//
-// protected ODataProperty fromComplexPropertyElement(final Element prop, final EdmType edmType) {
-// return client.getObjectFactory().newComplexProperty(XMLUtils.getSimpleName(prop),
-// fromComplexValueElement(prop, edmType));
-// }
-//
-// protected ODataProperty fromCollectionPropertyElement(final Element prop, final EdmType edmType) {
-// final ODataCollectionValue value
-// = new ODataCollectionValue(edmType == null ? null : edmType.getTypeExpression());
-//
-// final EdmType type = edmType == null ? null : newEdmType(edmType.getBaseType());
-// final NodeList elements = prop.getChildNodes();
-//
-// for (int i = 0; i < elements.getLength(); i++) {
-// if (elements.item(i).getNodeType() != Node.TEXT_NODE) {
-// final Element child = (Element) elements.item(i);
-//
-// switch (guessPropertyType(child)) {
-// case COMPLEX:
-// value.add(fromComplexValueElement(child, type));
-// break;
-// case PRIMITIVE:
-// value.add(fromPrimitiveValueElement(child, type));
-// break;
-// default:
-// // do not add null or empty values
-// }
-// }
-// }
-//
-// return client.getObjectFactory().newCollectionProperty(XMLUtils.getSimpleName(prop), value);
-// }
-// protected abstract EdmType newEdmType(String expression);
-}
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/op/impl/AbstractODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataDeserializer.java
deleted file mode 100644
index ed4ebd0..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataDeserializer.java
+++ /dev/null
@@ -1,177 +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.op.impl;
-
-import java.io.InputStream;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.op.ODataDeserializer;
-import org.apache.olingo.odata4.client.core.xml.XMLParser;
-import org.w3c.dom.Element;
-
-public abstract class AbstractODataDeserializer extends AbstractJacksonTool implements ODataDeserializer {
-
- private static final long serialVersionUID = -4244158979195609909L;
-
-// private final AtomDeserializer atomDeserializer;
- public AbstractODataDeserializer(final ODataClient client) {
- super(client);
-// this.atomDeserializer = new AtomDeserializer(client);
- }
-
-// @Override
-// @SuppressWarnings("unchecked")
-// public <T extends Feed> T toFeed(final InputStream input, final Class<T> reference) {
-// T entry;
-//
-// if (AtomFeed.class.equals(reference)) {
-// entry = (T) toAtomFeed(input);
-// } else {
-// entry = (T) toJSONFeed(input);
-// }
-//
-// return entry;
-// }
-//
-// @Override
-// @SuppressWarnings("unchecked")
-// public <T extends Entry> T toEntry(final InputStream input, final Class<T> reference) {
-// T entry;
-//
-// if (AtomEntry.class.equals(reference)) {
-// entry = (T) toAtomEntry(input);
-//
-// } else {
-// entry = (T) toJSONEntry(input);
-// }
-//
-// return entry;
-// }
-//
-// @Override
-// public Element toPropertyDOM(final InputStream input, final ODataFormat format) {
-// return format == ODataFormat.XML
-// ? toPropertyDOMFromXML(input)
-// : toPropertyDOMFromJSON(input);
-// }
-//
-// @Override
-// public LinkCollection toLinkCollection(final InputStream input, final ODataFormat format) {
-// return format == ODataFormat.XML
-// ? toLinkCollectionFromXML(input)
-// : toLinkCollectionFromJSON(input);
-// }
-//
-// @Override
-// public ODataError toODataError(final InputStream input, final boolean isXML) {
-// return isXML
-// ? toODataErrorFromXML(input)
-// : toODataErrorFromJSON(input);
-// }
-//
- @Override
- public Element toDOM(final InputStream input) {
- return XMLParser.PARSER.deserialize(input);
- }
-//
-// /*
-// * ------------------ Protected methods ------------------
-// */
-// protected AtomFeed toAtomFeed(final InputStream input) {
-// try {
-// return atomDeserializer.feed(toDOM(input));
-// } catch (Exception e) {
-// throw new IllegalArgumentException("While deserializing Atom feed", e);
-// }
-// }
-//
-// protected AtomEntry toAtomEntry(final InputStream input) {
-// try {
-// return atomDeserializer.entry(toDOM(input));
-// } catch (Exception e) {
-// throw new IllegalArgumentException("While deserializing Atom entry", e);
-// }
-// }
-//
-// protected JSONFeed toJSONFeed(final InputStream input) {
-// try {
-// return getObjectMapper().readValue(input, JSONFeed.class);
-// } catch (IOException e) {
-// throw new IllegalArgumentException("While deserializing JSON feed", e);
-// }
-// }
-//
-// protected abstract AbstractJSONEntry toJSONEntry(final InputStream input);
-//
-// protected Element toPropertyDOMFromXML(final InputStream input) {
-// return toDOM(input);
-// }
-//
-// protected Element toPropertyDOMFromJSON(final InputStream input) {
-// try {
-// return getObjectMapper().readValue(input, JSONProperty.class).getContent();
-// } catch (IOException e) {
-// throw new IllegalArgumentException("While deserializing JSON property", e);
-// }
-// }
-//
-// protected XMLLinkCollection toLinkCollectionFromXML(final InputStream input) {
-// final Element root = toDOM(input);
-//
-// final NodeList uris = root.getOwnerDocument().getElementsByTagName(ODataConstants.ELEM_URI);
-//
-// final List<URI> links = new ArrayList<URI>();
-// for (int i = 0; i < uris.getLength(); i++) {
-// links.add(URI.create(uris.item(i).getTextContent()));
-// }
-//
-// final NodeList next = root.getElementsByTagName(ODataConstants.NEXT_LINK_REL);
-// final XMLLinkCollection linkCollection = next.getLength() > 0
-// ? new XMLLinkCollection(URI.create(next.item(0).getTextContent()))
-// : new XMLLinkCollection();
-// linkCollection.setLinks(links);
-//
-// return linkCollection;
-// }
-//
-// protected JSONLinkCollection toLinkCollectionFromJSON(final InputStream input) {
-// try {
-// return getObjectMapper().readValue(input, JSONLinkCollection.class);
-// } catch (IOException e) {
-// throw new IllegalArgumentException("While deserializing JSON $links", e);
-// }
-// }
-//
-// protected XMLODataError toODataErrorFromXML(final InputStream input) {
-// try {
-// final XmlMapper xmlMapper = new XmlMapper(
-// new XmlFactory(new InputFactoryImpl(), new OutputFactoryImpl()), new JacksonXmlModule());
-// return xmlMapper.readValue(input, XMLODataError.class);
-// } catch (Exception e) {
-// throw new IllegalArgumentException("While deserializing XML error", e);
-// }
-// }
-//
-// protected JSONODataError toODataErrorFromJSON(final InputStream input) {
-// try {
-// return getObjectMapper().readValue(input, JSONODataErrorBundle.class).getError();
-// } catch (IOException e) {
-// throw new IllegalArgumentException("While deserializing JSON error", e);
-// }
-// }
-}
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/op/impl/AbstractODataReader.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataReader.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataReader.java
deleted file mode 100644
index 3704db7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataReader.java
+++ /dev/null
@@ -1,138 +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.op.impl;
-
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.op.ODataReader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractODataReader implements ODataReader {
-
- private static final long serialVersionUID = -1988865870981207079L;
-
- /**
- * Logger.
- */
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractODataReader.class);
-
- protected final ODataClient client;
-
- protected AbstractODataReader(final ODataClient client) {
- this.client = client;
- }
-
-// @Override
-// public ODataEntitySet readEntitySet(final InputStream input, final ODataPubFormat format) {
-// return client.getBinder().getODataEntitySet(
-// client.getDeserializer().toFeed(input, ResourceFactory.feedClassForFormat(format)));
-// }
-//
-// @Override
-// public ODataEntity readEntity(final InputStream input, final ODataPubFormat format) {
-// return client.getBinder().getODataEntity(
-// client.getDeserializer().toEntry(input, ResourceFactory.entryClassForFormat(format)));
-// }
-//
-// @Override
-// public ODataProperty readProperty(final InputStream input, final ODataFormat format) {
-// final Element property = client.getDeserializer().toPropertyDOM(input, format);
-//
-// // The ODataProperty object is used either for actual entity properties and for invoke result
-// // (when return type is neither an entity nor a collection of entities).
-// // Such formats are mostly the same except for collections: an entity property looks like
-// // <aproperty m:type="Collection(AType)">
-// // <element>....</element>
-// // </aproperty>
-// //
-// // while an invoke result with returnType="Collection(AnotherType)" looks like
-// // <functionImportName>
-// // <element m:type="AnotherType">...</element>
-// // <functionImportName>
-// //
-// // The code below is meant for "normalizing" the latter into
-// // <functionImportName m:type="Collection(AnotherType)">
-// // <element m:type="AnotherType">...</element>
-// // <functionImportName>
-// final String type = property.getAttribute(ODataConstants.ATTR_M_TYPE);
-// final NodeList elements = property.getElementsByTagName(ODataConstants.ELEM_ELEMENT);
-// if (StringUtils.isBlank(type) && elements != null && elements.getLength() > 0) {
-// final Node elementType = elements.item(0).getAttributes().getNamedItem(ODataConstants.ATTR_M_TYPE);
-// if (elementType != null) {
-// property.setAttribute(ODataConstants.ATTR_M_TYPE, "Collection(" + elementType.getTextContent() + ")");
-// }
-// }
-//
-// return client.getBinder().getProperty(property);
-// }
-//
-// @Override
-// public ODataLinkCollection readLinks(final InputStream input, final ODataFormat format) {
-// return client.getBinder().getLinkCollection(
-// client.getDeserializer().toLinkCollection(input, format));
-// }
-//
-// @Override
-// public ODataError readError(final InputStream inputStream, final boolean isXML) {
-// return client.getDeserializer().toODataError(inputStream, isXML);
-// }
-//
-// @Override
-// @SuppressWarnings("unchecked")
-// public <T> T read(final InputStream src, final String format, final Class<T> reference) {
-// Object res;
-//
-// try {
-// if (ODataEntitySetIterator.class.isAssignableFrom(reference)) {
-// res = new ODataEntitySetIterator(client, src, ODataPubFormat.fromString(format));
-// } else if (ODataEntitySet.class.isAssignableFrom(reference)) {
-// res = readEntitySet(src, ODataPubFormat.fromString(format));
-// } else if (ODataEntity.class.isAssignableFrom(reference)) {
-// res = readEntity(src, ODataPubFormat.fromString(format));
-// } else if (ODataProperty.class.isAssignableFrom(reference)) {
-// res = readProperty(src, ODataFormat.fromString(format));
-// } else if (ODataLinkCollection.class.isAssignableFrom(reference)) {
-// res = readLinks(src, ODataFormat.fromString(format));
-// } else if (ODataValue.class.isAssignableFrom(reference)) {
-// res = client.getPrimitiveValueBuilder().
-// setType(ODataValueFormat.fromString(format) == ODataValueFormat.TEXT
-// ? EdmSimpleType.String : EdmSimpleType.Stream).
-// setText(IOUtils.toString(src)).
-// build();
-// } else if (AbstractEdmMetadata.class.isAssignableFrom(reference)) {
-// res = readMetadata(src);
-// } else if (ODataServiceDocument.class.isAssignableFrom(reference)) {
-// res = readServiceDocument(src, ODataFormat.fromString(format));
-// } else if (ODataError.class.isAssignableFrom(reference)) {
-// res = readError(src, !format.toString().contains("json"));
-// } else {
-// throw new IllegalArgumentException("Invalid reference type " + reference);
-// }
-// } catch (Exception e) {
-// LOG.warn("Cast error", e);
-// res = null;
-// } finally {
-// if (!ODataEntitySetIterator.class.isAssignableFrom(reference)) {
-// IOUtils.closeQuietly(src);
-// }
-// }
-//
-// return (T) res;
-// }
-}
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/op/impl/AbstractODataSerializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataSerializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataSerializer.java
deleted file mode 100644
index 523d8b4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/AbstractODataSerializer.java
+++ /dev/null
@@ -1,160 +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.op.impl;
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.op.ODataSerializer;
-import org.apache.olingo.odata4.client.core.xml.XMLParser;
-import org.w3c.dom.Node;
-
-public abstract class AbstractODataSerializer extends AbstractJacksonTool implements ODataSerializer {
-
- private static final long serialVersionUID = -357777648541325363L;
-
-// private final AtomSerializer atomSerializer;
- public AbstractODataSerializer(final ODataClient client) {
- super(client);
-// this.atomSerializer = new AtomSerializer(client);
- }
-
-// @Override
-// public <T extends Feed> void feed(final T obj, final OutputStream out) {
-// feed(obj, new OutputStreamWriter(out));
-// }
-//
-// @Override
-// public <T extends Feed> void feed(final T obj, final Writer writer) {
-// if (obj instanceof AtomFeed) {
-// atom((AtomFeed) obj, writer);
-// } else {
-// json((JSONFeed) obj, writer);
-// }
-// }
-//
-// @Override
-// public <T extends Entry> void entry(final T obj, final OutputStream out) {
-// entry(obj, new OutputStreamWriter(out));
-// }
-//
-// @Override
-// public <T extends Entry> void entry(final T obj, final Writer writer) {
-// if (obj instanceof AtomEntry) {
-// atom((AtomEntry) obj, writer);
-// } else {
-// json((JSONEntry) obj, writer);
-// }
-// }
-//
-// @Override
-// public void property(final Element element, final ODataFormat format, final OutputStream out) {
-// property(element, format, new OutputStreamWriter(out));
-// }
-//
-// @Override
-// public void property(final Element element, final ODataFormat format, final Writer writer) {
-// if (format == ODataFormat.XML) {
-// dom(element, writer);
-// } else {
-// json(element, writer);
-// }
-// }
-//
-// @Override
-// public void link(final ODataLink link, final ODataFormat format, final OutputStream out) {
-// link(link, format, new OutputStreamWriter(out));
-// }
-//
-// @Override
-// public void link(final ODataLink link, final ODataFormat format, final Writer writer) {
-// if (format == ODataFormat.XML) {
-// xmlLink(link, writer);
-// } else {
-// jsonLink(link, writer);
-// }
-// }
-//
- @Override
- public void dom(final Node content, final OutputStream out) {
- dom(content, new OutputStreamWriter(out));
- }
-
- @Override
- public void dom(final Node content, final Writer writer) {
- XMLParser.PARSER.serialize(content, writer);
- }
-//
-// /*
-// * ------------------ Protected methods ------------------
-// */
-// protected <T extends AbstractPayloadObject> void atom(final T obj, final Writer writer) {
-// try {
-// dom(atomSerializer.serialize(obj), writer);
-// } catch (Exception e) {
-// throw new IllegalArgumentException("While serializing Atom object", e);
-// }
-// }
-//
-// protected <T extends AbstractPayloadObject> void json(final T obj, final Writer writer) {
-// try {
-// getObjectMapper().writeValue(writer, obj);
-// } catch (IOException e) {
-// throw new IllegalArgumentException("While serializing JSON object", e);
-// }
-// }
-//
-// protected void json(final Element element, final Writer writer) {
-// try {
-// final JSONProperty property = new JSONProperty();
-// property.setContent(element);
-// getObjectMapper().writeValue(writer, property);
-// } catch (IOException e) {
-// throw new IllegalArgumentException("While serializing JSON property", e);
-// }
-// }
-//
-// protected void xmlLink(final ODataLink link, final Writer writer) {
-// try {
-// final DocumentBuilder builder = XMLUtils.DOC_BUILDER_FACTORY.newDocumentBuilder();
-// final Document doc = builder.newDocument();
-// final Element uri = doc.createElementNS(
-// client.getWorkingVersion().getNamespaceMap().get(ODataVersion.NS_DATASERVICES),
-// ODataConstants.ELEM_URI);
-// uri.appendChild(doc.createTextNode(link.getLink().toASCIIString()));
-//
-// dom(uri, writer);
-// } catch (Exception e) {
-// throw new IllegalArgumentException("While serializing XML link", e);
-// }
-// }
-//
-// protected void jsonLink(final ODataLink link, final Writer writer) {
-// final ObjectMapper mapper = getObjectMapper();
-// final ObjectNode uri = mapper.createObjectNode();
-// uri.put(ODataConstants.JSON_URL, link.getLink().toASCIIString());
-//
-// try {
-// mapper.writeValue(writer, uri);
-// } catch (Exception e) {
-// throw new IllegalArgumentException("While serializing JSON link", e);
-// }
-// }
-}
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/op/impl/ComplexTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ComplexTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ComplexTypeDeserializer.java
deleted file mode 100644
index 1ceca91..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ComplexTypeDeserializer.java
+++ /dev/null
@@ -1,81 +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.op.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractComplexType;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public class ComplexTypeDeserializer extends AbstractEdmDeserializer<AbstractComplexType> {
-
- @Override
- protected AbstractComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractComplexType complexType = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.ComplexTypeImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.ComplexTypeImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- complexType.setName(jp.nextTextValue());
- } else if ("Abstract".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
- setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("BaseType".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
- setBaseType(jp.nextTextValue());
- } else if ("OpenType".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
- setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Property".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (complexType instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.ComplexTypeImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.ComplexTypeImpl) complexType).
- getProperties().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
- getProperties().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.PropertyImpl.class));
- }
- } else if ("NavigationProperty".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
- getNavigationProperties().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.NavigationPropertyImpl.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
- setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return complexType;
- }
-}
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/op/impl/EntityContainerDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntityContainerDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntityContainerDeserializer.java
deleted file mode 100644
index 92be399..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntityContainerDeserializer.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 org.apache.olingo.odata4.client.core.op.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntityContainer;
-import org.apache.olingo.odata4.client.core.edm.xml.v3.AssociationSetImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.ActionImportImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.SingletonImpl;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-@SuppressWarnings("rawtypes")
-public class EntityContainerDeserializer extends AbstractEdmDeserializer<AbstractEntityContainer> {
-
- @Override
- protected AbstractEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractEntityContainer entityContainer = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.EntityContainerImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.EntityContainerImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- entityContainer.setName(jp.nextTextValue());
- } else if ("Extends".equals(jp.getCurrentName())) {
- entityContainer.setExtends(jp.nextTextValue());
- } else if ("LazyLoadingEnabled".equals(jp.getCurrentName())) {
- entityContainer.setLazyLoadingEnabled(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("IsDefaultEntityContainer".equals(jp.getCurrentName())) {
- entityContainer.setDefaultEntityContainer(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("EntitySet".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (entityContainer instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.EntityContainerImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.EntityContainerImpl) entityContainer).
- getEntitySets().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.EntitySetImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
- getEntitySets().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.EntitySetImpl.class));
- }
- } else if ("AssociationSet".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.EntityContainerImpl) entityContainer).
- getAssociationSets().add(jp.readValueAs(AssociationSetImpl.class));
- } else if ("Singleton".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
- getSingletons().add(jp.readValueAs(SingletonImpl.class));
- } else if ("ActionImport".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
- getActionImports().add(jp.readValueAs(ActionImportImpl.class));
- } else if ("FunctionImport".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (entityContainer instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.EntityContainerImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.EntityContainerImpl) entityContainer).
- getFunctionImports().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.FunctionImportImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
- getFunctionImports().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.FunctionImportImpl.class));
- }
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
- setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return entityContainer;
- }
-}
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/op/impl/EntityKeyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntityKeyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntityKeyDeserializer.java
deleted file mode 100644
index dd26a97..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntityKeyDeserializer.java
+++ /dev/null
@@ -1,48 +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.op.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.olingo.odata4.client.core.edm.xml.EntityKeyImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.PropertyRefImpl;
-
-public class EntityKeyDeserializer extends AbstractEdmDeserializer<EntityKeyImpl> {
-
- @Override
- protected EntityKeyImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final EntityKeyImpl entityKey = new EntityKeyImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
-
- if (token == JsonToken.FIELD_NAME && "PropertyRef".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityKey.getPropertyRefs().add(jp.readValueAs( PropertyRefImpl.class));
- }
- }
-
- return entityKey;
- }
-}
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/op/impl/EntitySetDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntitySetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntitySetDeserializer.java
deleted file mode 100644
index a5fa924..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntitySetDeserializer.java
+++ /dev/null
@@ -1,68 +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.op.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntitySet;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.NavigationPropertyBindingImpl;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public class EntitySetDeserializer extends AbstractEdmDeserializer<AbstractEntitySet> {
-
- @Override
- protected AbstractEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractEntitySet entitySet = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.EntitySetImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.EntitySetImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- entitySet.setName(jp.nextTextValue());
- } else if ("EntityType".equals(jp.getCurrentName())) {
- entitySet.setEntityType(jp.nextTextValue());
- } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntitySetImpl) entitySet).
- setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntitySetImpl) entitySet).
- getNavigationPropertyBindings().add(
- jp.readValueAs(NavigationPropertyBindingImpl.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntitySetImpl) entitySet).
- setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return entitySet;
- }
-
-}
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/op/impl/EntityTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntityTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntityTypeDeserializer.java
deleted file mode 100644
index 610b751..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EntityTypeDeserializer.java
+++ /dev/null
@@ -1,90 +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.op.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntityType;
-import org.apache.olingo.odata4.client.core.edm.xml.EntityKeyImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public class EntityTypeDeserializer extends AbstractEdmDeserializer<AbstractEntityType> {
-
- @Override
- protected AbstractEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractEntityType entityType = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.EntityTypeImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.EntityTypeImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- entityType.setName(jp.nextTextValue());
- } else if ("Abstract".equals(jp.getCurrentName())) {
- entityType.setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("BaseType".equals(jp.getCurrentName())) {
- entityType.setBaseType(jp.nextTextValue());
- } else if ("OpenType".equals(jp.getCurrentName())) {
- entityType.setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("HasStream".equals(jp.getCurrentName())) {
- entityType.setHasStream(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Key".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityType.setKey(jp.readValueAs(EntityKeyImpl.class));
- } else if ("Property".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (entityType instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.EntityTypeImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.EntityTypeImpl) entityType).
- getProperties().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntityTypeImpl) entityType).
- getProperties().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.PropertyImpl.class));
- }
- } else if ("NavigationProperty".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (entityType instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.EntityTypeImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.EntityTypeImpl) entityType).
- getNavigationProperties().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.NavigationPropertyImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntityTypeImpl) entityType).
- getNavigationProperties().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.NavigationPropertyImpl.class));
- }
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EntityTypeImpl) entityType).
- setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return entityType;
- }
-}
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/op/impl/EnumTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EnumTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EnumTypeDeserializer.java
deleted file mode 100644
index 086d99c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/EnumTypeDeserializer.java
+++ /dev/null
@@ -1,71 +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.op.impl;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEnumType;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public class EnumTypeDeserializer extends AbstractEdmDeserializer<AbstractEnumType> {
-
- @Override
- protected AbstractEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractEnumType enumType = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.EnumTypeImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.EnumTypeImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- enumType.setName(jp.nextTextValue());
- } else if ("UnderlyingType".equals(jp.getCurrentName())) {
- enumType.setUnderlyingType(jp.nextTextValue());
- } else if ("IsFlags".equals(jp.getCurrentName())) {
- enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Member".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (enumType instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.EnumTypeImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.EnumTypeImpl) enumType).
- getMembers().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.MemberImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EnumTypeImpl) enumType).
- getMembers().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.MemberImpl.class));
- }
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EnumTypeImpl) enumType).
- setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return enumType;
- }
-}
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/op/impl/InjectableSerializerProvider.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/InjectableSerializerProvider.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/InjectableSerializerProvider.java
deleted file mode 100644
index fc37c83..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/InjectableSerializerProvider.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.op.impl;
-
-import com.fasterxml.jackson.databind.SerializationConfig;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;
-import com.fasterxml.jackson.databind.ser.SerializerFactory;
-
-class InjectableSerializerProvider extends DefaultSerializerProvider {
-
- private static final long serialVersionUID = 3432260063063739646L;
-
- public InjectableSerializerProvider(
- final SerializerProvider src, final SerializationConfig config, final SerializerFactory factory) {
-
- super(src, config, factory);
- }
-
- @Override
- public InjectableSerializerProvider createInstance(
- final SerializationConfig config, final SerializerFactory factory) {
-
- return 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/op/impl/ODataV3BinderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3BinderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3BinderImpl.java
deleted file mode 100644
index b470709..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3BinderImpl.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.op.impl;
-
-import org.apache.olingo.odata4.client.core.ODataV3ClientImpl;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractODataBinder;
-
-public class ODataV3BinderImpl extends AbstractODataBinder {
-
- private static final long serialVersionUID = 8970843539708952308L;
-
- public ODataV3BinderImpl(final ODataV3ClientImpl client) {
- super(client);
- }
-
-// @Override
-// protected EdmType newEdmType(final String expression) {
-// return new EdmV3Type(expression);
-// }
-
-}
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/op/impl/ODataV3DeserializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3DeserializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3DeserializerImpl.java
deleted file mode 100644
index a16f03e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3DeserializerImpl.java
+++ /dev/null
@@ -1,69 +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.op.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.apache.olingo.odata4.client.api.op.ODataV3Deserializer;
-import org.apache.olingo.odata4.client.core.data.v3.JSONServiceDocumentImpl;
-import org.apache.olingo.odata4.client.core.data.v4.XMLServiceDocumentImpl;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractODataDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v3.EdmxImpl;
-import org.apache.olingo.odata4.client.core.edm.xml.v3.XMLMetadataImpl;
-
-public class ODataV3DeserializerImpl extends AbstractODataDeserializer implements ODataV3Deserializer {
-
- private static final long serialVersionUID = -8221085862548914611L;
-
- public ODataV3DeserializerImpl(final ODataClient client) {
- super(client);
- }
-
- @Override
- public XMLMetadataImpl toMetadata(final InputStream input) {
- try {
- return new XMLMetadataImpl(getXmlMapper().readValue(input, EdmxImpl.class));
- } catch (Exception e) {
- throw new IllegalArgumentException("Could not parse as Edmx document", e);
- }
- }
-
- @Override
- public ServiceDocument toServiceDocument(final InputStream input, final ODataFormat format) {
- try {
- return format == ODataFormat.XML
- ? getXmlMapper().readValue(input, XMLServiceDocumentImpl.class)
- : getObjectMapper().readValue(input, JSONServiceDocumentImpl.class);
- } catch (IOException e) {
- throw new IllegalArgumentException("Could not parse Service Document", e);
- }
- }
-
-// @Override
-// protected JSONEntry toJSONEntry(final InputStream input) {
-// try {
-// return getObjectMapper().readValue(input, JSONEntry.class);
-// } catch (IOException e) {
-// throw new IllegalArgumentException("While deserializing JSON entry", e);
-// }
-// }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3ReaderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3ReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3ReaderImpl.java
deleted file mode 100644
index 8e2991b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3ReaderImpl.java
+++ /dev/null
@@ -1,47 +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.op.impl;
-
-import java.io.InputStream;
-import org.apache.olingo.odata4.client.api.domain.ODataServiceDocument;
-import org.apache.olingo.odata4.client.api.format.ODataFormat;
-import org.apache.olingo.odata4.client.core.ODataV3ClientImpl;
-import org.apache.olingo.odata4.client.core.edm.EdmClientImpl;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractODataReader;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-
-public class ODataV3ReaderImpl extends AbstractODataReader {
-
- private static final long serialVersionUID = -2481293269536406956L;
-
- public ODataV3ReaderImpl(final ODataV3ClientImpl client) {
- super(client);
- }
-
- @Override
- public Edm readMetadata(final InputStream input) {
- return new EdmClientImpl(client.getDeserializer().toMetadata(input));
- }
-
- @Override
- public ODataServiceDocument readServiceDocument(final InputStream input, final ODataFormat format) {
- return ((ODataV3ClientImpl) client).getBinder().getODataServiceDocument(
- ((ODataV3ClientImpl) client).getDeserializer().toServiceDocument(input, format));
- }
-}
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/op/impl/ODataV3SerializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3SerializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3SerializerImpl.java
deleted file mode 100644
index 76f6b8f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV3SerializerImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.op.impl;
-
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractODataSerializer;
-
-public class ODataV3SerializerImpl extends AbstractODataSerializer {
-
- private static final long serialVersionUID = -8861908250297989806L;
-
- public ODataV3SerializerImpl(final ODataClient client) {
- super(client);
- }
-
-}
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/op/impl/ODataV4BinderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4BinderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4BinderImpl.java
deleted file mode 100644
index a9164b9..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/op/impl/ODataV4BinderImpl.java
+++ /dev/null
@@ -1,62 +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.op.impl;
-
-import org.apache.olingo.odata4.client.api.data.ServiceDocument;
-import org.apache.olingo.odata4.client.api.data.ServiceDocumentItem;
-import org.apache.olingo.odata4.client.api.domain.ODataServiceDocument;
-import org.apache.olingo.odata4.client.core.ODataV4ClientImpl;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractODataBinder;
-import org.apache.olingo.odata4.client.core.uri.URIUtils;
-
-public class ODataV4BinderImpl extends AbstractODataBinder {
-
- private static final long serialVersionUID = -6371110655960799393L;
-
- public ODataV4BinderImpl(final ODataV4ClientImpl client) {
- super(client);
- }
-
-// @Override
-// protected EdmType newEdmType(final String expression) {
-// return new EdmV4Type(expression);
-// }
- @Override
- public ODataServiceDocument getODataServiceDocument(final ServiceDocument resource) {
- final ODataServiceDocument serviceDocument = super.getODataServiceDocument(resource);
-
- serviceDocument.setMetadataContext(URIUtils.getURI(resource.getBaseURI(), resource.getMetadataContext()));
- serviceDocument.setMetadataETag(resource.getMetadataETag());
-
- for (ServiceDocumentItem functionImport : resource.getFunctionImports()) {
- serviceDocument.getFunctionImports().put(functionImport.getTitle(),
- URIUtils.getURI(resource.getBaseURI(), functionImport.getHref()));
- }
- for (ServiceDocumentItem singleton : resource.getSingletons()) {
- serviceDocument.getSingletons().put(singleton.getTitle(),
- URIUtils.getURI(resource.getBaseURI(), singleton.getHref()));
- }
- for (ServiceDocumentItem sdoc : resource.getRelatedServiceDocuments()) {
- serviceDocument.getRelatedServiceDocuments().put(sdoc.getTitle(),
- URIUtils.getURI(resource.getBaseURI(), sdoc.getHref()));
- }
-
- return serviceDocument;
- }
-}
[42/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V4FilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V4FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V4FilterArgFactory.java
deleted file mode 100644
index acf9c5c..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V4FilterArgFactory.java
+++ /dev/null
@@ -1,55 +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.api.uri.filter;
-
-public interface V4FilterArgFactory extends FilterArgFactory {
-
- FilterArg contains(FilterArg first, FilterArg second);
-
- FilterArg fractionalseconds(FilterArg param);
-
- FilterArg date(FilterArg param);
-
- FilterArg time(FilterArg param);
-
- FilterArg totaloffsetminutes(FilterArg param);
-
- FilterArg now();
-
- FilterArg mindatetime();
-
- FilterArg maxdatetime();
-
- FilterArg totalseconds(FilterArg param);
-
- FilterArg cast(FilterArg type);
-
- FilterArg cast(FilterArg expression, FilterArg type);
-
- FilterArg geoDistance(FilterArg first, FilterArg second);
-
- FilterArg geoIntersects(FilterArg first, FilterArg second);
-
- FilterArg geoLength(FilterArg first, FilterArg second);
-
- FilterArg any(FilterArg collection, URIFilter expression);
-
- FilterArg all(FilterArg collection, URIFilter expression);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V4FilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V4FilterFactory.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V4FilterFactory.java
deleted file mode 100644
index 0328774..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/uri/filter/V4FilterFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.uri.filter;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-
-public interface V4FilterFactory extends FilterFactory {
-
- @Override
- V4FilterArgFactory getArgFactory();
-
- URIFilter has(String key, EdmEnumType enumType, String memberName);
-
- URIFilter has(FilterArg left, EdmEnumType enumType, String memberName);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/utils/EdmTypeInfo.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/utils/EdmTypeInfo.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/utils/EdmTypeInfo.java
deleted file mode 100644
index 33dd468..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/utils/EdmTypeInfo.java
+++ /dev/null
@@ -1,81 +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.api.utils;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class EdmTypeInfo {
-
- private final String typeExpression;
-
- private final boolean collection;
-
- private final FullQualifiedName fullQualifiedName;
-
- public EdmTypeInfo(final String typeExpression, final String defaultNamespace) {
- this(typeExpression.indexOf('.') == -1
- ? defaultNamespace + "." + typeExpression
- : typeExpression);
- }
-
- public EdmTypeInfo(final String typeExpression) {
- this.typeExpression = typeExpression;
-
- String baseType;
- final int collStartIdx = typeExpression.indexOf("Collection(");
- final int collEndIdx = typeExpression.lastIndexOf(')');
- if (collStartIdx == -1) {
- baseType = typeExpression;
- this.collection = false;
- } else {
- if (collEndIdx == -1) {
- throw new IllegalArgumentException("Malformed type: " + typeExpression);
- }
-
- this.collection = true;
- baseType = typeExpression.substring(collStartIdx + 11, collEndIdx);
- }
-
- final int lastDotIdx = baseType.lastIndexOf('.');
- if (lastDotIdx == -1) {
- throw new IllegalArgumentException("Cannot find namespace or alias in " + typeExpression);
- }
- final String namespace = baseType.substring(0, lastDotIdx);
- final String typeName = baseType.substring(lastDotIdx + 1);
- if (StringUtils.isBlank(typeName)) {
- throw new IllegalArgumentException("Null or empty type name in " + typeExpression);
- }
-
- this.fullQualifiedName = new FullQualifiedName(namespace, typeName);
- }
-
- public String getTypeExpression() {
- return typeExpression;
- }
-
- public boolean isCollection() {
- return collection;
- }
-
- public FullQualifiedName getFullQualifiedName() {
- return fullQualifiedName;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/utils/XMLUtils.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/utils/XMLUtils.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/utils/XMLUtils.java
deleted file mode 100644
index e1d580a..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/utils/XMLUtils.java
+++ /dev/null
@@ -1,176 +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.api.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.odata4.client.api.Constants;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-import org.apache.olingo.odata4.client.api.domain.geospatial.Geospatial;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * XML utilities.
- */
-public final class XMLUtils {
-
- /**
- * DOM factory.
- */
- public static final DocumentBuilderFactory DOC_BUILDER_FACTORY = DocumentBuilderFactory.newInstance();
-
- private XMLUtils() {
- // Empty private constructor for static utility classes
- }
-
- /**
- * Gets XML node name.
- *
- * @param node node.
- * @return node name.
- */
- public static String getSimpleName(final Node node) {
- return node.getLocalName() == null
- ? node.getNodeName().substring(node.getNodeName().indexOf(':') + 1)
- : node.getLocalName();
- }
-
- /**
- * Gets the given node's children of the given type.
- *
- * @param node parent.
- * @param nodetype searched child type.
- * @return children.
- */
- public static List<Node> getChildNodes(final Node node, final short nodetype) {
- final List<Node> result = new ArrayList<Node>();
-
- final NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- final Node child = children.item(i);
- if (child.getNodeType() == nodetype) {
- result.add(child);
- }
- }
-
- return result;
- }
-
- /**
- * Gets the given node's children with the given name.
- *
- * @param node parent.
- * @param name searched child name.
- * @return children.
- */
- public static List<Element> getChildElements(final Element node, final String name) {
- final List<Element> result = new ArrayList<Element>();
-
- if (StringUtils.isNotBlank(name)) {
- final NodeList children = node.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- final Node child = children.item(i);
- if ((child instanceof Element) && name.equals(child.getNodeName())) {
- result.add((Element) child);
- }
- }
- }
-
- return result;
- }
-
- /**
- * Checks if the given node has <tt>element</tt> children.
- *
- * @param node parent.
- * @return 'TRUE' if the given node has at least one <tt>element</tt> child; 'FALSE' otherwise.
- */
- public static boolean hasElementsChildNode(final Node node) {
- boolean found = false;
-
- for (Node child : getChildNodes(node, Node.ELEMENT_NODE)) {
- if (Constants.ELEM_ELEMENT.equals(XMLUtils.getSimpleName(child))) {
- found = true;
- }
- }
-
- return found;
- }
-
- /**
- * Checks if the given node has only text children.
- *
- * @param node parent.
- * @return 'TRUE' if the given node has only text children; 'FALSE' otherwise.
- */
- public static boolean hasOnlyTextChildNodes(final Node node) {
- boolean result = true;
- final NodeList children = node.getChildNodes();
- for (int i = 0; result && i < children.getLength(); i++) {
- final Node child = children.item(i);
- if (child.getNodeType() != Node.TEXT_NODE) {
- result = false;
- }
- }
-
- return result;
- }
-
- public static EdmSimpleType simpleTypeForNode(final Geospatial.Dimension dimension, final Node node) {
- EdmSimpleType type = null;
-
- if (Constants.ELEM_POINT.equals(node.getNodeName())) {
- type = dimension == Geospatial.Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyPoint
- : EdmSimpleType.GeometryPoint;
- } else if (Constants.ELEM_MULTIPOINT.equals(node.getNodeName())) {
- type = dimension == Geospatial.Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyMultiPoint
- : EdmSimpleType.GeometryMultiPoint;
- } else if (Constants.ELEM_LINESTRING.equals(node.getNodeName())) {
- type = dimension == Geospatial.Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyLineString
- : EdmSimpleType.GeometryLineString;
- } else if (Constants.ELEM_MULTILINESTRING.equals(node.getNodeName())) {
- type = dimension == Geospatial.Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyMultiLineString
- : EdmSimpleType.GeometryMultiLineString;
- } else if (Constants.ELEM_POLYGON.equals(node.getNodeName())) {
- type = dimension == Geospatial.Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyPolygon
- : EdmSimpleType.GeometryPolygon;
- } else if (Constants.ELEM_MULTIPOLYGON.equals(node.getNodeName())) {
- type = dimension == Geospatial.Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyMultiPolygon
- : EdmSimpleType.GeometryMultiPolygon;
- } else if (Constants.ELEM_GEOCOLLECTION.equals(node.getNodeName())
- || Constants.ELEM_GEOMEMBERS.equals(node.getNodeName())) {
-
- type = dimension == Geospatial.Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyCollection
- : EdmSimpleType.GeometryCollection;
- }
-
- return type;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/AbstractConfiguration.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/AbstractConfiguration.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/AbstractConfiguration.java
new file mode 100644
index 0000000..78d0e9e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/AbstractConfiguration.java
@@ -0,0 +1,198 @@
+/*
+ * 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;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.apache.olingo.client.api.Configuration;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.client.api.format.ODataMediaFormat;
+import org.apache.olingo.client.api.format.ODataPubFormat;
+import org.apache.olingo.client.api.format.ODataValueFormat;
+import org.apache.olingo.client.api.http.HttpClientFactory;
+import org.apache.olingo.client.api.http.HttpUriRequestFactory;
+import org.apache.olingo.client.core.http.DefaultHttpClientFactory;
+import org.apache.olingo.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/client/core/AbstractODataClient.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/AbstractODataClient.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/AbstractODataClient.java
new file mode 100644
index 0000000..35bb385
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/AbstractODataClient.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;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.domain.ODataGeospatialValue;
+import org.apache.olingo.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/client/core/ODataClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java
new file mode 100644
index 0000000..f45b725
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.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;
+
+import org.apache.olingo.client.api.ODataV3Client;
+import org.apache.olingo.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/client/core/ODataV3ClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataV3ClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataV3ClientImpl.java
new file mode 100644
index 0000000..70ed75a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataV3ClientImpl.java
@@ -0,0 +1,146 @@
+/*
+ * 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;
+
+import org.apache.olingo.client.api.ODataV3Client;
+import org.apache.olingo.client.api.V3Configuration;
+import org.apache.olingo.client.api.op.ODataBinder;
+import org.apache.olingo.client.api.op.ODataReader;
+import org.apache.olingo.client.api.op.ODataSerializer;
+import org.apache.olingo.client.api.op.ODataV3Deserializer;
+import org.apache.olingo.client.api.uri.V3URIBuilder;
+import org.apache.olingo.client.api.uri.filter.V3FilterFactory;
+import org.apache.olingo.client.core.op.impl.ODataV3BinderImpl;
+import org.apache.olingo.client.core.op.impl.ODataV3DeserializerImpl;
+import org.apache.olingo.client.core.op.impl.ODataV3ReaderImpl;
+import org.apache.olingo.client.core.op.impl.ODataV3SerializerImpl;
+import org.apache.olingo.client.core.uri.V3URIBuilderImpl;
+import org.apache.olingo.client.core.uri.filter.V3FilterFactoryImpl;
+import org.apache.olingo.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/client/core/ODataV4ClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataV4ClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataV4ClientImpl.java
new file mode 100644
index 0000000..c3c5e14
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataV4ClientImpl.java
@@ -0,0 +1,146 @@
+/*
+ * 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;
+
+import org.apache.olingo.client.api.ODataV4Client;
+import org.apache.olingo.client.api.V4Configuration;
+import org.apache.olingo.client.api.op.ODataBinder;
+import org.apache.olingo.client.api.op.ODataReader;
+import org.apache.olingo.client.api.op.ODataSerializer;
+import org.apache.olingo.client.api.op.ODataV4Deserializer;
+import org.apache.olingo.client.api.uri.V4URIBuilder;
+import org.apache.olingo.client.api.uri.filter.V4FilterFactory;
+import org.apache.olingo.client.core.op.impl.ODataV4BinderImpl;
+import org.apache.olingo.client.core.op.impl.ODataV4DeserializerImpl;
+import org.apache.olingo.client.core.op.impl.ODataV4ReaderImpl;
+import org.apache.olingo.client.core.op.impl.ODataV4SerializerImpl;
+import org.apache.olingo.client.core.uri.V4URIBuilderImpl;
+import org.apache.olingo.client.core.uri.filter.V4FilterFactoryImpl;
+import org.apache.olingo.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/client/core/V3ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/V3ConfigurationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/V3ConfigurationImpl.java
new file mode 100644
index 0000000..3844794
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/V3ConfigurationImpl.java
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+import org.apache.olingo.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/client/core/V4ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/V4ConfigurationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/V4ConfigurationImpl.java
new file mode 100644
index 0000000..11c579e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/V4ConfigurationImpl.java
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+import org.apache.olingo.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/client/core/data/AbstractServiceDocument.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/AbstractServiceDocument.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/AbstractServiceDocument.java
new file mode 100644
index 0000000..57ba0ef
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/AbstractServiceDocument.java
@@ -0,0 +1,146 @@
+/*
+ * 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.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.client.api.data.ServiceDocument;
+import org.apache.olingo.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/client/core/data/JSONServiceDocumentDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/JSONServiceDocumentDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/JSONServiceDocumentDeserializer.java
new file mode 100644
index 0000000..10f5664
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/JSONServiceDocumentDeserializer.java
@@ -0,0 +1,84 @@
+/*
+ * 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.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.client.api.ODataConstants;
+import org.apache.olingo.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.client.core.data.v3.JSONServiceDocumentImpl()
+ : new org.apache.olingo.client.core.data.v4.JSONServiceDocumentImpl();
+
+ if (tree.hasNonNull(ODataConstants.JSON_METADATA)
+ && serviceDocument instanceof org.apache.olingo.client.core.data.v3.JSONServiceDocumentImpl) {
+
+ ((org.apache.olingo.client.core.data.v3.JSONServiceDocumentImpl) serviceDocument).
+ setMetadata(tree.get(ODataConstants.JSON_METADATA).textValue());
+ }
+ if (tree.hasNonNull(ODataConstants.JSON_CONTEXT)
+ && serviceDocument instanceof org.apache.olingo.client.core.data.v4.JSONServiceDocumentImpl) {
+
+ ((org.apache.olingo.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/client/core/data/ODataJacksonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/ODataJacksonDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/ODataJacksonDeserializer.java
new file mode 100644
index 0000000..7ed323e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/ODataJacksonDeserializer.java
@@ -0,0 +1,45 @@
+/*
+ * 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.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.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/client/core/data/ODataJacksonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/ODataJacksonSerializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/ODataJacksonSerializer.java
new file mode 100644
index 0000000..7802116
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/ODataJacksonSerializer.java
@@ -0,0 +1,45 @@
+/*
+ * 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.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.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/client/core/data/ServiceDocumentItemImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/ServiceDocumentItemImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/ServiceDocumentItemImpl.java
new file mode 100644
index 0000000..57d5840
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/ServiceDocumentItemImpl.java
@@ -0,0 +1,79 @@
+/*
+ * 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.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.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/client/core/data/XMLServiceDocumentDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/XMLServiceDocumentDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/XMLServiceDocumentDeserializer.java
new file mode 100644
index 0000000..da2017f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/XMLServiceDocumentDeserializer.java
@@ -0,0 +1,120 @@
+/*
+ * 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.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.client.api.data.ServiceDocument;
+import org.apache.olingo.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.client.core.data.v3.XMLServiceDocumentImpl()
+ : new org.apache.olingo.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.client.core.data.v3.XMLServiceDocumentImpl) {
+ ((org.apache.olingo.client.core.data.v3.XMLServiceDocumentImpl) sdoc).
+ setBaseURI(URI.create(jp.nextTextValue()));
+ } else {
+ ((org.apache.olingo.client.core.data.v4.XMLServiceDocumentImpl) sdoc).
+ setBaseURI(URI.create(jp.nextTextValue()));
+ }
+ } else if ("context".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.data.v4.XMLServiceDocumentImpl) sdoc).
+ setMetadataContext(jp.nextTextValue());
+ } else if ("metadata-etag".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.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/client/core/data/v3/JSONServiceDocumentImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v3/JSONServiceDocumentImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v3/JSONServiceDocumentImpl.java
new file mode 100644
index 0000000..659e91c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v3/JSONServiceDocumentImpl.java
@@ -0,0 +1,67 @@
+/*
+ * 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.data.v3;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.net.URI;
+
+import org.apache.olingo.client.api.uri.SegmentType;
+import org.apache.olingo.client.core.data.AbstractServiceDocument;
+import org.apache.olingo.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/client/core/data/v3/XMLServiceDocumentImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v3/XMLServiceDocumentImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v3/XMLServiceDocumentImpl.java
new file mode 100644
index 0000000..682f500
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v3/XMLServiceDocumentImpl.java
@@ -0,0 +1,48 @@
+/*
+ * 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.data.v3;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.net.URI;
+
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.core.data.AbstractServiceDocument;
+import org.apache.olingo.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/client/core/data/v4/AbstractServiceDocument.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v4/AbstractServiceDocument.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v4/AbstractServiceDocument.java
new file mode 100644
index 0000000..47f294f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v4/AbstractServiceDocument.java
@@ -0,0 +1,89 @@
+/*
+ * 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.data.v4;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.data.ServiceDocumentItem;
+
+public abstract class AbstractServiceDocument
+ extends org.apache.olingo.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/client/core/data/v4/JSONServiceDocumentImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v4/JSONServiceDocumentImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v4/JSONServiceDocumentImpl.java
new file mode 100644
index 0000000..23ed64c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v4/JSONServiceDocumentImpl.java
@@ -0,0 +1,43 @@
+/*
+ * 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.data.v4;
+
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.api.uri.SegmentType;
+import org.apache.olingo.client.core.data.JSONServiceDocumentDeserializer;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.net.URI;
+
+@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/client/core/data/v4/XMLServiceDocumentImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v4/XMLServiceDocumentImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v4/XMLServiceDocumentImpl.java
new file mode 100644
index 0000000..2885658
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/v4/XMLServiceDocumentImpl.java
@@ -0,0 +1,29 @@
+/*
+ * 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.data.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.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/client/core/deserializer/AnnotationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/AnnotationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/AnnotationPropertyImpl.java
new file mode 100644
index 0000000..3ee57a6
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/AnnotationPropertyImpl.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.deserializer;
+
+import org.apache.olingo.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/client/core/deserializer/ComplexValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/ComplexValueImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/ComplexValueImpl.java
new file mode 100644
index 0000000..eda1e34
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/ComplexValueImpl.java
@@ -0,0 +1,82 @@
+/*
+ * 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.deserializer;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.olingo.client.api.deserializer.AnnotationProperty;
+import org.apache.olingo.client.api.deserializer.ComplexValue;
+import org.apache.olingo.client.api.deserializer.NavigationProperty;
+import org.apache.olingo.client.api.deserializer.StructuralProperty;
+import org.apache.olingo.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/client/core/deserializer/EntityImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntityImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntityImpl.java
new file mode 100644
index 0000000..ac88bf3
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntityImpl.java
@@ -0,0 +1,126 @@
+/*
+ * 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.deserializer;
+
+import java.util.Map;
+
+import org.apache.olingo.client.api.deserializer.AnnotationProperty;
+import org.apache.olingo.client.api.deserializer.Entity;
+import org.apache.olingo.client.api.deserializer.NavigationProperty;
+import org.apache.olingo.client.api.deserializer.Property;
+import org.apache.olingo.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();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntitySetBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntitySetBuilder.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntitySetBuilder.java
new file mode 100644
index 0000000..879622a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntitySetBuilder.java
@@ -0,0 +1,72 @@
+/*
+ * 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.deserializer;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.api.deserializer.EntitySet;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+
+public class EntitySetBuilder {
+
+ private final JsonParser parser;
+
+ public EntitySetBuilder(final JsonParser jp) {
+ parser = jp;
+ }
+
+ public EntitySet buildEntitySet() throws JsonParseException, IOException {
+ return parseEntitySet(parser);
+ }
+
+ private EntitySet parseEntitySet(final JsonParser jp) throws JsonParseException, IOException {
+ final EntitySetImpl entitySet = new EntitySetImpl();
+ boolean arrayStarted = false;
+
+ while (jp.nextToken() != null) {
+ final JsonToken token = jp.getCurrentToken();
+ switch (token) {
+ case START_ARRAY:
+ final PropertyCollectionBuilder builder = new PropertyCollectionBuilder(jp, entitySet);
+ entitySet.setPropertyCollectionBuilder(builder);
+ arrayStarted = true;
+ break;
+
+ case START_OBJECT:
+ if (arrayStarted) {
+ return entitySet;
+ }
+ break;
+
+ case VALUE_NUMBER_INT:
+ case VALUE_STRING:
+ entitySet.addAnnotation(jp.getCurrentName(), jp.getValueAsString());
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return entitySet;
+ }
+}
[39/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractProperty.java
new file mode 100644
index 0000000..198e50f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractProperty.java
@@ -0,0 +1,174 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.CommonProperty;
+import org.apache.olingo.commons.api.edm.constants.ConcurrencyMode;
+import org.apache.olingo.commons.api.edm.constants.StoreGeneratedPattern;
+
+@JsonDeserialize(using = PropertyDeserializer.class)
+public abstract class AbstractProperty extends AbstractEdmItem implements CommonProperty {
+
+ private static final long serialVersionUID = -6004492361142315153L;
+
+ private String name;
+
+ private String type;
+
+ private boolean nullable = true;
+
+ private String defaultValue;
+
+ private Integer maxLength;
+
+ private boolean fixedLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private boolean unicode = true;
+
+ private String collation;
+
+ private String srid;
+
+ private ConcurrencyMode concurrencyMode;
+
+ private StoreGeneratedPattern storeGeneratedPattern = StoreGeneratedPattern.None;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ @Override
+ public boolean isNullable() {
+ return nullable;
+ }
+
+ public void setNullable(final boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ @Override
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ public void setDefaultValue(final String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public void setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ }
+
+ @Override
+ public boolean isFixedLength() {
+ return fixedLength;
+ }
+
+ public void setFixedLength(final boolean fixedLength) {
+ this.fixedLength = fixedLength;
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(final Integer precision) {
+ this.precision = precision;
+ }
+
+ @Override
+ public Integer getScale() {
+ return scale;
+ }
+
+ public void setScale(final Integer scale) {
+ this.scale = scale;
+ }
+
+ @Override
+ public boolean isUnicode() {
+ return unicode;
+ }
+
+ public void setUnicode(final boolean unicode) {
+ this.unicode = unicode;
+ }
+
+ @Override
+ public String getCollation() {
+ return collation;
+ }
+
+ public void setCollation(final String collation) {
+ this.collation = collation;
+ }
+
+ @Override
+ public String getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final String srid) {
+ this.srid = srid;
+ }
+
+ @Override
+ public ConcurrencyMode getConcurrencyMode() {
+ return concurrencyMode;
+ }
+
+ public void setConcurrencyMode(final ConcurrencyMode concurrencyMode) {
+ this.concurrencyMode = concurrencyMode;
+ }
+
+ @Override
+ public StoreGeneratedPattern getStoreGeneratedPattern() {
+ return storeGeneratedPattern;
+ }
+
+ public void setStoreGeneratedPattern(final StoreGeneratedPattern storeGeneratedPattern) {
+ this.storeGeneratedPattern = storeGeneratedPattern;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractSchema.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractSchema.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractSchema.java
new file mode 100644
index 0000000..b099c31
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractSchema.java
@@ -0,0 +1,70 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.ComplexType;
+import org.apache.olingo.client.api.edm.xml.EntityType;
+import org.apache.olingo.client.api.edm.xml.EnumType;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.core.op.impl.SchemaDeserializer;
+
+@JsonDeserialize(using = SchemaDeserializer.class)
+public abstract class AbstractSchema extends AbstractEdmItem implements Schema {
+
+ private static final long serialVersionUID = -1356392748971378455L;
+
+ private String namespace;
+
+ private String alias;
+
+ @Override
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(final String namespace) {
+ this.namespace = namespace;
+ }
+
+ @Override
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(final String alias) {
+ this.alias = alias;
+ }
+
+ @Override
+ public EnumType getEnumType(final String name) {
+ return getOneByName(name, getEnumTypes());
+ }
+
+ @Override
+ public ComplexType getComplexType(final String name) {
+ return getOneByName(name, getComplexTypes());
+ }
+
+ @Override
+ public EntityType getEntityType(final String name) {
+ return getOneByName(name, getEntityTypes());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractXMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractXMLMetadata.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractXMLMetadata.java
new file mode 100644
index 0000000..e04d5da
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractXMLMetadata.java
@@ -0,0 +1,96 @@
+/*
+ * 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.edm.xml;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.edm.xml.Edmx;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+
+/**
+ * Entry point for access information about EDM metadata.
+ */
+public abstract class AbstractXMLMetadata extends AbstractEdmItem implements XMLMetadata {
+
+ private static final long serialVersionUID = -1214173426671503187L;
+
+ protected final Edmx edmx;
+
+ protected final Map<String, Schema> schemaByNsOrAlias;
+
+ public AbstractXMLMetadata(final Edmx edmx) {
+ this.edmx = edmx;
+
+ this.schemaByNsOrAlias = new HashMap<String, Schema>();
+ for (Schema schema : edmx.getDataServices().getSchemas()) {
+ this.schemaByNsOrAlias.put(schema.getNamespace(), schema);
+ if (StringUtils.isNotBlank(schema.getAlias())) {
+ this.schemaByNsOrAlias.put(schema.getAlias(), schema);
+ }
+ }
+ }
+
+ /**
+ * Checks whether the given key is a valid namespace or alias in the EdM metadata document.
+ *
+ * @param key namespace or alias
+ * @return true if key is valid namespace or alias
+ */
+ @Override
+ public boolean isNsOrAlias(final String key) {
+ return this.schemaByNsOrAlias.keySet().contains(key);
+ }
+
+ /**
+ * Returns the Schema at the specified position in the EdM metadata document.
+ *
+ * @param index index of the Schema to return
+ * @return the Schema at the specified position in the EdM metadata document
+ */
+ @Override
+ public Schema getSchema(final int index) {
+ return this.edmx.getDataServices().getSchemas().get(index);
+ }
+
+ /**
+ * Returns the Schema with the specified key (namespace or alias) in the EdM metadata document.
+ *
+ * @param key namespace or alias
+ * @return the Schema with the specified key in the EdM metadata document
+ */
+ @Override
+ public Schema getSchema(final String key) {
+ return this.schemaByNsOrAlias.get(key);
+ }
+
+ /**
+ * Returns all Schema objects defined in the EdM metadata document.
+ *
+ * @return all Schema objects defined in the EdM metadata document
+ */
+ @Override
+ public List<? extends Schema> getSchemas() {
+ return this.edmx.getDataServices().getSchemas();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
new file mode 100644
index 0000000..a7ded8a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
@@ -0,0 +1,66 @@
+/*
+ * 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.edm.xml;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+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 java.io.IOException;
+
+public class DataServicesDeserializer extends AbstractEdmDeserializer<AbstractDataServices> {
+
+ @Override
+ protected AbstractDataServices doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractDataServices dataServices = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.DataServicesImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.DataServicesImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("DataServiceVersion".equals(jp.getCurrentName())) {
+ dataServices.setDataServiceVersion(jp.nextTextValue());
+ } else if ("MaxDataServiceVersion".equals(jp.getCurrentName())) {
+ dataServices.setMaxDataServiceVersion(jp.nextTextValue());
+ } else if ("Schema".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (dataServices instanceof org.apache.olingo.client.core.edm.xml.v3.DataServicesImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.DataServicesImpl) dataServices).
+ getSchemas().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.SchemaImpl.class));
+
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.DataServicesImpl) dataServices).
+ getSchemas().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.SchemaImpl.class));
+ }
+ }
+ }
+ }
+
+ return dataServices;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
new file mode 100644
index 0000000..0f4b451
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
@@ -0,0 +1,69 @@
+/*
+ * 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.edm.xml;
+
+import org.apache.olingo.client.core.edm.xml.v4.ReferenceImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+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 java.io.IOException;
+
+@SuppressWarnings("rawtypes")
+public class EdmxDeserializer extends AbstractEdmDeserializer<AbstractEdmx> {
+
+ @Override
+ protected AbstractEdmx doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractEdmx edmx = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.EdmxImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.EdmxImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Version".equals(jp.getCurrentName())) {
+ edmx.setVersion(jp.nextTextValue());
+ } else if ("DataServices".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (edmx instanceof org.apache.olingo.client.core.edm.xml.v3.EdmxImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EdmxImpl) edmx).
+ setDataServices(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.DataServicesImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EdmxImpl) edmx).
+ setDataServices(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.DataServicesImpl.class));
+ }
+ } else if ("Reference".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EdmxImpl) edmx).getReferences().
+ add(jp.readValueAs( ReferenceImpl.class));
+ }
+ }
+ }
+
+ return edmx;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyImpl.java
new file mode 100644
index 0000000..9880a3a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyImpl.java
@@ -0,0 +1,41 @@
+/*
+ * 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.edm.xml;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.EntityKey;
+import org.apache.olingo.client.api.edm.xml.PropertyRef;
+import org.apache.olingo.client.core.op.impl.EntityKeyDeserializer;
+
+@JsonDeserialize(using = EntityKeyDeserializer.class)
+public class EntityKeyImpl extends AbstractEdmItem implements EntityKey {
+
+ private static final long serialVersionUID = 2586047015894794685L;
+
+ private final List<PropertyRef> propertyRefs = new ArrayList<PropertyRef>();
+
+ @Override
+ public List<PropertyRef> getPropertyRefs() {
+ return propertyRefs;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/OnDeleteImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/OnDeleteImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/OnDeleteImpl.java
new file mode 100644
index 0000000..cc72645
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/OnDeleteImpl.java
@@ -0,0 +1,42 @@
+/*
+ * 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.edm.xml;
+
+import org.apache.olingo.client.api.edm.xml.OnDelete;
+import org.apache.olingo.client.api.edm.xml.OnDeleteAction;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class OnDeleteImpl extends AbstractEdmItem implements OnDelete {
+
+ private static final long serialVersionUID = -5321523424474336347L;
+
+ @JsonProperty(value = "Action", required = true)
+ private OnDeleteAction action = OnDeleteAction.None;
+
+ @Override
+ public OnDeleteAction getAction() {
+ return action;
+ }
+
+ public void setAction(final OnDeleteAction action) {
+ this.action = action;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
new file mode 100644
index 0000000..db5b6c1
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
@@ -0,0 +1,71 @@
+/*
+ * 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.edm.xml;
+
+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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.api.edm.xml.v3.ParameterMode;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class ParameterDeserializer extends AbstractEdmDeserializer<AbstractParameter> {
+
+ @Override
+ protected AbstractParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractParameter parameter = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.ParameterImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.ParameterImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ parameter.setName(jp.nextTextValue());
+ } else if ("Type".equals(jp.getCurrentName())) {
+ parameter.setType(jp.nextTextValue());
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ parameter.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ parameter.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ parameter.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ parameter.setScale(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Mode".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v3.ParameterImpl) parameter).
+ setMode(ParameterMode.valueOf(jp.nextTextValue()));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.ParameterImpl) parameter).setSrid(jp.nextTextValue());
+ }
+ }
+ }
+
+ return parameter;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
new file mode 100644
index 0000000..89bdfcf
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
@@ -0,0 +1,104 @@
+/*
+ * 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.edm.xml;
+
+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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.commons.api.edm.constants.ConcurrencyMode;
+import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+import org.apache.olingo.commons.api.edm.constants.StoreGeneratedPattern;
+
+public class PropertyDeserializer extends AbstractEdmDeserializer<AbstractProperty> {
+
+ @Override
+ protected AbstractProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractProperty property = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.PropertyImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.PropertyImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ property.setName(jp.nextTextValue());
+ } else if ("Type".equals(jp.getCurrentName())) {
+ property.setType(jp.nextTextValue());
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ property.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("DefaultValue".equals(jp.getCurrentName())) {
+ property.setDefaultValue(jp.nextTextValue());
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ property.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("FixedLength".equals(jp.getCurrentName())) {
+ property.setFixedLength(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ property.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ property.setScale(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Unicode".equals(jp.getCurrentName())) {
+ property.setUnicode(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Collation".equals(jp.getCurrentName())) {
+ property.setCollation(jp.nextTextValue());
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ property.setSrid(jp.nextTextValue());
+ } else if ("ConcurrencyMode".equals(jp.getCurrentName())) {
+ property.setConcurrencyMode(ConcurrencyMode.valueOf(jp.nextTextValue()));
+ } else if ("StoreGeneratedPattern".equals(jp.getCurrentName())) {
+ property.setStoreGeneratedPattern(StoreGeneratedPattern.valueOf(jp.nextTextValue()));
+ } else if ("FC_SourcePath".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcSourcePath(jp.nextTextValue());
+ } else if ("FC_TargetPath".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcTargetPath(jp.nextTextValue());
+ } else if ("FC_ContentKind".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcContentKind(EdmContentKind.valueOf(jp.nextTextValue()));
+ } else if ("FC_NsPrefix".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcNSPrefix(jp.nextTextValue());
+ } else if ("FC_NsUri".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcNSURI(jp.nextTextValue());
+ } else if ("FC_KeepInContent".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcKeepInContent(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.PropertyImpl) property).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return property;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyRefImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyRefImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyRefImpl.java
new file mode 100644
index 0000000..6cc813b
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyRefImpl.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.edm.xml;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.PropertyRef;
+
+public class PropertyRefImpl extends AbstractEdmItem implements PropertyRef {
+
+ private static final long serialVersionUID = 6738212067449628983L;
+
+ @JsonProperty(value = "Name", required = true)
+ private String name;
+
+ @JsonProperty(value = "Alias")
+ private String alias;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(final String alias) {
+ this.alias = alias;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsDeserializer.java
new file mode 100644
index 0000000..4fec055
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsDeserializer.java
@@ -0,0 +1,57 @@
+/*
+ * 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.edm.xml.v3;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class AnnotationsDeserializer extends AbstractEdmDeserializer<AnnotationsImpl> {
+
+ @Override
+ protected AnnotationsImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AnnotationsImpl annotations = new AnnotationsImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Target".equals(jp.getCurrentName())) {
+ annotations.setTarget(jp.nextTextValue());
+ } else if ("Qualifier".equals(jp.getCurrentName())) {
+ annotations.setQualifier(jp.nextTextValue());
+ } else if ("typeAnnotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ annotations.getTypeAnnotations().add(jp.readValueAs( TypeAnnotationImpl.class));
+ } else if ("ValueAnnotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ annotations.getValueAnnotations().add(jp.readValueAs( ValueAnnotationImpl.class));
+ }
+ }
+ }
+
+ return annotations;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsImpl.java
new file mode 100644
index 0000000..e9d9258
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsImpl.java
@@ -0,0 +1,50 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v3.Annotations;
+import org.apache.olingo.client.api.edm.xml.v3.TypeAnnotation;
+import org.apache.olingo.client.api.edm.xml.v3.ValueAnnotation;
+import org.apache.olingo.client.core.edm.xml.AbstractAnnotations;
+
+@JsonDeserialize(using = AnnotationsDeserializer.class)
+public class AnnotationsImpl extends AbstractAnnotations implements Annotations {
+
+ private static final long serialVersionUID = 3877353656301805410L;
+
+ private final List<TypeAnnotation> typeAnnotations = new ArrayList<TypeAnnotation>();
+
+ private final List<ValueAnnotation> valueAnnotations = new ArrayList<ValueAnnotation>();
+
+ @Override
+ public List<TypeAnnotation> getTypeAnnotations() {
+ return typeAnnotations;
+ }
+
+ @Override
+ public List<ValueAnnotation> getValueAnnotations() {
+ return valueAnnotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationDeserializer.java
new file mode 100644
index 0000000..6d999c2
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationDeserializer.java
@@ -0,0 +1,55 @@
+/*
+ * 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.edm.xml.v3;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class AssociationDeserializer extends AbstractEdmDeserializer<AssociationImpl> {
+
+ @Override
+ protected AssociationImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AssociationImpl association = new AssociationImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ association.setName(jp.nextTextValue());
+ } else if ("ReferentialConstraint".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ association.setReferentialConstraint(jp.readValueAs( ReferentialConstraintImpl.class));
+ } else if ("End".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ association.getEnds().add(jp.readValueAs( AssociationEndImpl.class));
+ }
+ }
+ }
+
+ return association;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationEndImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationEndImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationEndImpl.java
new file mode 100644
index 0000000..e5942da
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationEndImpl.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.edm.xml.v3;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.OnDelete;
+import org.apache.olingo.client.api.edm.xml.v3.AssociationEnd;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class AssociationEndImpl extends AbstractEdmItem implements AssociationEnd {
+
+ private static final long serialVersionUID = 3305394053564979376L;
+
+ @JsonProperty(value = "Type", required = true)
+ private String type;
+
+ @JsonProperty(value = "Role")
+ private String role;
+
+ @JsonProperty(value = "Multiplicity")
+ private String multiplicity;
+
+ @JsonProperty(value = "OnDelete")
+ private OnDelete onDelete;
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ @Override
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(final String role) {
+ this.role = role;
+ }
+
+ @Override
+ public String getMultiplicity() {
+ return multiplicity;
+ }
+
+ public void setMultiplicity(final String multiplicity) {
+ this.multiplicity = multiplicity;
+ }
+
+ @Override
+ public OnDelete getOnDelete() {
+ return onDelete;
+ }
+
+ public void setOnDelete(final OnDelete onDelete) {
+ this.onDelete = onDelete;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationImpl.java
new file mode 100644
index 0000000..af7b5b5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationImpl.java
@@ -0,0 +1,64 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v3.Association;
+import org.apache.olingo.client.api.edm.xml.v3.AssociationEnd;
+import org.apache.olingo.client.api.edm.xml.v3.ReferentialConstraint;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+@JsonDeserialize(using = AssociationDeserializer.class)
+public class AssociationImpl extends AbstractEdmItem implements Association {
+
+ private static final long serialVersionUID = 73763231919532482L;
+
+ private String name;
+
+ private ReferentialConstraint referentialConstraint;
+
+ private List<AssociationEnd> ends = new ArrayList<AssociationEnd>();
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public ReferentialConstraint getReferentialConstraint() {
+ return referentialConstraint;
+ }
+
+ public void setReferentialConstraint(final ReferentialConstraint referentialConstraint) {
+ this.referentialConstraint = referentialConstraint;
+ }
+
+ @Override
+ public List<AssociationEnd> getEnds() {
+ return ends;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetDeserializer.java
new file mode 100644
index 0000000..4b04aa0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetDeserializer.java
@@ -0,0 +1,54 @@
+/*
+ * 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.edm.xml.v3;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class AssociationSetDeserializer extends AbstractEdmDeserializer<AssociationSetImpl> {
+
+ @Override
+ protected AssociationSetImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AssociationSetImpl associationSet = new AssociationSetImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ associationSet.setName(jp.nextTextValue());
+ } else if ("Association".equals(jp.getCurrentName())) {
+ associationSet.setAssociation(jp.nextTextValue());
+ } else if ("End".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ associationSet.getEnds().add(jp.readValueAs( AssociationSetEndImpl.class));
+ }
+ }
+ }
+
+ return associationSet;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetEndImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetEndImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetEndImpl.java
new file mode 100644
index 0000000..f39beb0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetEndImpl.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.edm.xml.v3;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v3.AssociationSetEnd;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class AssociationSetEndImpl extends AbstractEdmItem implements AssociationSetEnd {
+
+ private static final long serialVersionUID = -6238344152962217446L;
+
+ @JsonProperty("Role")
+ private String role;
+
+ @JsonProperty(value = "EntitySet", required = true)
+ private String entitySet;
+
+ @Override
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(final String role) {
+ this.role = role;
+ }
+
+ @Override
+ public String getEntitySet() {
+ return entitySet;
+ }
+
+ public void setEntitySet(final String entitySet) {
+ this.entitySet = entitySet;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetImpl.java
new file mode 100644
index 0000000..d49aa44
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetImpl.java
@@ -0,0 +1,63 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v3.AssociationSet;
+import org.apache.olingo.client.api.edm.xml.v3.AssociationSetEnd;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+@JsonDeserialize(using = AssociationSetDeserializer.class)
+public class AssociationSetImpl extends AbstractEdmItem implements AssociationSet {
+
+ private static final long serialVersionUID = 1248430921598774799L;
+
+ private String name;
+
+ private String association;
+
+ private List<AssociationSetEnd> ends = new ArrayList<AssociationSetEnd>();
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getAssociation() {
+ return association;
+ }
+
+ public void setAssociation(final String association) {
+ this.association = association;
+ }
+
+ @Override
+ public List<AssociationSetEnd> getEnds() {
+ return ends;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ComplexTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ComplexTypeImpl.java
new file mode 100644
index 0000000..6f4c837
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ComplexTypeImpl.java
@@ -0,0 +1,55 @@
+/*
+ * 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.edm.xml.v3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.ComplexType;
+import org.apache.olingo.client.core.edm.xml.AbstractComplexType;
+
+public class ComplexTypeImpl extends AbstractComplexType implements ComplexType {
+
+ private static final long serialVersionUID = -1251230308269425962L;
+
+ private final List<PropertyImpl> properties = new ArrayList<PropertyImpl>();
+
+ private final List<NavigationPropertyImpl> navigationProperties = new ArrayList<NavigationPropertyImpl>();
+
+ @Override
+ public PropertyImpl getProperty(final String name) {
+ return (PropertyImpl) super.getProperty(name);
+ }
+
+ @Override
+ public List<PropertyImpl> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public NavigationPropertyImpl getNavigationProperty(String name) {
+ return (NavigationPropertyImpl) super.getNavigationProperty(name);
+ }
+
+ @Override
+ public List<NavigationPropertyImpl> getNavigationProperties() {
+ return navigationProperties;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/DataServicesImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/DataServicesImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/DataServicesImpl.java
new file mode 100644
index 0000000..542c20d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/DataServicesImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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.edm.xml.v3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.core.edm.xml.AbstractDataServices;
+
+public class DataServicesImpl extends AbstractDataServices {
+
+ private static final long serialVersionUID = 633129618050875211L;
+
+ private final List<Schema> schemas = new ArrayList<Schema>();
+
+ @Override
+ public List<Schema> getSchemas() {
+ return schemas;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EdmxImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EdmxImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EdmxImpl.java
new file mode 100644
index 0000000..78d3471
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EdmxImpl.java
@@ -0,0 +1,32 @@
+/*
+ * 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.edm.xml.v3;
+
+import org.apache.olingo.client.core.edm.xml.AbstractEdmx;
+
+public class EdmxImpl extends AbstractEdmx {
+
+ private static final long serialVersionUID = -8031883176876401375L;
+
+ @Override
+ public DataServicesImpl getDataServices() {
+ return (DataServicesImpl) super.getDataServices();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntityContainerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntityContainerImpl.java
new file mode 100644
index 0000000..1866a57
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntityContainerImpl.java
@@ -0,0 +1,69 @@
+/*
+ * 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.edm.xml.v3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.EntitySet;
+import org.apache.olingo.client.api.edm.xml.v3.AssociationSet;
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.core.edm.xml.AbstractEntityContainer;
+
+public class EntityContainerImpl extends AbstractEntityContainer {
+
+ private static final long serialVersionUID = 8934431875078180370L;
+
+ private final List<EntitySet> entitySets = new ArrayList<EntitySet>();
+
+ private final List<AssociationSet> associationSets = new ArrayList<AssociationSet>();
+
+ private final List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
+
+ @Override
+ public EntitySetImpl getEntitySet(final String name) {
+ return (EntitySetImpl) super.getEntitySet(name);
+ }
+
+ @Override
+ public List<EntitySet> getEntitySets() {
+ return entitySets;
+ }
+
+ public List<AssociationSet> getAssociationSets() {
+ return associationSets;
+ }
+
+ @Override
+ public FunctionImportImpl getFunctionImport(final String name) {
+ return (FunctionImportImpl) super.getFunctionImport(name);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<FunctionImport> getFunctionImports(final String name) {
+ return (List<FunctionImport>) super.getFunctionImports(name);
+ }
+
+ @Override
+ public List<FunctionImport> getFunctionImports() {
+ return functionImports;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntitySetImpl.java
new file mode 100644
index 0000000..1757c35
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntitySetImpl.java
@@ -0,0 +1,27 @@
+/*
+ * 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.edm.xml.v3;
+
+import org.apache.olingo.client.core.edm.xml.AbstractEntitySet;
+
+public class EntitySetImpl extends AbstractEntitySet {
+
+ private static final long serialVersionUID = 5570833733884884012L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntityTypeImpl.java
new file mode 100644
index 0000000..d20e981
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EntityTypeImpl.java
@@ -0,0 +1,54 @@
+/*
+ * 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.edm.xml.v3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.core.edm.xml.AbstractEntityType;
+
+public class EntityTypeImpl extends AbstractEntityType {
+
+ private static final long serialVersionUID = 8727765036150269547L;
+
+ private final List<PropertyImpl> properties = new ArrayList<PropertyImpl>();
+
+ private final List<NavigationPropertyImpl> navigationProperties = new ArrayList<NavigationPropertyImpl>();
+
+ @Override
+ public PropertyImpl getProperty(final String name) {
+ return (PropertyImpl) super.getProperty(name);
+ }
+
+ @Override
+ public List<PropertyImpl> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public NavigationPropertyImpl getNavigationProperty(final String name) {
+ return (NavigationPropertyImpl) super.getNavigationProperty(name);
+ }
+
+ @Override
+ public List<NavigationPropertyImpl> getNavigationProperties() {
+ return navigationProperties;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EnumTypeImpl.java
new file mode 100644
index 0000000..942a2b8
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/EnumTypeImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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.edm.xml.v3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Member;
+import org.apache.olingo.client.core.edm.xml.AbstractEnumType;
+
+public class EnumTypeImpl extends AbstractEnumType {
+
+ private static final long serialVersionUID = 8967396195669128419L;
+
+ private final List<Member> members = new ArrayList<Member>();
+
+ @Override
+ public List<Member> getMembers() {
+ return members;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportDeserializer.java
new file mode 100644
index 0000000..4cca7c8
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportDeserializer.java
@@ -0,0 +1,69 @@
+/*
+ * 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.edm.xml.v3;
+
+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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class FunctionImportDeserializer extends AbstractEdmDeserializer<FunctionImportImpl> {
+
+ @Override
+ protected FunctionImportImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final FunctionImportImpl funcImp = new FunctionImportImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ funcImp.setName(jp.nextTextValue());
+ } else if ("ReturnType".equals(jp.getCurrentName())) {
+ funcImp.setReturnType(jp.nextTextValue());
+ } else if ("EntitySet".equals(jp.getCurrentName())) {
+ funcImp.setEntitySet(jp.nextTextValue());
+ } else if ("EntitySetPath".equals(jp.getCurrentName())) {
+ funcImp.setEntitySetPath(jp.nextTextValue());
+ } else if ("IsComposable".equals(jp.getCurrentName())) {
+ funcImp.setComposable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("IsSideEffecting".equals(jp.getCurrentName())) {
+ funcImp.setSideEffecting(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("IsBindable".equals(jp.getCurrentName())) {
+ funcImp.setBindable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("IsAlwaysBindable".equals(jp.getCurrentName())) {
+ funcImp.setAlwaysBindable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("HttpMethod".equals(jp.getCurrentName())) {
+ funcImp.setHttpMethod(jp.nextTextValue());
+ } else if ("Parameter".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ funcImp.getParameters().add(jp.readValueAs( ParameterImpl.class));
+ }
+ }
+ }
+
+ return funcImp;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportImpl.java
new file mode 100644
index 0000000..7a00c3a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportImpl.java
@@ -0,0 +1,140 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.api.edm.xml.v3.Parameter;
+
+@JsonDeserialize(using = FunctionImportDeserializer.class)
+public class FunctionImportImpl implements FunctionImport {
+
+ private static final long serialVersionUID = -6214472528425935461L;
+
+ private String name;
+
+ private String returnType;
+
+ private String entitySet;
+
+ private String entitySetPath;
+
+ private boolean composable;
+
+ private boolean sideEffecting = true;
+
+ private boolean bindable;
+
+ private boolean alwaysBindable;
+
+ private String httpMethod;
+
+ private final List<Parameter> parameters = new ArrayList<Parameter>();
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getReturnType() {
+ return returnType;
+ }
+
+ public void setReturnType(final String returnType) {
+ this.returnType = returnType;
+ }
+
+ @Override
+ public String getEntitySet() {
+ return entitySet;
+ }
+
+ public void setEntitySet(final String entitySet) {
+ this.entitySet = entitySet;
+ }
+
+ @Override
+ public String getEntitySetPath() {
+ return entitySetPath;
+ }
+
+ public void setEntitySetPath(final String entitySetPath) {
+ this.entitySetPath = entitySetPath;
+ }
+
+ @Override
+ public boolean isComposable() {
+ return composable;
+ }
+
+ public void setComposable(final boolean composable) {
+ this.composable = composable;
+ }
+
+ @Override
+ public boolean isSideEffecting() {
+ return sideEffecting;
+ }
+
+ public void setSideEffecting(final boolean sideEffecting) {
+ this.sideEffecting = sideEffecting;
+ }
+
+ @Override
+ public boolean isBindable() {
+ return bindable;
+ }
+
+ public void setBindable(final boolean bindable) {
+ this.bindable = bindable;
+ }
+
+ @Override
+ public boolean isAlwaysBindable() {
+ return alwaysBindable;
+ }
+
+ public void setAlwaysBindable(final boolean alwaysBindable) {
+ this.alwaysBindable = alwaysBindable;
+ }
+
+ @Override
+ public String getHttpMethod() {
+ return httpMethod;
+ }
+
+ public void setHttpMethod(final String httpMethod) {
+ this.httpMethod = httpMethod;
+ }
+
+ @Override
+ public List<Parameter> getParameters() {
+ return parameters;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/MemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/MemberImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/MemberImpl.java
new file mode 100644
index 0000000..7ef4d86
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/MemberImpl.java
@@ -0,0 +1,27 @@
+/*
+ * 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.edm.xml.v3;
+
+import org.apache.olingo.client.core.edm.xml.AbstractMember;
+
+public class MemberImpl extends AbstractMember {
+
+ private static final long serialVersionUID = 6605381518349837929L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/NavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/NavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/NavigationPropertyImpl.java
new file mode 100644
index 0000000..2c7aa90
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/NavigationPropertyImpl.java
@@ -0,0 +1,66 @@
+/*
+ * 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.edm.xml.v3;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v3.NavigationProperty;
+import org.apache.olingo.client.core.edm.xml.AbstractNavigationProperty;
+
+public class NavigationPropertyImpl extends AbstractNavigationProperty implements NavigationProperty {
+
+ private static final long serialVersionUID = -2889417442815563307L;
+
+ @JsonProperty(value = "Relationship", required = true)
+ private String relationship;
+
+ @JsonProperty(value = "ToRole", required = true)
+ private String toRole;
+
+ @JsonProperty(value = "FromRole", required = true)
+ private String fromRole;
+
+ @Override
+ public String getRelationship() {
+ return relationship;
+ }
+
+ public void setRelationship(final String relationship) {
+ this.relationship = relationship;
+ }
+
+ @Override
+ public String getToRole() {
+ return toRole;
+ }
+
+ public void setToRole(final String toRole) {
+ this.toRole = toRole;
+ }
+
+ @Override
+ public String getFromRole() {
+ return fromRole;
+ }
+
+ public void setFromRole(final String fromRole) {
+ this.fromRole = fromRole;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ParameterImpl.java
new file mode 100644
index 0000000..f555406
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ParameterImpl.java
@@ -0,0 +1,40 @@
+/*
+ * 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.edm.xml.v3;
+
+import org.apache.olingo.client.api.edm.xml.v3.Parameter;
+import org.apache.olingo.client.api.edm.xml.v3.ParameterMode;
+import org.apache.olingo.client.core.edm.xml.AbstractParameter;
+
+public class ParameterImpl extends AbstractParameter implements Parameter {
+
+ private static final long serialVersionUID = 7596724999614891358L;
+
+ private ParameterMode mode;
+
+ @Override
+ public ParameterMode getMode() {
+ return mode;
+ }
+
+ public void setMode(final ParameterMode mode) {
+ this.mode = mode;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/PropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/PropertyImpl.java
new file mode 100644
index 0000000..c2fc43c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/PropertyImpl.java
@@ -0,0 +1,95 @@
+/*
+ * 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.edm.xml.v3;
+
+import org.apache.olingo.client.api.edm.xml.v3.Property;
+import org.apache.olingo.client.core.edm.xml.AbstractProperty;
+import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
+
+public class PropertyImpl extends AbstractProperty implements Property {
+
+ private static final long serialVersionUID = 6224524803474652100L;
+
+ private String fcSourcePath;
+
+ private String fcTargetPath;
+
+ private EdmContentKind fcContentKind = EdmContentKind.text;
+
+ private String fcNSPrefix;
+
+ private String fcNSURI;
+
+ private boolean fcKeepInContent = true;
+
+ @Override
+ public String getFcSourcePath() {
+ return fcSourcePath;
+ }
+
+ public void setFcSourcePath(final String fcSourcePath) {
+ this.fcSourcePath = fcSourcePath;
+ }
+
+ @Override
+ public String getFcTargetPath() {
+ return fcTargetPath;
+ }
+
+ public void setFcTargetPath(final String fcTargetPath) {
+ this.fcTargetPath = fcTargetPath;
+ }
+
+ @Override
+ public EdmContentKind getFcContentKind() {
+ return fcContentKind;
+ }
+
+ public void setFcContentKind(final EdmContentKind fcContentKind) {
+ this.fcContentKind = fcContentKind;
+ }
+
+ @Override
+ public String getFcNSPrefix() {
+ return fcNSPrefix;
+ }
+
+ public void setFcNSPrefix(final String fcNSPrefix) {
+ this.fcNSPrefix = fcNSPrefix;
+ }
+
+ @Override
+ public String getFcNSURI() {
+ return fcNSURI;
+ }
+
+ public void setFcNSURI(final String fcNSURI) {
+ this.fcNSURI = fcNSURI;
+ }
+
+ @Override
+ public boolean isFcKeepInContent() {
+ return fcKeepInContent;
+ }
+
+ public void setFcKeepInContent(final boolean fcKeepInContent) {
+ this.fcKeepInContent = fcKeepInContent;
+ }
+
+}
[37/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/MemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/MemberImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/MemberImpl.java
new file mode 100644
index 0000000..152a59f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/MemberImpl.java
@@ -0,0 +1,45 @@
+/*
+ * 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.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.v4.AnnotatedEdmItem;
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.core.edm.xml.AbstractMember;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class MemberImpl extends AbstractMember implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = -344920557183058824L;
+
+ @JsonProperty("Annotation")
+ private Annotation annotation;
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @JsonIgnore
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyBindingImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyBindingImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyBindingImpl.java
new file mode 100644
index 0000000..980dbf9
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyBindingImpl.java
@@ -0,0 +1,54 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v4.NavigationPropertyBinding;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public class NavigationPropertyBindingImpl extends AbstractEdmItem implements NavigationPropertyBinding {
+
+ private static final long serialVersionUID = -6026065326479176817L;
+
+ @JsonProperty(value = "Path", required = true)
+ private String path;
+
+ @JsonProperty(value = "Target", required = true)
+ private String target;
+
+ @Override
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(final String path) {
+ this.path = path;
+ }
+
+ @Override
+ public String getTarget() {
+ return target;
+ }
+
+ public void setTarget(final String target) {
+ this.target = target;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyDeserializer.java
new file mode 100644
index 0000000..f1dc46f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyDeserializer.java
@@ -0,0 +1,70 @@
+/*
+ * 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.edm.xml.v4;
+
+import org.apache.olingo.client.core.edm.xml.OnDeleteImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+
+public class NavigationPropertyDeserializer extends AbstractEdmDeserializer<NavigationPropertyImpl> {
+
+ @Override
+ protected NavigationPropertyImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final NavigationPropertyImpl property = new NavigationPropertyImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ property.setName(jp.nextTextValue());
+ } else if ("Type".equals(jp.getCurrentName())) {
+ property.setType(jp.nextTextValue());
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ property.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Partner".equals(jp.getCurrentName())) {
+ property.setPartner(jp.nextTextValue());
+ } else if ("ContainsTarget".equals(jp.getCurrentName())) {
+ property.setContainsTarget(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("ReferentialConstraint".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ property.getReferentialConstraints().add(jp.readValueAs(ReferentialConstraintImpl.class));
+ } else if ("OnDelete".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ property.setOnDelete(jp.readValueAs(OnDeleteImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ property.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return property;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyImpl.java
new file mode 100644
index 0000000..6d186e0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyImpl.java
@@ -0,0 +1,110 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.OnDelete;
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.NavigationProperty;
+import org.apache.olingo.client.api.edm.xml.v4.ReferentialConstraint;
+import org.apache.olingo.client.core.edm.xml.AbstractNavigationProperty;
+
+@JsonDeserialize(using = NavigationPropertyDeserializer.class)
+public class NavigationPropertyImpl extends AbstractNavigationProperty implements NavigationProperty {
+
+ private static final long serialVersionUID = -2889417442815563307L;
+
+ private String type;
+
+ private boolean nullable = true;
+
+ private String partner;
+
+ private boolean containsTarget = false;
+
+ private final List<ReferentialConstraint> referentialConstraints = new ArrayList<ReferentialConstraint>();
+
+ private OnDelete onDelete;
+
+ private Annotation annotation;
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ @Override
+ public boolean isNullable() {
+ return nullable;
+ }
+
+ public void setNullable(final boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ @Override
+ public String getPartner() {
+ return partner;
+ }
+
+ public void setPartner(final String partner) {
+ this.partner = partner;
+ }
+
+ @Override
+ public boolean isContainsTarget() {
+ return containsTarget;
+ }
+
+ public void setContainsTarget(final boolean containsTarget) {
+ this.containsTarget = containsTarget;
+ }
+
+ @Override
+ public List<ReferentialConstraint> getReferentialConstraints() {
+ return referentialConstraints;
+ }
+
+ @Override
+ public OnDelete getOnDelete() {
+ return onDelete;
+ }
+
+ public void setOnDelete(final OnDelete onDelete) {
+ this.onDelete = onDelete;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ParameterImpl.java
new file mode 100644
index 0000000..990cef0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ParameterImpl.java
@@ -0,0 +1,39 @@
+/*
+ * 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.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.v4.Parameter;
+import org.apache.olingo.client.core.edm.xml.AbstractParameter;
+
+public class ParameterImpl extends AbstractParameter implements Parameter {
+
+ private static final long serialVersionUID = -1067642515116697747L;
+
+ private String srid;
+
+ @Override
+ public String getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final String srid) {
+ this.srid = srid;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/PropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/PropertyImpl.java
new file mode 100644
index 0000000..9b1f67d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/PropertyImpl.java
@@ -0,0 +1,42 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.Property;
+import org.apache.olingo.client.core.edm.xml.AbstractProperty;
+
+public class PropertyImpl extends AbstractProperty implements Property {
+
+ private static final long serialVersionUID = -5541908235094985412L;
+
+ private Annotation annotation;
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @JsonIgnore
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceDeserializer.java
new file mode 100644
index 0000000..839f3c9
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceDeserializer.java
@@ -0,0 +1,60 @@
+/*
+ * 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.edm.xml.v4;
+
+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 java.io.IOException;
+import java.net.URI;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class ReferenceDeserializer extends AbstractEdmDeserializer<ReferenceImpl> {
+
+ @Override
+ protected ReferenceImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final ReferenceImpl reference = new ReferenceImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Uri".equals(jp.getCurrentName())) {
+ reference.setUri(URI.create(jp.nextTextValue()));
+ } else if ("Include".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ reference.getIncludes().add(jp.readValueAs( IncludeImpl.class));
+ } else if ("IncludeAnnotations".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ reference.getIncludeAnnotations().add(jp.readValueAs( IncludeAnnotationsImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ reference.getAnnotations().add(jp.readValueAs( AnnotationImpl.class));
+ }
+ }
+ }
+
+ return reference;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceImpl.java
new file mode 100644
index 0000000..c7b88aa
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceImpl.java
@@ -0,0 +1,70 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.Include;
+import org.apache.olingo.client.api.edm.xml.v4.IncludeAnnotations;
+import org.apache.olingo.client.api.edm.xml.v4.Reference;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+@JsonDeserialize(using = ReferenceDeserializer.class)
+public class ReferenceImpl extends AbstractEdmItem implements Reference {
+
+ private static final long serialVersionUID = -5600031479702563436L;
+
+ private URI uri;
+
+ private final List<Include> includes = new ArrayList<Include>();
+
+ private final List<IncludeAnnotations> includeAnnotations = new ArrayList<IncludeAnnotations>();
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(final URI uri) {
+ this.uri = uri;
+ }
+
+ @Override
+ public List<Include> getIncludes() {
+ return includes;
+ }
+
+ @Override
+ public List<IncludeAnnotations> getIncludeAnnotations() {
+ return includeAnnotations;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferentialConstraintImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferentialConstraintImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferentialConstraintImpl.java
new file mode 100644
index 0000000..d18e87e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferentialConstraintImpl.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.edm.xml.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import org.apache.olingo.client.api.edm.xml.v4.ReferentialConstraint;
+
+public class ReferentialConstraintImpl extends AbstractAnnotatedEdmItem implements ReferentialConstraint {
+
+ private static final long serialVersionUID = -9182114558289778632L;
+
+ @JsonProperty(value = "Property", required = true)
+ private String property;
+
+ @JsonProperty(value = "ReferencedProperty", required = true)
+ private String referencedProperty;
+
+ @Override
+ public String getProperty() {
+ return property;
+ }
+
+ public void setProperty(final String property) {
+ this.property = property;
+ }
+
+ @Override
+ public String getReferencedProperty() {
+ return referencedProperty;
+ }
+
+ public void setReferencedProperty(final String referencedProperty) {
+ this.referencedProperty = referencedProperty;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeDeserializer.java
new file mode 100644
index 0000000..f51a850
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeDeserializer.java
@@ -0,0 +1,62 @@
+/*
+ * 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.edm.xml.v4;
+
+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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class ReturnTypeDeserializer extends AbstractEdmDeserializer<ReturnTypeImpl> {
+
+ @Override
+ protected ReturnTypeImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final ReturnTypeImpl returnType = new ReturnTypeImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Type".equals(jp.getCurrentName())) {
+ returnType.setType(jp.nextTextValue());
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ returnType.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ returnType.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ returnType.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ returnType.setScale(Integer.valueOf(jp.nextTextValue()));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ returnType.setSrid(jp.nextTextValue());
+ }
+ }
+ }
+
+ return returnType;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeImpl.java
new file mode 100644
index 0000000..e572f9a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeImpl.java
@@ -0,0 +1,97 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.v4.ReturnType;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+@JsonDeserialize(using = ReturnTypeDeserializer.class)
+public class ReturnTypeImpl extends AbstractEdmItem implements ReturnType {
+
+ private static final long serialVersionUID = -5888231162358116515L;
+
+ private String type;
+
+ private boolean nullable = true;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private String srid;
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ @Override
+ public boolean isNullable() {
+ return nullable;
+ }
+
+ public void setNullable(final boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public void setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(final Integer precision) {
+ this.precision = precision;
+ }
+
+ @Override
+ public Integer getScale() {
+ return scale;
+ }
+
+ public void setScale(final Integer scale) {
+ this.scale = scale;
+ }
+
+ @Override
+ public String getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final String srid) {
+ this.srid = srid;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SchemaImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SchemaImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SchemaImpl.java
new file mode 100644
index 0000000..bce7261
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SchemaImpl.java
@@ -0,0 +1,181 @@
+/*
+ * 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.edm.xml.v4;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.EnumType;
+import org.apache.olingo.client.api.edm.xml.v4.Action;
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.Annotations;
+import org.apache.olingo.client.api.edm.xml.v4.ComplexType;
+import org.apache.olingo.client.api.edm.xml.v4.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.v4.EntityType;
+import org.apache.olingo.client.api.edm.xml.v4.Function;
+import org.apache.olingo.client.api.edm.xml.v4.Schema;
+import org.apache.olingo.client.api.edm.xml.v4.Term;
+import org.apache.olingo.client.api.edm.xml.v4.TypeDefinition;
+import org.apache.olingo.client.core.edm.xml.AbstractSchema;
+
+public class SchemaImpl extends AbstractSchema implements Schema {
+
+ private static final long serialVersionUID = 4453992249818796144L;
+
+ private final List<Action> actions = new ArrayList<Action>();
+
+ private final List<Annotations> annotationsList = new ArrayList<Annotations>();
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ private final List<ComplexType> complexTypes = new ArrayList<ComplexType>();
+
+ private EntityContainer entityContainer;
+
+ private final List<EnumType> enumTypes = new ArrayList<EnumType>();
+
+ private final List<EntityType> entityTypes = new ArrayList<EntityType>();
+
+ private final List<Function> functions = new ArrayList<Function>();
+
+ private final List<Term> terms = new ArrayList<Term>();
+
+ private final List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>();
+
+ private Annotation annotation;
+
+ @Override
+ public List<Action> getActions() {
+ return actions;
+ }
+
+ @Override
+ public List<Action> getActions(final String name) {
+ return getAllByName(name, getActions());
+ }
+
+ @Override
+ public List<Annotations> getAnnotationsList() {
+ return annotationsList;
+ }
+
+ @Override
+ public Annotations getAnnotationsList(final String target) {
+ Annotations result = null;
+ for (Annotations annots : getAnnotationsList()) {
+ if (target.equals(annots.getTarget())) {
+ result = annots;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+ @Override
+ public List<Function> getFunctions() {
+ return functions;
+ }
+
+ @Override
+ public List<Function> getFunctions(final String name) {
+ return getAllByName(name, getFunctions());
+ }
+
+ @Override
+ public List<Term> getTerms() {
+ return terms;
+ }
+
+ @Override
+ public TypeDefinition getTypeDefinition(final String name) {
+ return getOneByName(name, getTypeDefinitions());
+ }
+
+ @Override
+ public List<TypeDefinition> getTypeDefinitions() {
+ return typeDefinitions;
+ }
+
+ @Override
+ public EntityContainer getEntityContainer() {
+ return entityContainer;
+ }
+
+ public void setEntityContainer(final EntityContainerImpl entityContainer) {
+ this.entityContainer = entityContainer;
+ }
+
+ @Override
+ public List<EntityContainer> getEntityContainers() {
+ return entityContainer == null
+ ? Collections.<EntityContainer>emptyList() : Collections.singletonList(entityContainer);
+ }
+
+ @Override
+ public EntityContainer getDefaultEntityContainer() {
+ return entityContainer;
+ }
+
+ @Override
+ public EntityContainer getEntityContainer(final String name) {
+ if (entityContainer != null && name.equals(entityContainer.getName())) {
+ return entityContainer;
+ }
+ return null;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+ @Override
+ public List<EnumType> getEnumTypes() {
+ return enumTypes;
+ }
+
+ @Override
+ public ComplexType getComplexType(final String name) {
+ return (ComplexType) super.getComplexType(name);
+ }
+
+ @Override
+ public List<ComplexType> getComplexTypes() {
+ return complexTypes;
+ }
+
+ @Override
+ public EntityType getEntityType(final String name) {
+ return (EntityType) super.getEntityType(name);
+ }
+
+ @Override
+ public List<EntityType> getEntityTypes() {
+ return entityTypes;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonDeserializer.java
new file mode 100644
index 0000000..d97dcd4
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonDeserializer.java
@@ -0,0 +1,59 @@
+/*
+ * 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.edm.xml.v4;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class SingletonDeserializer extends AbstractEdmDeserializer<SingletonImpl> {
+
+ @Override
+ protected SingletonImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final SingletonImpl singleton = new SingletonImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ singleton.setName(jp.nextTextValue());
+ } else if ("Type".equals(jp.getCurrentName())) {
+ singleton.setEntityType(jp.nextTextValue());
+ } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ singleton.getNavigationPropertyBindings().add(
+ jp.readValueAs(NavigationPropertyBindingImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ singleton.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return singleton;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonImpl.java
new file mode 100644
index 0000000..9766abd
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonImpl.java
@@ -0,0 +1,63 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.NavigationPropertyBinding;
+import org.apache.olingo.client.api.edm.xml.v4.Singleton;
+
+@JsonDeserialize(using = SingletonDeserializer.class)
+public class SingletonImpl extends AbstractAnnotatedEdmItem implements Singleton {
+
+ private static final long serialVersionUID = 941802518279658559L;
+
+ private String name;
+
+ private String entityType;
+
+ private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getEntityType() {
+ return entityType;
+ }
+
+ public void setEntityType(final String entityType) {
+ this.entityType = entityType;
+ }
+
+ @Override
+ public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
+ return navigationPropertyBindings;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java
new file mode 100644
index 0000000..9d4e803
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java
@@ -0,0 +1,77 @@
+/*
+ * 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.edm.xml.v4;
+
+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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.edm.xml.v4.CSDLElement;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class TermDeserializer extends AbstractEdmDeserializer<TermImpl> {
+
+ @Override
+ protected TermImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final TermImpl term = new TermImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ term.setName(jp.nextTextValue());
+ } else if ("Type".equals(jp.getCurrentName())) {
+ term.setType(jp.nextTextValue());
+ } else if ("BaseTerm".equals(jp.getCurrentName())) {
+ term.setBaseTerm(jp.nextTextValue());
+ } else if ("DefaultValue".equals(jp.getCurrentName())) {
+ term.setDefaultValue(jp.nextTextValue());
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ term.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ term.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ term.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ term.setScale(Integer.valueOf(jp.nextTextValue()));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ term.setSrid(jp.nextTextValue());
+ } else if ("AppliesTo".equals(jp.getCurrentName())) {
+ for (String split : StringUtils.split(jp.nextTextValue())) {
+ term.getAppliesTo().add(CSDLElement.valueOf(split));
+ }
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ term.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return term;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermImpl.java
new file mode 100644
index 0000000..d210ddc
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermImpl.java
@@ -0,0 +1,140 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.CSDLElement;
+import org.apache.olingo.client.api.edm.xml.v4.Term;
+
+@JsonDeserialize(using = TermDeserializer.class)
+public class TermImpl extends AbstractAnnotatedEdmItem implements Term {
+
+ private static final long serialVersionUID = -5888231162358116515L;
+
+ private String name;
+
+ private String type;
+
+ private String baseTerm;
+
+ private String defaultValue;
+
+ private boolean nullable = true;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private String srid;
+
+ private final List<CSDLElement> appliesTo = new ArrayList<CSDLElement>();
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ @Override
+ public String getBaseTerm() {
+ return baseTerm;
+ }
+
+ public void setBaseTerm(final String baseTerm) {
+ this.baseTerm = baseTerm;
+ }
+
+ @Override
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ public void setDefaultValue(final String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public boolean isNullable() {
+ return nullable;
+ }
+
+ public void setNullable(final boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public void setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(final Integer precision) {
+ this.precision = precision;
+ }
+
+ @Override
+ public Integer getScale() {
+ return scale;
+ }
+
+ public void setScale(final Integer scale) {
+ this.scale = scale;
+ }
+
+ @Override
+ public String getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final String srid) {
+ this.srid = srid;
+ }
+
+ @Override
+ public List<CSDLElement> getAppliesTo() {
+ return appliesTo;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
new file mode 100644
index 0000000..f951c77
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
@@ -0,0 +1,66 @@
+/*
+ * 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.edm.xml.v4;
+
+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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class TypeDefinitionDeserializer extends AbstractEdmDeserializer<TypeDefinitionImpl> {
+
+ @Override
+ protected TypeDefinitionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final TypeDefinitionImpl typeDefinition = new TypeDefinitionImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ typeDefinition.setName(jp.nextTextValue());
+ } else if ("UnderlyingType".equals(jp.getCurrentName())) {
+ typeDefinition.setUnderlyingType(jp.nextTextValue());
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ typeDefinition.setMaxLength(jp.nextIntValue(0));
+ } else if ("Unicode".equals(jp.getCurrentName())) {
+ typeDefinition.setUnicode(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ typeDefinition.setPrecision(jp.nextIntValue(0));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ typeDefinition.setScale(jp.nextIntValue(0));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ typeDefinition.setSrid(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ typeDefinition.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return typeDefinition;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionImpl.java
new file mode 100644
index 0000000..b1ecc66
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionImpl.java
@@ -0,0 +1,119 @@
+/*
+ * 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.edm.xml.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.TypeDefinition;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+@JsonDeserialize(using = TypeDefinitionDeserializer.class)
+public class TypeDefinitionImpl extends AbstractEdmItem implements TypeDefinition {
+
+ private static final long serialVersionUID = -5888231162358116515L;
+
+ private String name;
+
+ private String underlyingType;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private boolean unicode = true;
+
+ private String srid;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getUnderlyingType() {
+ return underlyingType;
+ }
+
+ public void setUnderlyingType(final String underlyingType) {
+ this.underlyingType = underlyingType;
+ }
+
+ @Override
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public void setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ }
+
+ @Override
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(final Integer precision) {
+ this.precision = precision;
+ }
+
+ @Override
+ public Integer getScale() {
+ return scale;
+ }
+
+ public void setScale(final Integer scale) {
+ this.scale = scale;
+ }
+
+ @Override
+ public boolean isUnicode() {
+ return unicode;
+ }
+
+ public void setUnicode(final boolean unicode) {
+ this.unicode = unicode;
+ }
+
+ @Override
+ public String getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final String srid) {
+ this.srid = srid;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/XMLMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/XMLMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/XMLMetadataImpl.java
new file mode 100644
index 0000000..41fea80
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/XMLMetadataImpl.java
@@ -0,0 +1,56 @@
+/*
+ * 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.edm.xml.v4;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.Edmx;
+import org.apache.olingo.client.api.edm.xml.v4.Reference;
+import org.apache.olingo.client.api.edm.xml.v4.Schema;
+import org.apache.olingo.client.api.edm.xml.v4.XMLMetadata;
+import org.apache.olingo.client.core.edm.xml.AbstractXMLMetadata;
+
+public class XMLMetadataImpl extends AbstractXMLMetadata implements XMLMetadata {
+
+ private static final long serialVersionUID = -7765327879691528010L;
+
+ public XMLMetadataImpl(final EdmxImpl edmx) {
+ super(edmx);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<Schema> getSchemas() {
+ return (List<Schema>) super.getSchemas();
+ }
+
+ @Override
+ public Schema getSchema(final int index) {
+ return (Schema) super.getSchema(index);
+ }
+
+ @Override
+ public Schema getSchema(final String key) {
+ return (Schema) super.getSchema(key);
+ }
+
+ public List<Reference> getReferences() {
+ return ((Edmx) this.edmx).getReferences();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java
new file mode 100644
index 0000000..c60f2ff
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.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.edm.xml.v4.annotation;
+
+/**
+ * Groups dynamic expressions that may be provided using element notation or attribute notation.
+ */
+abstract class AbstractElOrAttrConstruct extends DynExprConstructImpl {
+
+ private static final long serialVersionUID = 5503275111425750339L;
+
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(final String value) {
+ this.value = value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java
new file mode 100644
index 0000000..c3eca11
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java
@@ -0,0 +1,38 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import org.apache.olingo.client.api.edm.xml.v4.AnnotatedEdmItem;
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+
+abstract class AnnotatedDynExprConstruct extends DynExprConstructImpl implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = -8117155475397749038L;
+
+ private Annotation annotation;
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotationPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotationPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotationPath.java
new file mode 100644
index 0000000..50274b5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/AnnotationPath.java
@@ -0,0 +1,25 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+public class AnnotationPath extends AbstractElOrAttrConstruct {
+
+ private static final long serialVersionUID = 6198019768659098819L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Apply.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Apply.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Apply.java
new file mode 100644
index 0000000..9c02f97
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Apply.java
@@ -0,0 +1,55 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.ExprConstruct;
+
+@JsonDeserialize(using = ApplyDeserializer.class)
+public class Apply extends AnnotatedDynExprConstruct {
+
+ private static final long serialVersionUID = 6198019768659098819L;
+
+ public static final String CANONICAL_FUNCTION_CONCAT = "odata.concat";
+
+ public static final String CANONICAL_FUNCTION_FILLURITEMPLATE = "odata.fillUriTemplate";
+
+ public static final String CANONICAL_FUNCTION_URIENCODE = "odata.uriEncode";
+
+ private String function;
+
+ private final List<ExprConstruct> parameters = new ArrayList<ExprConstruct>();
+
+ public String getFunction() {
+ return function;
+ }
+
+ public void setFunction(final String function) {
+ this.function = function;
+ }
+
+ public List<ExprConstruct> getParameters() {
+ return parameters;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
new file mode 100644
index 0000000..e847c9d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
@@ -0,0 +1,57 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class ApplyDeserializer extends AbstractEdmDeserializer<Apply> {
+
+ @Override
+ protected Apply doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final Apply apply = new Apply();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Function".equals(jp.getCurrentName())) {
+ apply.setFunction(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ apply.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ } else if (isAnnotationConstExprConstruct(jp)) {
+ apply.getParameters().add(parseAnnotationConstExprConstruct(jp));
+ } else {
+ apply.getParameters().add(jp.readValueAs(DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return apply;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Cast.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Cast.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Cast.java
new file mode 100644
index 0000000..812602e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Cast.java
@@ -0,0 +1,92 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+@JsonDeserialize(using = CastDeserializer.class)
+public class Cast extends AnnotatedDynExprConstruct {
+
+ private static final long serialVersionUID = -7836626668653004926L;
+
+ private String type;
+
+ private String maxLength;
+
+ private BigInteger precision;
+
+ private BigInteger scale;
+
+ private String srid;
+
+ private DynExprConstruct value;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public String getMaxLength() {
+ return maxLength;
+ }
+
+ public void setMaxLength(final String maxLength) {
+ this.maxLength = maxLength;
+ }
+
+ public BigInteger getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(final BigInteger precision) {
+ this.precision = precision;
+ }
+
+ public BigInteger getScale() {
+ return scale;
+ }
+
+ public void setScale(final BigInteger scale) {
+ this.scale = scale;
+ }
+
+ public String getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final String srid) {
+ this.srid = srid;
+ }
+
+ public DynExprConstruct getValue() {
+ return value;
+ }
+
+ public void setValue(final DynExprConstruct value) {
+ this.value = value;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java
new file mode 100644
index 0000000..b143d70
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java
@@ -0,0 +1,64 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+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 java.io.IOException;
+import java.math.BigInteger;
+
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class CastDeserializer extends AbstractEdmDeserializer<Cast> {
+
+ @Override
+ protected Cast doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final Cast cast = new Cast();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Type".equals(jp.getCurrentName())) {
+ cast.setType(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ cast.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ cast.setMaxLength(jp.nextTextValue());
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ cast.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L)));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ cast.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ cast.setSrid(jp.nextTextValue());
+ } else {
+ cast.setValue(jp.readValueAs(DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return cast;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Collection.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Collection.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Collection.java
new file mode 100644
index 0000000..c225043
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Collection.java
@@ -0,0 +1,39 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.ExprConstruct;
+
+@JsonDeserialize(using = CollectionDeserializer.class)
+public class Collection extends DynExprConstructImpl {
+
+ private static final long serialVersionUID = -4975881520695477686L;
+
+ private final List<ExprConstruct> items = new ArrayList<ExprConstruct>();
+
+ public List<ExprConstruct> getItems() {
+ return items;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
new file mode 100644
index 0000000..3916f8d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
@@ -0,0 +1,52 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class CollectionDeserializer extends AbstractEdmDeserializer<Collection> {
+
+ @Override
+ protected Collection doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final Collection collection = new Collection();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if (isAnnotationConstExprConstruct(jp)) {
+ collection.getItems().add(parseAnnotationConstExprConstruct(jp));
+ } else {
+ collection.getItems().add(jp.readValueAs( DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return collection;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java
new file mode 100644
index 0000000..7af136c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java
@@ -0,0 +1,51 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.ConstExprConstruct;
+
+public class ConstExprConstructImpl extends ExprConstructImpl implements ConstExprConstruct {
+
+ private static final long serialVersionUID = 2250072064504668969L;
+
+ private Type type;
+
+ private String value;
+
+ @Override
+ public Type getType() {
+ return type;
+ }
+
+ @Override
+ public void setType(final Type type) {
+ this.type = type;
+ }
+
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(final String value) {
+ this.value = value;
+ }
+
+}
[12/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBinary.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBinary.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBinary.java
deleted file mode 100644
index f86b9fd..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBinary.java
+++ /dev/null
@@ -1,117 +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.commons.core.edm.primitivetype;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Binary.
- */
-public class EdmBinary extends SingletonPrimitiveType {
-
- private static final EdmBinary INSTANCE = new EdmBinary();
-
- {
- uriPrefix = "binary'";
- uriSuffix = "'";
- }
-
- public static EdmBinary getInstance() {
- return INSTANCE;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return byte[].class;
- }
-
- @Override
- public boolean validate(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) {
-
- return value == null
- ? isNullable == null || isNullable
- : Base64.isBase64(value) && validateMaxLength(value, maxLength);
- }
-
- private static boolean validateMaxLength(final String value, final Integer maxLength) {
- return maxLength == null ? true
- : // Every three bytes are represented as four base-64 characters.
- // Additionally, there could be up to two padding "=" characters
- // if the number of bytes is not a multiple of three.
- maxLength >= value.length() * 3 / 4 - (value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0);
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- if (!Base64.isBase64(value)) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
- if (!validateMaxLength(value, maxLength)) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
-
- final byte[] result = Base64.decodeBase64(value);
-
- if (returnType.isAssignableFrom(byte[].class)) {
- return returnType.cast(result);
- } else if (returnType.isAssignableFrom(Byte[].class)) {
- final Byte[] byteArray = new Byte[result.length];
- for (int i = 0; i < result.length; i++) {
- byteArray[i] = result[i];
- }
- return returnType.cast(byteArray);
- } else {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- byte[] byteArrayValue;
- if (value instanceof byte[]) {
- byteArrayValue = (byte[]) value;
- } else if (value instanceof Byte[]) {
- final int length = ((Byte[]) value).length;
- byteArrayValue = new byte[length];
- for (int i = 0; i < length; i++) {
- byteArrayValue[i] = ((Byte[]) value)[i].byteValue();
- }
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
-
- if (maxLength != null && byteArrayValue.length > maxLength) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
-
- return Base64.encodeBase64URLSafeString(byteArrayValue);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBoolean.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBoolean.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBoolean.java
deleted file mode 100644
index e324000..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBoolean.java
+++ /dev/null
@@ -1,81 +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.commons.core.edm.primitivetype;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Boolean.
- */
-public final class EdmBoolean extends SingletonPrimitiveType {
-
- private static final EdmBoolean INSTANCE = new EdmBoolean();
-
- public static EdmBoolean getInstance() {
- return INSTANCE;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Boolean.class;
- }
-
- @Override
- public boolean validate(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) {
-
- return value == null ? isNullable == null || isNullable : validateLiteral(value);
- }
-
- private static boolean validateLiteral(final String value) {
- return "true".equals(value) || "false".equals(value);
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- if (validateLiteral(value)) {
- if (returnType.isAssignableFrom(Boolean.class)) {
- return returnType.cast(Boolean.valueOf("true".equals(value)));
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
- }
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- if (value instanceof Boolean) {
- return Boolean.toString((Boolean) value);
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmByte.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmByte.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmByte.java
deleted file mode 100644
index 711e9fa..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmByte.java
+++ /dev/null
@@ -1,101 +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.commons.core.edm.primitivetype;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Byte.
- */
-public final class EdmByte extends SingletonPrimitiveType {
-
- private static final EdmByte INSTANCE = new EdmByte();
-
- public static EdmByte getInstance() {
- return INSTANCE;
- }
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return primitiveType instanceof Uint7
- || primitiveType instanceof EdmByte;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Short.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- Short valueShort;
- try {
- valueShort = Short.parseShort(value);
- } catch (final NumberFormatException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
- }
- if (valueShort < 0 || valueShort >= 1 << Byte.SIZE) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
-
- try {
- return EdmInt64.convertNumber(valueShort, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) {
- if (((Number) value).longValue() >= 0 && ((Number) value).longValue() < 1 << Byte.SIZE) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else if (value instanceof BigInteger) {
- if (((BigInteger) value).compareTo(BigInteger.ZERO) >= 0
- && ((BigInteger) value).compareTo(BigInteger.valueOf(1 << Byte.SIZE)) < 0) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDate.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDate.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDate.java
deleted file mode 100644
index e13fb7b..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDate.java
+++ /dev/null
@@ -1,95 +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.commons.core.edm.primitivetype;
-
-import java.util.Calendar;
-import java.util.TimeZone;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Date.
- */
-public final class EdmDate extends SingletonPrimitiveType {
-
- private static final Pattern PATTERN = Pattern.compile("(-?\\p{Digit}{4,})-(\\p{Digit}{2})-(\\p{Digit}{2})");
-
- private static final EdmDate INSTANCE = new EdmDate();
-
- public static EdmDate getInstance() {
- return INSTANCE;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Calendar.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- final Calendar dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
- dateTimeValue.clear();
-
- final Matcher matcher = PATTERN.matcher(value);
- if (!matcher.matches()) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
-
- dateTimeValue.set(
- Integer.parseInt(matcher.group(1)),
- Byte.parseByte(matcher.group(2)) - 1, // month is zero-based
- Byte.parseByte(matcher.group(3)));
-
- try {
- return EdmDateTimeOffset.convertDateTime(dateTimeValue, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- final Calendar dateTimeValue = EdmDateTimeOffset.createDateTime(value);
-
- final StringBuilder result = new StringBuilder(10); // Ten characters are enough for "normal" dates.
- final int year = dateTimeValue.get(Calendar.YEAR);
- if (year < 0 || year >= 10000) {
- result.append(year);
- } else {
- EdmDateTimeOffset.appendTwoDigits(result, (year / 100) % 100);
- EdmDateTimeOffset.appendTwoDigits(result, year % 100);
- }
- result.append('-');
- EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.MONTH) + 1); // month is zero-based
- result.append('-');
- EdmDateTimeOffset.appendTwoDigits(result, dateTimeValue.get(Calendar.DAY_OF_MONTH));
- return result.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTimeOffset.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTimeOffset.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTimeOffset.java
deleted file mode 100644
index d7c5ba8..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTimeOffset.java
+++ /dev/null
@@ -1,239 +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.commons.core.edm.primitivetype;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type DateTimeOffset.
- */
-public final class EdmDateTimeOffset extends SingletonPrimitiveType {
-
- private static final Pattern PATTERN = Pattern.compile(
- "(-?\\p{Digit}{4,})-(\\p{Digit}{2})-(\\p{Digit}{2})"
- + "T(\\p{Digit}{2}):(\\p{Digit}{2})(?::(\\p{Digit}{2})(\\.(\\p{Digit}{0,3}?)0*)?)?"
- + "(Z|([-+]\\p{Digit}{2}:\\p{Digit}{2}))?");
-
- private static final EdmDateTimeOffset INSTANCE = new EdmDateTimeOffset();
-
- public static EdmDateTimeOffset getInstance() {
- return INSTANCE;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Calendar.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- final Matcher matcher = PATTERN.matcher(value);
- if (!matcher.matches()) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
-
- final String timeZoneOffset = matcher.group(9) != null && matcher.group(10) != null
- && !matcher.group(10).matches("[-+]0+:0+") ? matcher.group(10) : null;
- final Calendar dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT" + timeZoneOffset));
- if (dateTimeValue.get(Calendar.ZONE_OFFSET) == 0 && timeZoneOffset != null) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
- dateTimeValue.clear();
-
- dateTimeValue.set(
- Short.parseShort(matcher.group(1)),
- Byte.parseByte(matcher.group(2)) - 1, // month is zero-based
- Byte.parseByte(matcher.group(3)),
- Byte.parseByte(matcher.group(4)),
- Byte.parseByte(matcher.group(5)),
- matcher.group(6) == null ? 0 : Byte.parseByte(matcher.group(6)));
-
- if (matcher.group(7) != null) {
- if (matcher.group(7).length() == 1 || matcher.group(7).length() > 13) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
- final String decimals = matcher.group(8);
- if (decimals.length() > (precision == null ? 0 : precision)) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
- final String milliSeconds = decimals + "000".substring(decimals.length());
- dateTimeValue.set(Calendar.MILLISECOND, Short.parseShort(milliSeconds));
- }
-
- try {
- return convertDateTime(dateTimeValue, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- /**
- * Converts a {@link Calendar} value into the requested return type if possible.
- *
- * @param dateTimeValue the value
- * @param returnType the class of the returned value; it must be one of {@link Calendar}, {@link Long}, or
- * {@link Date}
- * @return the converted value
- * @throws IllegalArgumentException if the Calendar value is not valid
- * @throws ClassCastException if the return type is not allowed
- */
- protected static <T> T convertDateTime(final Calendar dateTimeValue, final Class<T> returnType)
- throws IllegalArgumentException, ClassCastException {
-
- // The Calendar class does not check any values until a get method is called,
- // so we do just that to validate the fields that may have been set,
- // not because we want to return something else.
- // For strict checks, the lenient mode is switched off.
- dateTimeValue.setLenient(false);
-
- if (returnType.isAssignableFrom(Calendar.class)) {
- // Ensure that all fields are recomputed.
- dateTimeValue.get(Calendar.MILLISECOND); // may throw IllegalArgumentException
- // Reset the lenient mode to its default.
- dateTimeValue.setLenient(true);
- return returnType.cast(dateTimeValue);
- } else if (returnType.isAssignableFrom(Long.class)) {
- return returnType.cast(dateTimeValue.getTimeInMillis()); // may throw IllegalArgumentException
- } else if (returnType.isAssignableFrom(Date.class)) {
- return returnType.cast(dateTimeValue.getTime()); // may throw IllegalArgumentException
- } else {
- throw new ClassCastException("unsupported return type " + returnType.getSimpleName());
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- final Calendar dateTimeValue = createDateTime(value);
-
- final StringBuilder result = new StringBuilder(23); // 23 characters are enough for millisecond precision.
- final int year = dateTimeValue.get(Calendar.YEAR);
- appendTwoDigits(result, year / 100);
- appendTwoDigits(result, year % 100);
- result.append('-');
- appendTwoDigits(result, dateTimeValue.get(Calendar.MONTH) + 1); // month is zero-based
- result.append('-');
- appendTwoDigits(result, dateTimeValue.get(Calendar.DAY_OF_MONTH));
- result.append('T');
- appendTwoDigits(result, dateTimeValue.get(Calendar.HOUR_OF_DAY));
- result.append(':');
- appendTwoDigits(result, dateTimeValue.get(Calendar.MINUTE));
- result.append(':');
- appendTwoDigits(result, dateTimeValue.get(Calendar.SECOND));
-
- try {
- appendMilliseconds(result, dateTimeValue.get(Calendar.MILLISECOND), precision);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets), e");
- }
-
- final int offsetInMinutes = (dateTimeValue.get(Calendar.ZONE_OFFSET)
- + dateTimeValue.get(Calendar.DST_OFFSET)) / 60 / 1000;
- final int offsetHours = offsetInMinutes / 60;
- final int offsetMinutes = Math.abs(offsetInMinutes % 60);
- final String offsetString = offsetInMinutes == 0 ? "Z" : String.format("%+03d:%02d", offsetHours, offsetMinutes);
- result.append(offsetString);
-
- return result.toString();
- }
-
- /**
- * Creates a date/time value from the given value.
- *
- * @param value the value as {@link Calendar}, {@link Date}, or {@link Long}
- * @return the value as {@link Calendar}
- * @throws EdmPrimitiveTypeException if the type of the value is not supported
- */
- protected static <T> Calendar createDateTime(final T value) throws EdmPrimitiveTypeException {
- Calendar dateTimeValue;
- if (value instanceof Date) {
- // Although java.util.Date, as stated in its documentation,
- // "is intended to reflect coordinated universal time (UTC)",
- // its toString() method uses the default time zone. And so do we.
- dateTimeValue = Calendar.getInstance();
- dateTimeValue.setTime((Date) value);
- } else if (value instanceof Calendar) {
- dateTimeValue = (Calendar) ((Calendar) value).clone();
- } else if (value instanceof Long) {
- dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
- dateTimeValue.setTimeInMillis((Long) value);
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- return dateTimeValue;
- }
-
- /**
- * Appends the given number to the given string builder, assuming that the number has at most two digits,
- * performance-optimized.
- *
- * @param result a {@link StringBuilder}
- * @param number an integer that must satisfy <code>0 <= number <= 99</code>
- */
- protected static void appendTwoDigits(final StringBuilder result, final int number) {
- result.append((char) ('0' + number / 10));
- result.append((char) ('0' + number % 10));
- }
-
- /**
- * Appends the given number of milliseconds to the given string builder, assuming that the number has at most three
- * digits, performance-optimized.
- *
- * @param result a {@link StringBuilder}
- * @param milliseconds an integer that must satisfy <code>0 <= milliseconds <= 999</code>
- * @param precision the upper limit for decimal digits (optional, defaults to zero)
- */
- protected static void appendMilliseconds(final StringBuilder result, final long milliseconds,
- final Integer precision) throws IllegalArgumentException {
- final int digits = milliseconds % 1000 == 0 ? 0 : milliseconds % 100 == 0 ? 1 : milliseconds % 10 == 0 ? 2 : 3;
- if (digits > 0) {
- result.append('.');
- for (int d = 100; d > 0; d /= 10) {
- final byte digit = (byte) (milliseconds % (d * 10) / d);
- if (digit > 0 || milliseconds % d > 0) {
- result.append((char) ('0' + digit));
- }
- }
-
- if (precision == null || precision < digits) {
- throw new IllegalArgumentException();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDecimal.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDecimal.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDecimal.java
deleted file mode 100644
index 895d7e5..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDecimal.java
+++ /dev/null
@@ -1,200 +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.commons.core.edm.primitivetype;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Decimal.
- */
-public final class EdmDecimal extends SingletonPrimitiveType {
-
- private static final Pattern PATTERN = Pattern.compile("(?:\\+|-)?(?:0*(\\p{Digit}+?))(?:\\.(\\p{Digit}+?)0*)?");
-
- private static final EdmDecimal INSTANCE = new EdmDecimal();
-
- public static EdmDecimal getInstance() {
- return INSTANCE;
- }
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return primitiveType instanceof Uint7
- || primitiveType instanceof EdmByte
- || primitiveType instanceof EdmSByte
- || primitiveType instanceof EdmInt16
- || primitiveType instanceof EdmInt32
- || primitiveType instanceof EdmInt64
- || primitiveType instanceof EdmSingle
- || primitiveType instanceof EdmDouble
- || primitiveType instanceof EdmDecimal;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return BigDecimal.class;
- }
-
- @Override
- public boolean validate(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) {
-
- return value == null
- ? isNullable == null || isNullable
- : validateLiteral(value) && validatePrecisionAndScale(value, precision, scale);
- }
-
- private static boolean validateLiteral(final String value) {
- return PATTERN.matcher(value).matches();
- }
-
- private static final boolean validatePrecisionAndScale(final String value, final Integer precision,
- final Integer scale) {
-
- final Matcher matcher = PATTERN.matcher(value);
- matcher.matches();
- final int significantIntegerDigits = matcher.group(1).equals("0") ? 0 : matcher.group(1).length();
- final int decimals = matcher.group(2) == null ? 0 : matcher.group(2).length();
- return (precision == null || precision >= significantIntegerDigits + decimals)
- && (decimals <= (scale == null ? 0 : scale));
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- if (!validateLiteral(value)) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
- if (!validatePrecisionAndScale(value, precision, scale)) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
-
- try {
- return convertDecimal(new BigDecimal(value), returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- /**
- * Converts a {@link BigDecimal} value into the requested return type if possible.
- *
- * @param value the value
- * @param returnType the class of the returned value; it must be one of {@link BigDecimal}, {@link Double},
- * {@link Float}, {@link BigInteger}, {@link Long}, {@link Integer}, {@link Short}, or {@link Byte}
- * @return the converted value
- * @throws IllegalArgumentException if the conversion is not possible or would lead to loss of data
- * @throws ClassCastException if the return type is not allowed
- */
- protected static <T> T convertDecimal(final BigDecimal value, final Class<T> returnType)
- throws IllegalArgumentException, ClassCastException {
-
- if (returnType.isAssignableFrom(BigDecimal.class)) {
- return returnType.cast(value);
- } else if (returnType.isAssignableFrom(Double.class)) {
- final double doubleValue = value.doubleValue();
- if (BigDecimal.valueOf(doubleValue).compareTo(value) == 0) {
- return returnType.cast(doubleValue);
- } else {
- throw new IllegalArgumentException();
- }
- } else if (returnType.isAssignableFrom(Float.class)) {
- final Float floatValue = value.floatValue();
- if (BigDecimal.valueOf(floatValue).compareTo(value) == 0) {
- return returnType.cast(floatValue);
- } else {
- throw new IllegalArgumentException();
- }
- } else {
- try {
- if (returnType.isAssignableFrom(BigInteger.class)) {
- return returnType.cast(value.toBigIntegerExact());
- } else if (returnType.isAssignableFrom(Long.class)) {
- return returnType.cast(value.longValueExact());
- } else if (returnType.isAssignableFrom(Integer.class)) {
- return returnType.cast(value.intValueExact());
- } else if (returnType.isAssignableFrom(Short.class)) {
- return returnType.cast(value.shortValueExact());
- } else if (returnType.isAssignableFrom(Byte.class)) {
- return returnType.cast(value.byteValueExact());
- } else {
- throw new ClassCastException("unsupported return type " + returnType.getSimpleName());
- }
- } catch (final ArithmeticException e) {
- throw new IllegalArgumentException(e);
- }
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- String result;
- if (value instanceof Long || value instanceof Integer || value instanceof Short
- || value instanceof Byte || value instanceof BigInteger) {
- result = value.toString();
- final int digits = result.startsWith("-") ? result.length() - 1 : result.length();
- if (precision != null && precision < digits) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
-
- } else if (value instanceof Double || value instanceof Float || value instanceof BigDecimal) {
- BigDecimal bigDecimalValue;
- try {
- bigDecimalValue = value instanceof Double ? BigDecimal.valueOf((Double) value)
- : value instanceof Float ? BigDecimal.valueOf((Float) value) : (BigDecimal) value;
- } catch (final NumberFormatException e) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)", e);
- }
-
- final int digits = bigDecimalValue.scale() >= 0
- ? Math.max(bigDecimalValue.precision(), bigDecimalValue.scale())
- : bigDecimalValue.precision() - bigDecimalValue.scale();
- if ((precision == null || precision >= digits) && (bigDecimalValue.scale() <= (scale == null ? 0 : scale))) {
- result = bigDecimalValue.toPlainString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
-
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
-
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDouble.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDouble.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDouble.java
deleted file mode 100644
index f5f46b3..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDouble.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.commons.core.edm.primitivetype;
-
-import java.math.BigDecimal;
-import java.util.regex.Pattern;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Double.
- */
-public final class EdmDouble extends SingletonPrimitiveType {
-
- protected static final String NEGATIVE_INFINITY = "-INF";
-
- protected static final String POSITIVE_INFINITY = "INF";
-
- protected static final String NaN = "NaN";
-
- private static final Pattern PATTERN = Pattern.compile(
- "(?:\\+|-)?\\p{Digit}{1,17}(?:\\.\\p{Digit}{1,17})?(?:(?:E|e)(?:\\+|-)?\\p{Digit}{1,3})?");
-
- private static final EdmDouble INSTANCE = new EdmDouble();
-
- public static EdmDouble getInstance() {
- return INSTANCE;
- }
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return primitiveType instanceof Uint7
- || primitiveType instanceof EdmByte
- || primitiveType instanceof EdmSByte
- || primitiveType instanceof EdmInt16
- || primitiveType instanceof EdmInt32
- || primitiveType instanceof EdmInt64
- || primitiveType instanceof EdmSingle
- || primitiveType instanceof EdmDouble;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Double.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- Double result = null;
- BigDecimal bigDecimalValue = null;
- // Handle special values first.
- if (value.equals(NEGATIVE_INFINITY)) {
- result = Double.NEGATIVE_INFINITY;
- } else if (value.equals(POSITIVE_INFINITY)) {
- result = Double.POSITIVE_INFINITY;
- } else if (value.equals(NaN)) {
- result = Double.NaN;
- } else {
- // Now only "normal" numbers remain.
- if (!PATTERN.matcher(value).matches()) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
-
- // The number format is checked above, so we don't have to catch NumberFormatException.
- bigDecimalValue = new BigDecimal(value);
- result = bigDecimalValue.doubleValue();
- // "Real" infinite values have been treated already above, so we can throw an exception
- // if the conversion to a double results in an infinite value.
- if (result.isInfinite() || BigDecimal.valueOf(result).compareTo(bigDecimalValue) != 0) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
- }
-
- if (returnType.isAssignableFrom(Double.class)) {
- return returnType.cast(result);
- } else if (result.isInfinite() || result.isNaN()) {
- if (returnType.isAssignableFrom(Float.class)) {
- return returnType.cast(result.floatValue());
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType)");
- }
- } else {
- try {
- return EdmDecimal.convertDecimal(bigDecimalValue, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
- if (value instanceof Long) {
- if (Math.abs((Long) value) < 1L << 51) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else if (value instanceof Integer || value instanceof Short || value instanceof Byte) {
- return value.toString();
- } else if (value instanceof Double) {
- return (Double) value == Double.NEGATIVE_INFINITY ? NEGATIVE_INFINITY
- : (Double) value == Double.POSITIVE_INFINITY ? POSITIVE_INFINITY : value.toString();
- } else if (value instanceof Float) {
- return (Float) value == Float.NEGATIVE_INFINITY ? NEGATIVE_INFINITY
- : (Float) value == Float.POSITIVE_INFINITY ? POSITIVE_INFINITY : value.toString();
- } else if (value instanceof BigDecimal) {
- final double doubleValue = ((BigDecimal) value).doubleValue();
- if (!Double.isInfinite(doubleValue) && BigDecimal.valueOf(doubleValue).compareTo((BigDecimal) value) == 0) {
- return ((BigDecimal) value).toString();
- } else {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDuration.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDuration.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDuration.java
deleted file mode 100644
index 538c74d..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDuration.java
+++ /dev/null
@@ -1,140 +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.commons.core.edm.primitivetype;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-public final class EdmDuration extends SingletonPrimitiveType {
-
- private static final Pattern PATTERN = Pattern.compile(
- "[-+]?P(?:(\\p{Digit}+)D)?(?:T(?:(\\p{Digit}+)H)?(?:(\\p{Digit}+)M)?"
- + "(?:(\\p{Digit}+(?:\\.(?:\\p{Digit}+?)0*)?)S)?)?");
-
- private static final EdmDuration INSTANCE = new EdmDuration();
-
- {
- uriPrefix = "duration'";
- uriSuffix = "'";
- }
-
- public static EdmDuration getInstance() {
- return INSTANCE;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return BigDecimal.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
- final Matcher matcher = PATTERN.matcher(value);
- if (!matcher.matches()
- || matcher.group(1) == null && matcher.group(2) == null && matcher.group(3) == null
- && matcher.group(4) == null) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(literal)");
- }
-
- BigDecimal result = (matcher.group(1) == null ? BigDecimal.ZERO
- : new BigDecimal(matcher.group(1)).multiply(BigDecimal.valueOf(24 * 60 * 60))).
- add(matcher.group(2) == null ? BigDecimal.ZERO
- : new BigDecimal(matcher.group(2)).multiply(BigDecimal.valueOf(60 * 60))).
- add(matcher.group(3) == null ? BigDecimal.ZERO
- : new BigDecimal(matcher.group(3)).multiply(BigDecimal.valueOf(60))).
- add(matcher.group(4) == null ? BigDecimal.ZERO : new BigDecimal(matcher.group(4)));
-
- if (result.scale() <= (precision == null ? 0 : precision)) {
- result = value.startsWith("-") ? result.negate() : result;
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(literal, facets)");
- }
-
- try {
- return EdmDecimal.convertDecimal(result, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- BigDecimal valueDecimal;
- if (value instanceof BigDecimal) {
- valueDecimal = (BigDecimal) value;
- } else if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) {
- valueDecimal = BigDecimal.valueOf(((Number) value).longValue());
- } else if (value instanceof BigInteger) {
- valueDecimal = new BigDecimal((BigInteger) value);
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
-
- if (valueDecimal.scale() > (precision == null ? 0 : precision)) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
- }
-
- final StringBuilder result = new StringBuilder();
- if (valueDecimal.signum() == -1) {
- result.append('-');
- valueDecimal = valueDecimal.negate();
- }
- result.append('P');
- BigInteger seconds = valueDecimal.toBigInteger();
- final BigInteger days = seconds.divide(BigInteger.valueOf(24 * 60 * 60));
- if (!days.equals(BigInteger.ZERO)) {
- result.append(days.toString());
- result.append('D');
- }
- result.append('T');
- seconds = seconds.subtract(days.multiply(BigInteger.valueOf(24 * 60 * 60)));
- final BigInteger hours = seconds.divide(BigInteger.valueOf(60 * 60));
- if (!hours.equals(BigInteger.ZERO)) {
- result.append(hours.toString());
- result.append('H');
- }
- seconds = seconds.subtract(hours.multiply(BigInteger.valueOf(60 * 60)));
- final BigInteger minutes = seconds.divide(BigInteger.valueOf(60));
- if (!minutes.equals(BigInteger.ZERO)) {
- result.append(minutes.toString());
- result.append('M');
- }
- result.append(valueDecimal.remainder(BigDecimal.valueOf(60)).toPlainString());
- result.append('S');
-
- return result.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmGuid.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmGuid.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmGuid.java
deleted file mode 100644
index cdcc0b8..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmGuid.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.commons.core.edm.primitivetype;
-
-import java.util.UUID;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Guid.
- */
-public final class EdmGuid extends SingletonPrimitiveType {
-
- private static final String PATTERN = "\\p{XDigit}{8}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{4}-\\p{XDigit}{12}";
-
- private static final EdmGuid INSTANCE = new EdmGuid();
-
- public static EdmGuid getInstance() {
- return INSTANCE;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return UUID.class;
- }
-
- @Override
- public boolean validate(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) {
- return value == null ? isNullable == null || isNullable : validateLiteral(value);
- }
-
- private boolean validateLiteral(final String value) {
- return value.matches(PATTERN);
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode,
- final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- UUID result;
- if (validateLiteral(value)) {
- result = UUID.fromString(value);
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
-
- if (returnType.isAssignableFrom(UUID.class)) {
- return returnType.cast(result);
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- if (value instanceof UUID) {
- return ((UUID) value).toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt16.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt16.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt16.java
deleted file mode 100644
index ee104cf..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt16.java
+++ /dev/null
@@ -1,99 +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.commons.core.edm.primitivetype;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Int16.
- */
-public final class EdmInt16 extends SingletonPrimitiveType {
-
- private static final EdmInt16 INSTANCE = new EdmInt16();
-
- public static EdmInt16 getInstance() {
- return INSTANCE;
- }
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return primitiveType instanceof Uint7
- || primitiveType instanceof EdmByte
- || primitiveType instanceof EdmSByte
- || primitiveType instanceof EdmInt16;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Short.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
- Short valueShort;
- try {
- valueShort = Short.parseShort(value);
- } catch (final NumberFormatException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
- }
-
- try {
- return EdmInt64.convertNumber(valueShort, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
- if (value instanceof Byte || value instanceof Short) {
- return value.toString();
- } else if (value instanceof Integer || value instanceof Long) {
- if (((Number) value).longValue() >= Short.MIN_VALUE
- && ((Number) value).longValue() <= Short.MAX_VALUE) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else if (value instanceof BigInteger) {
- if (((BigInteger) value).bitLength() < Short.SIZE) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt32.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt32.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt32.java
deleted file mode 100644
index 80b5313..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt32.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 org.apache.olingo.odata4.commons.core.edm.primitivetype;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Int32.
- */
-public final class EdmInt32 extends SingletonPrimitiveType {
-
- private static final EdmInt32 INSTANCE = new EdmInt32();
-
- public static EdmInt32 getInstance() {
- return INSTANCE;
- }
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return primitiveType instanceof Uint7
- || primitiveType instanceof EdmByte
- || primitiveType instanceof EdmSByte
- || primitiveType instanceof EdmInt16
- || primitiveType instanceof EdmInt32;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Integer.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- Integer valueInteger;
- try {
- valueInteger = Integer.parseInt(value);
- } catch (final NumberFormatException e) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
- }
-
- try {
- return EdmInt64.convertNumber(valueInteger, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- if (value instanceof Byte || value instanceof Short || value instanceof Integer) {
- return value.toString();
- } else if (value instanceof Long) {
- if ((Long) value >= Integer.MIN_VALUE && (Long) value <= Integer.MAX_VALUE) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else if (value instanceof BigInteger) {
- if (((BigInteger) value).bitLength() < Integer.SIZE) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt64.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt64.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt64.java
deleted file mode 100644
index 9661b2f..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmInt64.java
+++ /dev/null
@@ -1,135 +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.commons.core.edm.primitivetype;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Int64.
- */
-public final class EdmInt64 extends SingletonPrimitiveType {
-
- private static final EdmInt64 INSTANCE = new EdmInt64();
-
- public static EdmInt64 getInstance() {
- return INSTANCE;
- }
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return primitiveType instanceof Uint7
- || primitiveType instanceof EdmByte
- || primitiveType instanceof EdmSByte
- || primitiveType instanceof EdmInt16
- || primitiveType instanceof EdmInt32
- || primitiveType instanceof EdmInt64;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Long.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- Long valueLong;
- try {
- valueLong = Long.parseLong(value);
- } catch (final NumberFormatException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
- }
-
- try {
- return convertNumber(valueLong, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- /**
- * Converts a whole {@link Number} value into the requested return type if possible.
- *
- * @param value the value
- * @param returnType the class of the returned value; it must be one of {@link BigInteger}, {@link Long},
- * {@link Integer}, {@link Short}, or {@link Byte}
- * @return the converted value
- * @throws IllegalArgumentException if the conversion is not possible
- * @throws ClassCastException if the return type is not allowed
- */
- public static <T> T convertNumber(final Number value, final Class<T> returnType)
- throws IllegalArgumentException, ClassCastException {
-
- if (returnType.isAssignableFrom(Long.class)) {
- return returnType.cast(value.longValue());
- } else if (returnType.isAssignableFrom(BigInteger.class)) {
- return returnType.cast(BigInteger.valueOf(value.longValue()));
- } else if (returnType.isAssignableFrom(Byte.class)) {
- if (value.longValue() >= Byte.MIN_VALUE && value.longValue() <= Byte.MAX_VALUE) {
- return returnType.cast(value.byteValue());
- } else {
- throw new IllegalArgumentException();
- }
- } else if (returnType.isAssignableFrom(Short.class)) {
- if (value.longValue() >= Short.MIN_VALUE && value.longValue() <= Short.MAX_VALUE) {
- return returnType.cast(value.shortValue());
- } else {
- throw new IllegalArgumentException();
- }
- } else if (returnType.isAssignableFrom(Integer.class)) {
- if (value.longValue() >= Integer.MIN_VALUE && value.longValue() <= Integer.MAX_VALUE) {
- return returnType.cast(value.intValue());
- } else {
- throw new IllegalArgumentException();
- }
- } else {
- throw new ClassCastException("unsupported return type " + returnType.getSimpleName());
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) {
- return value.toString();
- } else if (value instanceof BigInteger) {
- if (((BigInteger) value).bitLength() < Long.SIZE) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmNull.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmNull.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmNull.java
deleted file mode 100644
index b5b43cc..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmNull.java
+++ /dev/null
@@ -1,75 +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.commons.core.edm.primitivetype;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-//TODO: Is this class still necessary?
-/**
- * Implementation of the simple type Null.
- */
-public final class EdmNull extends SingletonPrimitiveType {
-
- private static final EdmNull INSTANCE = new EdmNull();
-
- public static EdmNull getInstance() {
- return INSTANCE;
- }
-
- @Override
- public boolean equals(final Object obj) {
- return this == obj || obj == null;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return null;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- return null;
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- return null;
- }
-
- @Override
- public String toUriLiteral(final String literal) {
- return "null";
- }
-
- @Override
- public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmPrimitiveTypeKind.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmPrimitiveTypeKind.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmPrimitiveTypeKind.java
deleted file mode 100644
index 2b0b08f..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmPrimitiveTypeKind.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 org.apache.olingo.odata4.commons.core.edm.primitivetype;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-//TODO: Should we delete this typekind and use a facade?
-public enum EdmPrimitiveTypeKind {
-
- Binary, Boolean, Byte, Date, DateTimeOffset, Decimal, Double, Duration, Guid,
- Int16, Int32, Int64, SByte, Single, String, TimeOfDay;
-
- /**
- * Returns the {@link FullQualifiedName} for this type kind.
- *
- * @return {@link FullQualifiedName}
- */
- public FullQualifiedName getFullQualifiedName() {
- return new FullQualifiedName(EdmPrimitiveType.EDM_NAMESPACE, toString());
- }
-
- /**
- * Returns an instance for this {@link EdmPrimitiveTypeKind} in the form of {@link EdmPrimitiveType}.
- *
- * @return {@link EdmPrimitiveType} instance
- */
- public EdmPrimitiveType getEdmPrimitiveTypeInstance() {
- switch (this) {
- case Binary:
- return EdmBinary.getInstance();
- case Boolean:
- return EdmBoolean.getInstance();
- case Byte:
- return EdmByte.getInstance();
- case Date:
- return EdmDate.getInstance();
- case DateTimeOffset:
- return EdmDateTimeOffset.getInstance();
- case Decimal:
- return EdmDecimal.getInstance();
- case Double:
- return EdmDouble.getInstance();
- case Duration:
- return EdmDuration.getInstance();
- case Guid:
- return EdmGuid.getInstance();
- case Int16:
- return EdmInt16.getInstance();
- case Int32:
- return EdmInt32.getInstance();
- case Int64:
- return EdmInt64.getInstance();
- case SByte:
- return EdmSByte.getInstance();
- case Single:
- return EdmSingle.getInstance();
- case String:
- return EdmString.getInstance();
- case TimeOfDay:
- return EdmTimeOfDay.getInstance();
- default:
- throw new RuntimeException("Wrong type:" + this);
- }
- }
-
- /**
- * Gets <tt>EdmPrimitiveTypeKind</tt> from a full string (e.g. 'Edm.Int32').
- *
- * @param value string value type.
- * @return <tt>EdmPrimitiveTypeKind</tt> object.
- */
- public static EdmPrimitiveTypeKind fromString(final String value) {
- final String noNsValue = value.substring(4);
- for (EdmPrimitiveTypeKind edmSimpleType : EdmPrimitiveTypeKind.values()) {
- if (edmSimpleType.name().equals(noNsValue)) {
- return edmSimpleType;
- }
- }
- throw new IllegalArgumentException(value);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSByte.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSByte.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSByte.java
deleted file mode 100644
index 70ac12d..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSByte.java
+++ /dev/null
@@ -1,95 +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.commons.core.edm.primitivetype;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type SByte.
- */
-public final class EdmSByte extends SingletonPrimitiveType {
-
- private static final EdmSByte INSTANCE = new EdmSByte();
-
- public static EdmSByte getInstance() {
- return INSTANCE;
- }
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return primitiveType instanceof Uint7
- || primitiveType instanceof EdmSByte;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Byte.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- Byte valueByte;
- try {
- valueByte = Byte.parseByte(value);
- } catch (final NumberFormatException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
- }
-
- try {
- return EdmInt64.convertNumber(valueByte, returnType);
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- if (value instanceof Byte) {
- return value.toString();
- } else if (value instanceof Short || value instanceof Integer || value instanceof Long) {
- if (((Number) value).longValue() >= Byte.MIN_VALUE && ((Number) value).longValue() <= Byte.MAX_VALUE) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else if (value instanceof BigInteger) {
- if (((BigInteger) value).bitLength() < Byte.SIZE) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSingle.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSingle.java b/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSingle.java
deleted file mode 100644
index b2c0363..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmSingle.java
+++ /dev/null
@@ -1,148 +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.commons.core.edm.primitivetype;
-
-import java.math.BigDecimal;
-import java.util.regex.Pattern;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveTypeException;
-
-/**
- * Implementation of the EDM primitive type Single.
- */
-public final class EdmSingle extends SingletonPrimitiveType {
-
- private static final Pattern PATTERN = Pattern.compile(
- "(?:\\+|-)?\\p{Digit}{1,9}(?:\\.\\p{Digit}{1,9})?(?:(?:E|e)(?:\\+|-)?\\p{Digit}{1,2})?");
-
- private static final EdmSingle INSTANCE = new EdmSingle();
-
- public static EdmSingle getInstance() {
- return INSTANCE;
- }
-
- @Override
- public boolean isCompatible(final EdmPrimitiveType primitiveType) {
- return primitiveType instanceof Uint7
- || primitiveType instanceof EdmByte
- || primitiveType instanceof EdmSByte
- || primitiveType instanceof EdmInt16
- || primitiveType instanceof EdmInt32
- || primitiveType instanceof EdmInt64
- || primitiveType instanceof EdmSingle;
- }
-
- @Override
- public Class<?> getDefaultType() {
- return Float.class;
- }
-
- @Override
- protected <T> T internalValueOfString(final String value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
-
- Float result = null;
- BigDecimal bigDecimalValue = null;
- // Handle special values first.
- if (value.equals(EdmDouble.NEGATIVE_INFINITY)) {
- result = Float.NEGATIVE_INFINITY;
- } else if (value.equals(EdmDouble.POSITIVE_INFINITY)) {
- result = Float.POSITIVE_INFINITY;
- } else if (value.equals(EdmDouble.NaN)) {
- result = Float.NaN;
- } else {
- // Now only "normal" numbers remain.
- if (!PATTERN.matcher(value).matches()) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
-
- // The number format is checked above, so we don't have to catch NumberFormatException.
- bigDecimalValue = new BigDecimal(value);
- result = bigDecimalValue.floatValue();
- // "Real" infinite values have been treated already above, so we can throw an exception
- // if the conversion to a float results in an infinite value.
- if (result.isInfinite() || bigDecimalValue.compareTo(new BigDecimal(result.toString())) != 0) {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
- }
- }
-
- if (returnType.isAssignableFrom(Float.class)) {
- return returnType.cast(result);
- } else if (result.isInfinite() || result.isNaN()) {
- if (returnType.isAssignableFrom(Double.class)) {
- return returnType.cast(result.doubleValue());
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType)");
- }
- } else {
- try {
- return EdmDecimal.convertDecimal(bigDecimalValue, returnType);
- } catch (final IllegalArgumentException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
- } catch (final ClassCastException e) {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
- }
- }
- }
-
- @Override
- protected <T> String internalValueToString(final T value,
- final Boolean isNullable, final Integer maxLength, final Integer precision,
- final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
- if (value instanceof Long || value instanceof Integer) {
- if (Math.abs(((Number) value).longValue()) < 1L << 22) {
- return value.toString();
- } else {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else if (value instanceof Short || value instanceof Byte) {
- return value.toString();
- } else if (value instanceof Double) {
- if (((Double) value).isInfinite()) {
- return (Double) value == Double.NEGATIVE_INFINITY ? EdmDouble.NEGATIVE_INFINITY : EdmDouble.POSITIVE_INFINITY;
- } else {
- final String floatString = Float.toString(((Double) value).floatValue());
- if (floatString.equals(((Double) value).toString())) {
- return floatString;
- } else {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- }
- } else if (value instanceof Float) {
- return (Float) value == Float.NEGATIVE_INFINITY ? EdmDouble.NEGATIVE_INFINITY
- : (Float) value == Float.POSITIVE_INFINITY ? EdmDouble.POSITIVE_INFINITY : value.toString();
- } else if (value instanceof BigDecimal) {
- final float floatValue = ((BigDecimal) value).floatValue();
- if (!Float.isInfinite(floatValue) && BigDecimal.valueOf(floatValue).compareTo((BigDecimal) value) == 0) {
- return ((BigDecimal) value).toString();
- } else {
- throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
- }
- } else {
- throw new EdmPrimitiveTypeException(
- "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
- }
- }
-}
[22/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/metadata.xml
new file mode 100644
index 0000000..707d7d7
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/metadata.xml
@@ -0,0 +1,721 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
+ <edmx:DataServices m:DataServiceVersion="3.0" m:MaxDataServiceVersion="3.0"
+ xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
+ <Schema Namespace="Microsoft.Test.OData.Services.AstoriaDefaultService"
+ xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
+ <EntityType Name="AllSpatialTypes">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Id" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Geog" Type="Edm.Geography" SRID="Variable" />
+ <Property Name="GeogPoint" Type="Edm.GeographyPoint" SRID="Variable" />
+ <Property Name="GeogLine" Type="Edm.GeographyLineString" SRID="Variable" />
+ <Property Name="GeogPolygon" Type="Edm.GeographyPolygon" SRID="Variable" />
+ <Property Name="GeogCollection" Type="Edm.GeographyCollection" SRID="Variable" />
+ <Property Name="GeogMultiPoint" Type="Edm.GeographyMultiPoint" SRID="Variable" />
+ <Property Name="GeogMultiLine" Type="Edm.GeographyMultiLineString" SRID="Variable" />
+ <Property Name="GeogMultiPolygon" Type="Edm.GeographyMultiPolygon" SRID="Variable" />
+ <Property Name="Geom" Type="Edm.Geometry" SRID="Variable" />
+ <Property Name="GeomPoint" Type="Edm.GeometryPoint" SRID="Variable" />
+ <Property Name="GeomLine" Type="Edm.GeometryLineString" SRID="Variable" />
+ <Property Name="GeomPolygon" Type="Edm.GeometryPolygon" SRID="Variable" />
+ <Property Name="GeomCollection" Type="Edm.GeometryCollection" SRID="Variable" />
+ <Property Name="GeomMultiPoint" Type="Edm.GeometryMultiPoint" SRID="Variable" />
+ <Property Name="GeomMultiLine" Type="Edm.GeometryMultiLineString" SRID="Variable" />
+ <Property Name="GeomMultiPolygon" Type="Edm.GeometryMultiPolygon" SRID="Variable" />
+ </EntityType>
+ <EntityType Name="AllSpatialCollectionTypes" Abstract="true">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Id" Type="Edm.Int32" Nullable="false" />
+ </EntityType>
+ <EntityType Name="Customer">
+ <Key>
+ <PropertyRef Name="CustomerId" />
+ </Key>
+ <Property Name="Thumbnail" Type="Edm.Stream" Nullable="false" />
+ <Property Name="Video" Type="Edm.Stream" Nullable="false" />
+ <Property Name="CustomerId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" m:FC_TargetPath="SyndicationSummary" m:FC_ContentKind="text" m:FC_KeepInContent="false" />
+ <Property Name="PrimaryContactInfo" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails" />
+ <Property Name="BackupContactInfo" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails)" Nullable="false" />
+ <Property Name="Auditing" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo" />
+ <NavigationProperty Name="Orders" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Orders" ToRole="Orders" FromRole="Customer" />
+ <NavigationProperty Name="Logins" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Logins" ToRole="Logins" FromRole="Customer" />
+ <NavigationProperty Name="Husband" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Husband" ToRole="Husband" FromRole="Customer" />
+ <NavigationProperty Name="Wife" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Wife" ToRole="Wife" FromRole="Customer" />
+ <NavigationProperty Name="Info" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Info" ToRole="Info" FromRole="Customer" />
+ </EntityType>
+ <EntityType Name="Login">
+ <Key>
+ <PropertyRef Name="Username" />
+ </Key>
+ <Property Name="Username" Type="Edm.String" Nullable="false" />
+ <Property Name="CustomerId" Type="Edm.Int32" Nullable="false" />
+ <NavigationProperty Name="Customer" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Customer" ToRole="Customer" FromRole="Login" />
+ <NavigationProperty Name="LastLogin" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_LastLogin" ToRole="LastLogin" FromRole="Login" />
+ <NavigationProperty Name="SentMessages" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_SentMessages" ToRole="SentMessages" FromRole="Login" />
+ <NavigationProperty Name="ReceivedMessages" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_ReceivedMessages" ToRole="ReceivedMessages" FromRole="Login" />
+ <NavigationProperty Name="Orders" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Orders" ToRole="Orders" FromRole="Login" />
+ </EntityType>
+ <EntityType Name="RSAToken">
+ <Key>
+ <PropertyRef Name="Serial" />
+ </Key>
+ <Property Name="Serial" Type="Edm.String" Nullable="false" />
+ <Property Name="Issued" Type="Edm.DateTime" Nullable="false" />
+ <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken_Login" ToRole="Login" FromRole="RSAToken" />
+ </EntityType>
+ <EntityType Name="PageView">
+ <Key>
+ <PropertyRef Name="PageViewId" />
+ </Key>
+ <Property Name="PageViewId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Username" Type="Edm.String" />
+ <Property Name="Viewed" Type="Edm.DateTimeOffset" Nullable="false" />
+ <Property Name="TimeSpentOnPage" Type="Edm.Time" Nullable="false" />
+ <Property Name="PageUrl" Type="Edm.String" />
+ <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView_Login" ToRole="Login" FromRole="PageView" />
+ </EntityType>
+ <EntityType Name="LastLogin">
+ <Key>
+ <PropertyRef Name="Username" />
+ </Key>
+ <Property Name="Username" Type="Edm.String" Nullable="false" />
+ <Property Name="LoggedIn" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="LoggedOut" Type="Edm.DateTime" />
+ <Property Name="Duration" Type="Edm.Time" Nullable="false" />
+ <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin_Login" ToRole="Login" FromRole="LastLogin" />
+ </EntityType>
+ <EntityType Name="Message">
+ <Key>
+ <PropertyRef Name="FromUsername" />
+ <PropertyRef Name="MessageId" />
+ </Key>
+ <Property Name="MessageId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="FromUsername" Type="Edm.String" Nullable="false" />
+ <Property Name="ToUsername" Type="Edm.String" />
+ <Property Name="Sent" Type="Edm.DateTimeOffset" Nullable="false" m:FC_TargetPath="SyndicationPublished" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
+ <Property Name="Subject" Type="Edm.String" m:FC_TargetPath="SyndicationTitle" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
+ <Property Name="Body" Type="Edm.String" />
+ <Property Name="IsRead" Type="Edm.Boolean" Nullable="false" />
+ <NavigationProperty Name="Sender" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Sender" ToRole="Sender" FromRole="Message" />
+ <NavigationProperty Name="Recipient" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Recipient" ToRole="Recipient" FromRole="Message" />
+ <NavigationProperty Name="Attachments" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Attachments" ToRole="Attachments" FromRole="Message" />
+ </EntityType>
+ <EntityType Name="MessageAttachment">
+ <Key>
+ <PropertyRef Name="AttachmentId" />
+ </Key>
+ <Property Name="AttachmentId" Type="Edm.Guid" Nullable="false" />
+ <Property Name="Attachment" Type="Edm.Binary" />
+ </EntityType>
+ <EntityType Name="Order">
+ <Key>
+ <PropertyRef Name="OrderId" />
+ </Key>
+ <Property Name="OrderId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="CustomerId" Type="Edm.Int32" />
+ <Property Name="Concurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo" />
+ <NavigationProperty Name="Customer" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Customer" ToRole="Customer" FromRole="Order" />
+ <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Login" ToRole="Login" FromRole="Order" />
+ </EntityType>
+ <EntityType Name="OrderLine">
+ <Key>
+ <PropertyRef Name="OrderId" />
+ <PropertyRef Name="ProductId" />
+ </Key>
+ <Property Name="OrderLineStream" Type="Edm.Stream" Nullable="false" />
+ <Property Name="OrderId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Quantity" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ConcurrencyToken" Type="Edm.String" ConcurrencyMode="Fixed" />
+ <NavigationProperty Name="Order" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Order" ToRole="Order" FromRole="OrderLine" />
+ <NavigationProperty Name="Product" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Product" ToRole="Product" FromRole="OrderLine" />
+ </EntityType>
+ <EntityType Name="Product">
+ <Key>
+ <PropertyRef Name="ProductId" />
+ </Key>
+ <Property Name="Picture" Type="Edm.Stream" Nullable="false" />
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Description" Type="Edm.String" />
+ <Property Name="Dimensions" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions" />
+ <Property Name="BaseConcurrency" Type="Edm.String" ConcurrencyMode="Fixed" />
+ <Property Name="ComplexConcurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo" />
+ <Property Name="NestedComplexConcurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo" />
+ <NavigationProperty Name="RelatedProducts" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_RelatedProducts" ToRole="RelatedProducts" FromRole="Product" />
+ <NavigationProperty Name="Detail" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Detail" ToRole="Detail" FromRole="Product" />
+ <NavigationProperty Name="Reviews" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Reviews" ToRole="Reviews" FromRole="Product" />
+ <NavigationProperty Name="Photos" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Photos" ToRole="Photos" FromRole="Product" />
+ </EntityType>
+ <EntityType Name="ProductDetail">
+ <Key>
+ <PropertyRef Name="ProductId" />
+ </Key>
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Details" Type="Edm.String" />
+ <NavigationProperty Name="Product" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail_Product" ToRole="Product" FromRole="ProductDetail" />
+ </EntityType>
+ <EntityType Name="ProductReview">
+ <Key>
+ <PropertyRef Name="ProductId" />
+ <PropertyRef Name="ReviewId" />
+ <PropertyRef Name="RevisionId" />
+ </Key>
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ReviewId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="RevisionId" Type="Edm.String" Nullable="false" />
+ <Property Name="Review" Type="Edm.String" />
+ <NavigationProperty Name="Product" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview_Product" ToRole="Product" FromRole="ProductReview" />
+ </EntityType>
+ <EntityType Name="ProductPhoto">
+ <Key>
+ <PropertyRef Name="PhotoId" />
+ <PropertyRef Name="ProductId" />
+ </Key>
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="PhotoId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Photo" Type="Edm.Binary" />
+ </EntityType>
+ <EntityType Name="CustomerInfo" m:HasStream="true">
+ <Key>
+ <PropertyRef Name="CustomerInfoId" />
+ </Key>
+ <Property Name="CustomerInfoId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Information" Type="Edm.String" />
+ </EntityType>
+ <EntityType Name="Computer">
+ <Key>
+ <PropertyRef Name="ComputerId" />
+ </Key>
+ <Property Name="ComputerId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" />
+ <NavigationProperty Name="ComputerDetail" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer_ComputerDetail" ToRole="ComputerDetail" FromRole="Computer" />
+ </EntityType>
+ <EntityType Name="ComputerDetail">
+ <Key>
+ <PropertyRef Name="ComputerDetailId" />
+ </Key>
+ <Property Name="ComputerDetailId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Manufacturer" Type="Edm.String" m:FC_TargetPath="SyndicationAuthorEmail" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
+ <Property Name="Model" Type="Edm.String" m:FC_TargetPath="SyndicationAuthorUri" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
+ <Property Name="Serial" Type="Edm.String" />
+ <Property Name="SpecificationsBag" Type="Collection(Edm.String)" Nullable="false" />
+ <Property Name="PurchaseDate" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="Dimensions" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions" />
+ <NavigationProperty Name="Computer" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail_Computer" ToRole="Computer" FromRole="ComputerDetail" />
+ </EntityType>
+ <EntityType Name="Driver">
+ <Key>
+ <PropertyRef Name="Name" />
+ </Key>
+ <Property Name="Name" Type="Edm.String" Nullable="false" />
+ <Property Name="BirthDate" Type="Edm.DateTime" Nullable="false" />
+ <NavigationProperty Name="License" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver_License" ToRole="License" FromRole="Driver" />
+ </EntityType>
+ <EntityType Name="License">
+ <Key>
+ <PropertyRef Name="Name" />
+ </Key>
+ <Property Name="Name" Type="Edm.String" Nullable="false" />
+ <Property Name="LicenseNumber" Type="Edm.String" />
+ <Property Name="LicenseClass" Type="Edm.String" m:FC_TargetPath="SyndicationContributorEmail" m:FC_ContentKind="text" m:FC_KeepInContent="false" />
+ <Property Name="Restrictions" Type="Edm.String" m:FC_TargetPath="SyndicationContributorUri" m:FC_ContentKind="text" m:FC_KeepInContent="false" />
+ <Property Name="ExpirationDate" Type="Edm.DateTime" Nullable="false" />
+ <NavigationProperty Name="Driver" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.License_Driver" ToRole="Driver" FromRole="License" />
+ </EntityType>
+ <EntityType Name="MappedEntityType">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Id" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Href" Type="Edm.String" />
+ <Property Name="Title" Type="Edm.String" />
+ <Property Name="HrefLang" Type="Edm.String" />
+ <Property Name="Type" Type="Edm.String" />
+ <Property Name="Length" Type="Edm.Int32" Nullable="false" />
+ <Property Name="BagOfPrimitiveToLinks" Type="Collection(Edm.String)" Nullable="false" />
+ <Property Name="Logo" Type="Edm.Binary" />
+ <Property Name="BagOfDecimals" Type="Collection(Edm.Decimal)" Nullable="false" />
+ <Property Name="BagOfDoubles" Type="Collection(Edm.Double)" Nullable="false" />
+ <Property Name="BagOfSingles" Type="Collection(Edm.Single)" Nullable="false" />
+ <Property Name="BagOfBytes" Type="Collection(Edm.Byte)" Nullable="false" />
+ <Property Name="BagOfInt16s" Type="Collection(Edm.Int16)" Nullable="false" />
+ <Property Name="BagOfInt32s" Type="Collection(Edm.Int32)" Nullable="false" />
+ <Property Name="BagOfInt64s" Type="Collection(Edm.Int64)" Nullable="false" />
+ <Property Name="BagOfGuids" Type="Collection(Edm.Guid)" Nullable="false" />
+ <Property Name="BagOfDateTime" Type="Collection(Edm.DateTime)" Nullable="false" />
+ <Property Name="BagOfComplexToCategories" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ComplexToCategory)" Nullable="false" />
+ <Property Name="ComplexPhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" m:FC_TargetPath="SyndicationRights" m:FC_ContentKind="text" m:FC_SourcePath="PhoneNumber" m:FC_KeepInContent="true" />
+ <Property Name="ComplexContactDetails" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails" m:FC_TargetPath="SyndicationSummary" m:FC_ContentKind="text" m:FC_SourcePath="WorkPhone/Extension" m:FC_KeepInContent="true" />
+ </EntityType>
+ <EntityType Name="Car" m:HasStream="true">
+ <Key>
+ <PropertyRef Name="VIN" />
+ </Key>
+ <Property Name="Photo" Type="Edm.Stream" Nullable="false" />
+ <Property Name="Video" Type="Edm.Stream" Nullable="false" />
+ <Property Name="VIN" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Description" Type="Edm.String" />
+ </EntityType>
+ <EntityType Name="Person">
+ <Key>
+ <PropertyRef Name="PersonId" />
+ </Key>
+ <Property Name="PersonId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" />
+ <NavigationProperty Name="PersonMetadata" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Person_PersonMetadata" ToRole="PersonMetadata" FromRole="Person" />
+ </EntityType>
+ <EntityType Name="PersonMetadata">
+ <Key>
+ <PropertyRef Name="PersonMetadataId" />
+ </Key>
+ <Property Name="PersonMetadataId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="PersonId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="PropertyName" Type="Edm.String" />
+ <Property Name="PropertyValue" Type="Edm.String" />
+ <NavigationProperty Name="Person" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata_Person" ToRole="Person" FromRole="PersonMetadata" />
+ </EntityType>
+ <ComplexType Name="ContactDetails">
+ <Property Name="EmailBag" Type="Collection(Edm.String)" Nullable="false" />
+ <Property Name="AlternativeNames" Type="Collection(Edm.String)" Nullable="false" />
+ <Property Name="ContactAlias" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases" />
+ <Property Name="HomePhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" />
+ <Property Name="WorkPhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" />
+ <Property Name="MobilePhoneBag" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Phone)" Nullable="false" />
+ </ComplexType>
+ <ComplexType Name="AuditInfo">
+ <Property Name="ModifiedDate" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="ModifiedBy" Type="Edm.String" />
+ <Property Name="Concurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo" />
+ </ComplexType>
+ <ComplexType Name="ConcurrencyInfo">
+ <Property Name="Token" Type="Edm.String" />
+ <Property Name="QueriedDateTime" Type="Edm.DateTime" />
+ </ComplexType>
+ <ComplexType Name="Dimensions">
+ <Property Name="Width" Type="Edm.Decimal" Nullable="false" />
+ <Property Name="Height" Type="Edm.Decimal" Nullable="false" />
+ <Property Name="Depth" Type="Edm.Decimal" Nullable="false" />
+ </ComplexType>
+ <ComplexType Name="ComplexToCategory">
+ <Property Name="Term" Type="Edm.String" />
+ <Property Name="Scheme" Type="Edm.String" />
+ <Property Name="Label" Type="Edm.String" />
+ </ComplexType>
+ <ComplexType Name="Phone">
+ <Property Name="PhoneNumber" Type="Edm.String" />
+ <Property Name="Extension" Type="Edm.String" />
+ </ComplexType>
+ <ComplexType Name="Aliases">
+ <Property Name="AlternativeNames" Type="Collection(Edm.String)" Nullable="false" />
+ </ComplexType>
+ <EntityType Name="AllSpatialCollectionTypes_Simple" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes">
+ <Property Name="ManyGeogPoint" Type="Collection(Edm.GeographyPoint)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeogLine" Type="Collection(Edm.GeographyLineString)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeogPolygon" Type="Collection(Edm.GeographyPolygon)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeomPoint" Type="Collection(Edm.GeometryPoint)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeomLine" Type="Collection(Edm.GeometryLineString)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeomPolygon" Type="Collection(Edm.GeometryPolygon)" Nullable="false" SRID="Variable" />
+ </EntityType>
+ <EntityType Name="ProductPageView" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView">
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ConcurrencyToken" Type="Edm.String" ConcurrencyMode="Fixed" />
+ </EntityType>
+ <EntityType Name="BackOrderLine" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" />
+ <EntityType Name="BackOrderLine2" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.BackOrderLine" />
+ <EntityType Name="DiscontinuedProduct" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Product">
+ <Property Name="Discontinued" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="ReplacementProductId" Type="Edm.Int32" />
+ <Property Name="DiscontinuedPhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" />
+ <Property Name="ChildConcurrencyToken" Type="Edm.String" ConcurrencyMode="Fixed" />
+ </EntityType>
+ <EntityType Name="Contractor" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Person">
+ <Property Name="ContratorCompanyId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="BillingRate" Type="Edm.Int32" Nullable="false" />
+ <Property Name="TeamContactPersonId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="JobDescription" Type="Edm.String" />
+ </EntityType>
+ <EntityType Name="Employee" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Person">
+ <Property Name="ManagersPersonId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Salary" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Title" Type="Edm.String" />
+ <NavigationProperty Name="Manager" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee_Manager" ToRole="Manager" FromRole="Employee" />
+ </EntityType>
+ <EntityType Name="SpecialEmployee" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee">
+ <Property Name="CarsVIN" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Bonus" Type="Edm.Int32" Nullable="false" />
+ <Property Name="IsFullyVested" Type="Edm.Boolean" Nullable="false" />
+ <NavigationProperty Name="Car" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee_Car" ToRole="Car" FromRole="SpecialEmployee" />
+ </EntityType>
+ <ComplexType Name="ComplexWithAllPrimitiveTypes">
+ <Property Name="Binary" Type="Edm.Binary" />
+ <Property Name="Boolean" Type="Edm.Boolean" Nullable="false" />
+ <Property Name="Byte" Type="Edm.Byte" Nullable="false" />
+ <Property Name="DateTime" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="Decimal" Type="Edm.Decimal" Nullable="false" />
+ <Property Name="Double" Type="Edm.Double" Nullable="false" />
+ <Property Name="Int16" Type="Edm.Int16" Nullable="false" />
+ <Property Name="Int32" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Int64" Type="Edm.Int64" Nullable="false" />
+ <Property Name="SByte" Type="Edm.SByte" Nullable="false" />
+ <Property Name="String" Type="Edm.String" />
+ <Property Name="Single" Type="Edm.Single" Nullable="false" />
+ <Property Name="GeographyPoint" Type="Edm.GeographyPoint" SRID="Variable" />
+ <Property Name="GeometryPoint" Type="Edm.GeometryPoint" SRID="Variable" />
+ </ComplexType>
+ <Association Name="Customer_Orders">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Orders" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Customer_Logins">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Logins" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Customer_Husband">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Husband" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Customer_Wife">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Wife" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Customer_Info">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo" Role="Info" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Login_Customer">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Login_LastLogin">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin" Role="LastLogin" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Login_SentMessages">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="SentMessages" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ </Association>
+ <Association Name="Login_ReceivedMessages">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="ReceivedMessages" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ </Association>
+ <Association Name="Login_Orders">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Orders" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ </Association>
+ <Association Name="RSAToken_Login">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken" Role="RSAToken" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
+ </Association>
+ <Association Name="PageView_Login">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView" Role="PageView" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
+ </Association>
+ <Association Name="LastLogin_Login">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin" Role="LastLogin" Multiplicity="*" />
+ </Association>
+ <Association Name="Message_Sender">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="Message" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Sender" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Message_Recipient">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="Message" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Recipient" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Message_Attachments">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.MessageAttachment" Role="Attachments" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="Message" Multiplicity="*" />
+ </Association>
+ <Association Name="Order_Customer">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Order" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Order_Login">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Order" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
+ </Association>
+ <Association Name="OrderLine_Order">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" Role="OrderLine" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Order" Multiplicity="0..1" />
+ </Association>
+ <Association Name="OrderLine_Product">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" Role="OrderLine" Multiplicity="*" />
+ </Association>
+ <Association Name="Product_RelatedProducts">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="RelatedProducts" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
+ </Association>
+ <Association Name="Product_Detail">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail" Role="Detail" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
+ </Association>
+ <Association Name="Product_Reviews">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview" Role="Reviews" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
+ </Association>
+ <Association Name="Product_Photos">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPhoto" Role="Photos" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
+ </Association>
+ <Association Name="ProductDetail_Product">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail" Role="ProductDetail" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="0..1" />
+ </Association>
+ <Association Name="ProductReview_Product">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview" Role="ProductReview" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Computer_ComputerDetail">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" Role="ComputerDetail" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" Role="Computer" Multiplicity="*" />
+ </Association>
+ <Association Name="ComputerDetail_Computer">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" Role="ComputerDetail" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" Role="Computer" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Driver_License">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.License" Role="License" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver" Role="Driver" Multiplicity="*" />
+ </Association>
+ <Association Name="License_Driver">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.License" Role="License" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver" Role="Driver" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Person_PersonMetadata">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata" Role="PersonMetadata" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" Role="Person" Multiplicity="*" />
+ </Association>
+ <Association Name="PersonMetadata_Person">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata" Role="PersonMetadata" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" Role="Person" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Employee_Manager">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" Role="Manager" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" Role="Employee" Multiplicity="*" />
+ </Association>
+ <Association Name="SpecialEmployee_Car">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee" Role="SpecialEmployee" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" Role="Car" Multiplicity="0..1" />
+ </Association>
+ <EntityContainer Name="DefaultContainer" m:IsDefaultEntityContainer="true">
+ <EntitySet Name="AllGeoTypesSet" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialTypes" />
+ <EntitySet Name="AllGeoCollectionTypesSet" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes" />
+ <EntitySet Name="Customer" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" />
+ <EntitySet Name="Login" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" />
+ <EntitySet Name="RSAToken" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken" />
+ <EntitySet Name="PageView" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView" />
+ <EntitySet Name="LastLogin" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin" />
+ <EntitySet Name="Message" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" />
+ <EntitySet Name="MessageAttachment" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.MessageAttachment" />
+ <EntitySet Name="Order" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" />
+ <EntitySet Name="OrderLine" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" />
+ <EntitySet Name="Product" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" />
+ <EntitySet Name="ProductDetail" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail" />
+ <EntitySet Name="ProductReview" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview" />
+ <EntitySet Name="ProductPhoto" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPhoto" />
+ <EntitySet Name="CustomerInfo" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo" />
+ <EntitySet Name="Computer" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" />
+ <EntitySet Name="ComputerDetail" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" />
+ <EntitySet Name="Driver" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver" />
+ <EntitySet Name="License" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.License" />
+ <EntitySet Name="MappedEntityType" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.MappedEntityType" />
+ <EntitySet Name="Car" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" />
+ <EntitySet Name="Person" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" />
+ <EntitySet Name="PersonMetadata" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata" />
+ <FunctionImport Name="GetPrimitiveString" ReturnType="Edm.String" m:HttpMethod="GET" />
+ <FunctionImport Name="GetSpecificCustomer" ReturnType="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Customer)" EntitySet="Customer" m:HttpMethod="GET">
+ <Parameter Name="Name" Type="Edm.String" />
+ </FunctionImport>
+ <FunctionImport Name="GetCustomerCount" ReturnType="Edm.Int32" m:HttpMethod="GET" />
+ <FunctionImport Name="GetArgumentPlusOne" ReturnType="Edm.Int32" m:HttpMethod="GET">
+ <Parameter Name="arg1" Type="Edm.Int32" Nullable="false" />
+ </FunctionImport>
+ <FunctionImport Name="EntityProjectionReturnsCollectionOfComplexTypes" ReturnType="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails)" m:HttpMethod="GET" />
+ <FunctionImport Name="ResetDataSource" m:HttpMethod="POST" />
+ <FunctionImport Name="InStreamErrorGetCustomer" ReturnType="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Customer)" EntitySet="Customer" m:HttpMethod="GET" />
+ <FunctionImport Name="IncreaseSalaries" IsBindable="true" m:IsAlwaysBindable="true">
+ <Parameter Name="employees" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Employee)" />
+ <Parameter Name="n" Type="Edm.Int32" Nullable="false" />
+ </FunctionImport>
+ <FunctionImport Name="Sack" IsBindable="true" m:IsAlwaysBindable="true">
+ <Parameter Name="employee" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" />
+ </FunctionImport>
+ <FunctionImport Name="GetComputer" ReturnType="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" IsBindable="true" EntitySet="Computer" m:IsAlwaysBindable="true">
+ <Parameter Name="computer" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" />
+ </FunctionImport>
+ <FunctionImport Name="ChangeProductDimensions" IsBindable="true" m:IsAlwaysBindable="true">
+ <Parameter Name="product" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" />
+ <Parameter Name="dimensions" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions" />
+ </FunctionImport>
+ <FunctionImport Name="ResetComputerDetailsSpecifications" IsBindable="true" m:IsAlwaysBindable="true">
+ <Parameter Name="computerDetail" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" />
+ <Parameter Name="specifications" Type="Collection(Edm.String)" Nullable="false" />
+ <Parameter Name="purchaseTime" Type="Edm.DateTime" Nullable="false" />
+ </FunctionImport>
+ <AssociationSet Name="Customer_Orders" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Orders">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Orders" EntitySet="Order" />
+ </AssociationSet>
+ <AssociationSet Name="Customer_Logins" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Logins">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Logins" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="Customer_Husband" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Husband">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Husband" EntitySet="Customer" />
+ </AssociationSet>
+ <AssociationSet Name="Customer_Wife" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Wife">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Wife" EntitySet="Customer" />
+ </AssociationSet>
+ <AssociationSet Name="Customer_Info" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Info">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Info" EntitySet="CustomerInfo" />
+ </AssociationSet>
+ <AssociationSet Name="Login_Customer" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Customer">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="Customer" EntitySet="Customer" />
+ </AssociationSet>
+ <AssociationSet Name="Login_LastLogin" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_LastLogin">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="LastLogin" EntitySet="LastLogin" />
+ </AssociationSet>
+ <AssociationSet Name="Login_SentMessages" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_SentMessages">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="SentMessages" EntitySet="Message" />
+ </AssociationSet>
+ <AssociationSet Name="Login_ReceivedMessages" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_ReceivedMessages">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="ReceivedMessages" EntitySet="Message" />
+ </AssociationSet>
+ <AssociationSet Name="Login_Orders" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Orders">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="Orders" EntitySet="Order" />
+ </AssociationSet>
+ <AssociationSet Name="RSAToken_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken_Login">
+ <End Role="RSAToken" EntitySet="RSAToken" />
+ <End Role="Login" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="PageView_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView_Login">
+ <End Role="PageView" EntitySet="PageView" />
+ <End Role="Login" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="LastLogin_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin_Login">
+ <End Role="LastLogin" EntitySet="LastLogin" />
+ <End Role="Login" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="Message_Sender" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Sender">
+ <End Role="Message" EntitySet="Message" />
+ <End Role="Sender" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="Message_Recipient" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Recipient">
+ <End Role="Message" EntitySet="Message" />
+ <End Role="Recipient" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="Message_Attachments" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Attachments">
+ <End Role="Message" EntitySet="Message" />
+ <End Role="Attachments" EntitySet="MessageAttachment" />
+ </AssociationSet>
+ <AssociationSet Name="Order_Customer" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Customer">
+ <End Role="Order" EntitySet="Order" />
+ <End Role="Customer" EntitySet="Customer" />
+ </AssociationSet>
+ <AssociationSet Name="Order_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Login">
+ <End Role="Order" EntitySet="Order" />
+ <End Role="Login" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="OrderLine_Order" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Order">
+ <End Role="OrderLine" EntitySet="OrderLine" />
+ <End Role="Order" EntitySet="Order" />
+ </AssociationSet>
+ <AssociationSet Name="OrderLine_Product" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Product">
+ <End Role="OrderLine" EntitySet="OrderLine" />
+ <End Role="Product" EntitySet="Product" />
+ </AssociationSet>
+ <AssociationSet Name="Product_RelatedProducts" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_RelatedProducts">
+ <End Role="Product" EntitySet="Product" />
+ <End Role="RelatedProducts" EntitySet="Product" />
+ </AssociationSet>
+ <AssociationSet Name="Product_Detail" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Detail">
+ <End Role="Product" EntitySet="Product" />
+ <End Role="Detail" EntitySet="ProductDetail" />
+ </AssociationSet>
+ <AssociationSet Name="Product_Reviews" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Reviews">
+ <End Role="Product" EntitySet="Product" />
+ <End Role="Reviews" EntitySet="ProductReview" />
+ </AssociationSet>
+ <AssociationSet Name="Product_Photos" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Photos">
+ <End Role="Product" EntitySet="Product" />
+ <End Role="Photos" EntitySet="ProductPhoto" />
+ </AssociationSet>
+ <AssociationSet Name="ProductDetail_Product" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail_Product">
+ <End Role="ProductDetail" EntitySet="ProductDetail" />
+ <End Role="Product" EntitySet="Product" />
+ </AssociationSet>
+ <AssociationSet Name="ProductReview_Product" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview_Product">
+ <End Role="ProductReview" EntitySet="ProductReview" />
+ <End Role="Product" EntitySet="Product" />
+ </AssociationSet>
+ <AssociationSet Name="Computer_ComputerDetail" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer_ComputerDetail">
+ <End Role="Computer" EntitySet="Computer" />
+ <End Role="ComputerDetail" EntitySet="ComputerDetail" />
+ </AssociationSet>
+ <AssociationSet Name="ComputerDetail_Computer" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail_Computer">
+ <End Role="ComputerDetail" EntitySet="ComputerDetail" />
+ <End Role="Computer" EntitySet="Computer" />
+ </AssociationSet>
+ <AssociationSet Name="Driver_License" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver_License">
+ <End Role="Driver" EntitySet="Driver" />
+ <End Role="License" EntitySet="License" />
+ </AssociationSet>
+ <AssociationSet Name="License_Driver" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.License_Driver">
+ <End Role="License" EntitySet="License" />
+ <End Role="Driver" EntitySet="Driver" />
+ </AssociationSet>
+ <AssociationSet Name="Employee_Manager" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee_Manager">
+ <End Role="Employee" EntitySet="Person" />
+ <End Role="Manager" EntitySet="Person" />
+ </AssociationSet>
+ <AssociationSet Name="SpecialEmployee_Car" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee_Car">
+ <End Role="SpecialEmployee" EntitySet="Person" />
+ <End Role="Car" EntitySet="Car" />
+ </AssociationSet>
+ <AssociationSet Name="Person_PersonMetadata" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Person_PersonMetadata">
+ <End Role="Person" EntitySet="Person" />
+ <End Role="PersonMetadata" EntitySet="PersonMetadata" />
+ </AssociationSet>
+ <AssociationSet Name="PersonMetadata_Person" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata_Person">
+ <End Role="PersonMetadata" EntitySet="PersonMetadata" />
+ <End Role="Person" EntitySet="Person" />
+ </AssociationSet>
+ </EntityContainer>
+ </Schema>
+ </edmx:DataServices>
+</edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/northwind-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/northwind-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/northwind-metadata.xml
new file mode 100644
index 0000000..0a14f0a
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/northwind-metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"><edmx:DataServices m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><Schema Namespace="NorthwindModel" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityType Name="Category"><Key><PropertyRef Name="CategoryID" /></Key><Property Name="CategoryID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Description" Type="Edm.String" MaxLength="Max" FixedLength="false" Unicode="true" /><Property Name="Picture" Type="Edm.Binary" MaxLength="Max" FixedLength="false" /><NavigationProperty Name="Products" Relationship="NorthwindModel.FK_Products_Categories" ToRole="Products" FromRole="Categories" /></Entity
Type><EntityType Name="CustomerDemographic"><Key><PropertyRef Name="CustomerTypeID" /></Key><Property Name="CustomerTypeID" Type="Edm.String" Nullable="false" MaxLength="10" FixedLength="true" Unicode="true" /><Property Name="CustomerDesc" Type="Edm.String" MaxLength="Max" FixedLength="false" Unicode="true" /><NavigationProperty Name="Customers" Relationship="NorthwindModel.CustomerCustomerDemo" ToRole="Customers" FromRole="CustomerDemographics" /></EntityType><EntityType Name="Customer"><Key><PropertyRef Name="CustomerID" /></Key><Property Name="CustomerID" Type="Edm.String" Nullable="false" MaxLength="5" FixedLength="true" Unicode="true" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ContactName" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="ContactTitle" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="Address" Type="E
dm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Phone" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><Property Name="Fax" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><NavigationProperty Name="Orders" Relationship="NorthwindModel.FK_Orders_Customers" ToRole="Orders" FromRole="Customers" /><NavigationProperty Name="CustomerDemographics" Relationship="NorthwindModel.CustomerCustomerDemo" ToRole="CustomerDemographics" FromRole="Customers" /></EntityType><EntityType Name="Employee"><Key><PropertyRef Name="EmployeeID" /></Key><Property N
ame="EmployeeID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="LastName" Type="Edm.String" Nullable="false" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="FirstName" Type="Edm.String" Nullable="false" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Title" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="TitleOfCourtesy" Type="Edm.String" MaxLength="25" FixedLength="false" Unicode="true" /><Property Name="BirthDate" Type="Edm.DateTime" /><Property Name="HireDate" Type="Edm.DateTime" /><Property Name="Address" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.St
ring" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="HomePhone" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><Property Name="Extension" Type="Edm.String" MaxLength="4" FixedLength="false" Unicode="true" /><Property Name="Photo" Type="Edm.Binary" MaxLength="Max" FixedLength="false" /><Property Name="Notes" Type="Edm.String" MaxLength="Max" FixedLength="false" Unicode="true" /><Property Name="ReportsTo" Type="Edm.Int32" /><Property Name="PhotoPath" Type="Edm.String" MaxLength="255" FixedLength="false" Unicode="true" /><NavigationProperty Name="Employees1" Relationship="NorthwindModel.FK_Employees_Employees" ToRole="Employees1" FromRole="Employees" /><NavigationProperty Name="Employee1" Relationship="NorthwindModel.FK_Employees_Employees" ToRole="Employees" FromRole="Employees1" /><NavigationProperty Name="Orders" Relationship="NorthwindModel.FK_O
rders_Employees" ToRole="Orders" FromRole="Employees" /><NavigationProperty Name="Territories" Relationship="NorthwindModel.EmployeeTerritories" ToRole="Territories" FromRole="Employees" /></EntityType><EntityType Name="Order_Detail"><Key><PropertyRef Name="OrderID" /><PropertyRef Name="ProductID" /></Key><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductID" Type="Edm.Int32" Nullable="false" /><Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" /><Property Name="Quantity" Type="Edm.Int16" Nullable="false" /><Property Name="Discount" Type="Edm.Single" Nullable="false" /><NavigationProperty Name="Order" Relationship="NorthwindModel.FK_Order_Details_Orders" ToRole="Orders" FromRole="Order_Details" /><NavigationProperty Name="Product" Relationship="NorthwindModel.FK_Order_Details_Products" ToRole="Products" FromRole="Order_Details" /></EntityType><EntityType Name="Order"><Key><PropertyRef Name="OrderID" /></Key><Prope
rty Name="OrderID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="CustomerID" Type="Edm.String" MaxLength="5" FixedLength="true" Unicode="true" /><Property Name="EmployeeID" Type="Edm.Int32" /><Property Name="OrderDate" Type="Edm.DateTime" /><Property Name="RequiredDate" Type="Edm.DateTime" /><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="ShipVia" Type="Edm.Int32" /><Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="ShipName" Type="Edm.String" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ShipAddress" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="ShipCity" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipRegion" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipPostalCode" Type="Ed
m.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="ShipCountry" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><NavigationProperty Name="Customer" Relationship="NorthwindModel.FK_Orders_Customers" ToRole="Customers" FromRole="Orders" /><NavigationProperty Name="Employee" Relationship="NorthwindModel.FK_Orders_Employees" ToRole="Employees" FromRole="Orders" /><NavigationProperty Name="Order_Details" Relationship="NorthwindModel.FK_Order_Details_Orders" ToRole="Order_Details" FromRole="Orders" /><NavigationProperty Name="Shipper" Relationship="NorthwindModel.FK_Orders_Shippers" ToRole="Shippers" FromRole="Orders" /></EntityType><EntityType Name="Product"><Key><PropertyRef Name="ProductID" /></Key><Property Name="ProductID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40
" FixedLength="false" Unicode="true" /><Property Name="SupplierID" Type="Edm.Int32" /><Property Name="CategoryID" Type="Edm.Int32" /><Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="UnitsInStock" Type="Edm.Int16" /><Property Name="UnitsOnOrder" Type="Edm.Int16" /><Property Name="ReorderLevel" Type="Edm.Int16" /><Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" /><NavigationProperty Name="Category" Relationship="NorthwindModel.FK_Products_Categories" ToRole="Categories" FromRole="Products" /><NavigationProperty Name="Order_Details" Relationship="NorthwindModel.FK_Order_Details_Products" ToRole="Order_Details" FromRole="Products" /><NavigationProperty Name="Supplier" Relationship="NorthwindModel.FK_Products_Suppliers" ToRole="Suppliers" FromRole="Products" /></EntityType><EntityType Name="Region"><Key><PropertyRef Name="RegionID
" /></Key><Property Name="RegionID" Type="Edm.Int32" Nullable="false" /><Property Name="RegionDescription" Type="Edm.String" Nullable="false" MaxLength="50" FixedLength="true" Unicode="true" /><NavigationProperty Name="Territories" Relationship="NorthwindModel.FK_Territories_Region" ToRole="Territories" FromRole="Region" /></EntityType><EntityType Name="Shipper"><Key><PropertyRef Name="ShipperID" /></Key><Property Name="ShipperID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="Phone" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><NavigationProperty Name="Orders" Relationship="NorthwindModel.FK_Orders_Shippers" ToRole="Orders" FromRole="Shippers" /></EntityType><EntityType Name="Supplier"><Key><PropertyRef Name="SupplierID" /></Key><Propert
y Name="SupplierID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ContactName" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="ContactTitle" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="Address" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Phone" Type="Edm.String" MaxLengt
h="24" FixedLength="false" Unicode="true" /><Property Name="Fax" Type="Edm.String" MaxLength="24" FixedLength="false" Unicode="true" /><Property Name="HomePage" Type="Edm.String" MaxLength="Max" FixedLength="false" Unicode="true" /><NavigationProperty Name="Products" Relationship="NorthwindModel.FK_Products_Suppliers" ToRole="Products" FromRole="Suppliers" /></EntityType><EntityType Name="Territory"><Key><PropertyRef Name="TerritoryID" /></Key><Property Name="TerritoryID" Type="Edm.String" Nullable="false" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="TerritoryDescription" Type="Edm.String" Nullable="false" MaxLength="50" FixedLength="true" Unicode="true" /><Property Name="RegionID" Type="Edm.Int32" Nullable="false" /><NavigationProperty Name="Region" Relationship="NorthwindModel.FK_Territories_Region" ToRole="Region" FromRole="Territories" /><NavigationProperty Name="Employees" Relationship="NorthwindModel.EmployeeTerritories" ToRole="Employees" FromRole="Terr
itories" /></EntityType><EntityType Name="Alphabetical_list_of_product"><Key><PropertyRef Name="CategoryName" /><PropertyRef Name="Discontinued" /><PropertyRef Name="ProductID" /><PropertyRef Name="ProductName" /></Key><Property Name="ProductID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="SupplierID" Type="Edm.Int32" /><Property Name="CategoryID" Type="Edm.Int32" /><Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="UnitsInStock" Type="Edm.Int16" /><Property Name="UnitsOnOrder" Type="Edm.Int16" /><Property Name="ReorderLevel" Type="Edm.Int16" /><Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" /><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true"
/></EntityType><EntityType Name="Category_Sales_for_1997"><Key><PropertyRef Name="CategoryName" /></Key><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="CategorySales" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Current_Product_List"><Key><PropertyRef Name="ProductID" /><PropertyRef Name="ProductName" /></Key><Property Name="ProductID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /></EntityType><EntityType Name="Customer_and_Suppliers_by_City"><Key><PropertyRef Name="CompanyName" /><PropertyRef Name="Relationship" /></Key><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="CompanyName" Type="Edm.String" Null
able="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ContactName" Type="Edm.String" MaxLength="30" FixedLength="false" Unicode="true" /><Property Name="Relationship" Type="Edm.String" Nullable="false" MaxLength="9" FixedLength="false" Unicode="false" /></EntityType><EntityType Name="Invoice"><Key><PropertyRef Name="CustomerName" /><PropertyRef Name="Discount" /><PropertyRef Name="OrderID" /><PropertyRef Name="ProductID" /><PropertyRef Name="ProductName" /><PropertyRef Name="Quantity" /><PropertyRef Name="Salesperson" /><PropertyRef Name="ShipperName" /><PropertyRef Name="UnitPrice" /></Key><Property Name="ShipName" Type="Edm.String" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ShipAddress" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="ShipCity" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipRegion" Type="Edm.String" MaxLength="15" FixedLength="false"
Unicode="true" /><Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="ShipCountry" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="CustomerID" Type="Edm.String" MaxLength="5" FixedLength="true" Unicode="true" /><Property Name="CustomerName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="Address" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Salesperson" Type="Edm.String" Nullable="false" MaxLength="31" FixedLength="
false" Unicode="true" /><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="OrderDate" Type="Edm.DateTime" /><Property Name="RequiredDate" Type="Edm.DateTime" /><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="ShipperName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ProductID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" /><Property Name="Quantity" Type="Edm.Int16" Nullable="false" /><Property Name="Discount" Type="Edm.Single" Nullable="false" /><Property Name="ExtendedPrice" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Order_Details_Extended"><Key><PropertyRef Name="Discount" /><PropertyRe
f Name="OrderID" /><PropertyRef Name="ProductID" /><PropertyRef Name="ProductName" /><PropertyRef Name="Quantity" /><PropertyRef Name="UnitPrice" /></Key><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductID" Type="Edm.Int32" Nullable="false" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" /><Property Name="Quantity" Type="Edm.Int16" Nullable="false" /><Property Name="Discount" Type="Edm.Single" Nullable="false" /><Property Name="ExtendedPrice" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Order_Subtotal"><Key><PropertyRef Name="OrderID" /></Key><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Orders_Qry"><Key><PropertyRef Name="CompanyName" /><Propert
yRef Name="OrderID" /></Key><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="CustomerID" Type="Edm.String" MaxLength="5" FixedLength="true" Unicode="true" /><Property Name="EmployeeID" Type="Edm.Int32" /><Property Name="OrderDate" Type="Edm.DateTime" /><Property Name="RequiredDate" Type="Edm.DateTime" /><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="ShipVia" Type="Edm.Int32" /><Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="ShipName" Type="Edm.String" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ShipAddress" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="ShipCity" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipRegion" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Proper
ty Name="ShipCountry" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="Address" Type="Edm.String" MaxLength="60" FixedLength="false" Unicode="true" /><Property Name="City" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="Region" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="PostalCode" Type="Edm.String" MaxLength="10" FixedLength="false" Unicode="true" /><Property Name="Country" Type="Edm.String" MaxLength="15" FixedLength="false" Unicode="true" /></EntityType><EntityType Name="Product_Sales_for_1997"><Key><PropertyRef Name="CategoryName" /><PropertyRef Name="ProductName" /></Key><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ProductName" Type="Edm.String" Nullable="false"
MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ProductSales" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Products_Above_Average_Price"><Key><PropertyRef Name="ProductName" /></Key><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Products_by_Category"><Key><PropertyRef Name="CategoryName" /><PropertyRef Name="Discontinued" /><PropertyRef Name="ProductName" /></Key><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" FixedLength="false" Unicode="true" /><Property Name="UnitsInStock" Type="Edm.Int16" /><Property Name="Disc
ontinued" Type="Edm.Boolean" Nullable="false" /></EntityType><EntityType Name="Sales_by_Category"><Key><PropertyRef Name="CategoryID" /><PropertyRef Name="CategoryName" /><PropertyRef Name="ProductName" /></Key><Property Name="CategoryID" Type="Edm.Int32" Nullable="false" /><Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /><Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ProductSales" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Sales_Totals_by_Amount"><Key><PropertyRef Name="CompanyName" /><PropertyRef Name="OrderID" /></Key><Property Name="SaleAmount" Type="Edm.Decimal" Precision="19" Scale="4" /><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" FixedLength="false" Unicode="true" /><Property Name="ShippedDate" Typ
e="Edm.DateTime" /></EntityType><EntityType Name="Summary_of_Sales_by_Quarter"><Key><PropertyRef Name="OrderID" /></Key><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><EntityType Name="Summary_of_Sales_by_Year"><Key><PropertyRef Name="OrderID" /></Key><Property Name="ShippedDate" Type="Edm.DateTime" /><Property Name="OrderID" Type="Edm.Int32" Nullable="false" /><Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" /></EntityType><Association Name="FK_Products_Categories"><End Type="NorthwindModel.Category" Role="Categories" Multiplicity="0..1" /><End Type="NorthwindModel.Product" Role="Products" Multiplicity="*" /><ReferentialConstraint><Principal Role="Categories"><PropertyRef Name="CategoryID" /></Principal><Dependent Role="Products"><PropertyRef Name="CategoryID" /></Dependent></ReferentialConstraint></Association><A
ssociation Name="CustomerCustomerDemo"><End Type="NorthwindModel.Customer" Role="Customers" Multiplicity="*" /><End Type="NorthwindModel.CustomerDemographic" Role="CustomerDemographics" Multiplicity="*" /></Association><Association Name="FK_Orders_Customers"><End Type="NorthwindModel.Customer" Role="Customers" Multiplicity="0..1" /><End Type="NorthwindModel.Order" Role="Orders" Multiplicity="*" /><ReferentialConstraint><Principal Role="Customers"><PropertyRef Name="CustomerID" /></Principal><Dependent Role="Orders"><PropertyRef Name="CustomerID" /></Dependent></ReferentialConstraint></Association><Association Name="FK_Employees_Employees"><End Type="NorthwindModel.Employee" Role="Employees" Multiplicity="0..1" /><End Type="NorthwindModel.Employee" Role="Employees1" Multiplicity="*" /><ReferentialConstraint><Principal Role="Employees"><PropertyRef Name="EmployeeID" /></Principal><Dependent Role="Employees1"><PropertyRef Name="ReportsTo" /></Dependent></ReferentialConstraint></Associa
tion><Association Name="FK_Orders_Employees"><End Type="NorthwindModel.Employee" Role="Employees" Multiplicity="0..1" /><End Type="NorthwindModel.Order" Role="Orders" Multiplicity="*" /><ReferentialConstraint><Principal Role="Employees"><PropertyRef Name="EmployeeID" /></Principal><Dependent Role="Orders"><PropertyRef Name="EmployeeID" /></Dependent></ReferentialConstraint></Association><Association Name="EmployeeTerritories"><End Type="NorthwindModel.Territory" Role="Territories" Multiplicity="*" /><End Type="NorthwindModel.Employee" Role="Employees" Multiplicity="*" /></Association><Association Name="FK_Order_Details_Orders"><End Type="NorthwindModel.Order" Role="Orders" Multiplicity="1" /><End Type="NorthwindModel.Order_Detail" Role="Order_Details" Multiplicity="*" /><ReferentialConstraint><Principal Role="Orders"><PropertyRef Name="OrderID" /></Principal><Dependent Role="Order_Details"><PropertyRef Name="OrderID" /></Dependent></ReferentialConstraint></Association><Association N
ame="FK_Order_Details_Products"><End Type="NorthwindModel.Product" Role="Products" Multiplicity="1" /><End Type="NorthwindModel.Order_Detail" Role="Order_Details" Multiplicity="*" /><ReferentialConstraint><Principal Role="Products"><PropertyRef Name="ProductID" /></Principal><Dependent Role="Order_Details"><PropertyRef Name="ProductID" /></Dependent></ReferentialConstraint></Association><Association Name="FK_Orders_Shippers"><End Type="NorthwindModel.Shipper" Role="Shippers" Multiplicity="0..1" /><End Type="NorthwindModel.Order" Role="Orders" Multiplicity="*" /><ReferentialConstraint><Principal Role="Shippers"><PropertyRef Name="ShipperID" /></Principal><Dependent Role="Orders"><PropertyRef Name="ShipVia" /></Dependent></ReferentialConstraint></Association><Association Name="FK_Products_Suppliers"><End Type="NorthwindModel.Supplier" Role="Suppliers" Multiplicity="0..1" /><End Type="NorthwindModel.Product" Role="Products" Multiplicity="*" /><ReferentialConstraint><Principal Role="Sup
pliers"><PropertyRef Name="SupplierID" /></Principal><Dependent Role="Products"><PropertyRef Name="SupplierID" /></Dependent></ReferentialConstraint></Association><Association Name="FK_Territories_Region"><End Type="NorthwindModel.Region" Role="Region" Multiplicity="1" /><End Type="NorthwindModel.Territory" Role="Territories" Multiplicity="*" /><ReferentialConstraint><Principal Role="Region"><PropertyRef Name="RegionID" /></Principal><Dependent Role="Territories"><PropertyRef Name="RegionID" /></Dependent></ReferentialConstraint></Association></Schema><Schema Namespace="ODataWebV3.Northwind.Model" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"><EntityContainer Name="NorthwindEntities" m:IsDefaultEntityContainer="true" p6:LazyLoadingEnabled="true" xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation"><EntitySet Name="Categories" EntityType="NorthwindModel.Category" /><EntitySet Name="CustomerDemographics" EntityType="NorthwindModel.CustomerDemographic" /><EntitySet
Name="Customers" EntityType="NorthwindModel.Customer" /><EntitySet Name="Employees" EntityType="NorthwindModel.Employee" /><EntitySet Name="Order_Details" EntityType="NorthwindModel.Order_Detail" /><EntitySet Name="Orders" EntityType="NorthwindModel.Order" /><EntitySet Name="Products" EntityType="NorthwindModel.Product" /><EntitySet Name="Regions" EntityType="NorthwindModel.Region" /><EntitySet Name="Shippers" EntityType="NorthwindModel.Shipper" /><EntitySet Name="Suppliers" EntityType="NorthwindModel.Supplier" /><EntitySet Name="Territories" EntityType="NorthwindModel.Territory" /><EntitySet Name="Alphabetical_list_of_products" EntityType="NorthwindModel.Alphabetical_list_of_product" /><EntitySet Name="Category_Sales_for_1997" EntityType="NorthwindModel.Category_Sales_for_1997" /><EntitySet Name="Current_Product_Lists" EntityType="NorthwindModel.Current_Product_List" /><EntitySet Name="Customer_and_Suppliers_by_Cities" EntityType="NorthwindModel.Customer_and_Suppliers_by_City" /><
EntitySet Name="Invoices" EntityType="NorthwindModel.Invoice" /><EntitySet Name="Order_Details_Extendeds" EntityType="NorthwindModel.Order_Details_Extended" /><EntitySet Name="Order_Subtotals" EntityType="NorthwindModel.Order_Subtotal" /><EntitySet Name="Orders_Qries" EntityType="NorthwindModel.Orders_Qry" /><EntitySet Name="Product_Sales_for_1997" EntityType="NorthwindModel.Product_Sales_for_1997" /><EntitySet Name="Products_Above_Average_Prices" EntityType="NorthwindModel.Products_Above_Average_Price" /><EntitySet Name="Products_by_Categories" EntityType="NorthwindModel.Products_by_Category" /><EntitySet Name="Sales_by_Categories" EntityType="NorthwindModel.Sales_by_Category" /><EntitySet Name="Sales_Totals_by_Amounts" EntityType="NorthwindModel.Sales_Totals_by_Amount" /><EntitySet Name="Summary_of_Sales_by_Quarters" EntityType="NorthwindModel.Summary_of_Sales_by_Quarter" /><EntitySet Name="Summary_of_Sales_by_Years" EntityType="NorthwindModel.Summary_of_Sales_by_Year" /><Associat
ionSet Name="FK_Products_Categories" Association="NorthwindModel.FK_Products_Categories"><End Role="Categories" EntitySet="Categories" /><End Role="Products" EntitySet="Products" /></AssociationSet><AssociationSet Name="CustomerCustomerDemo" Association="NorthwindModel.CustomerCustomerDemo"><End Role="CustomerDemographics" EntitySet="CustomerDemographics" /><End Role="Customers" EntitySet="Customers" /></AssociationSet><AssociationSet Name="FK_Orders_Customers" Association="NorthwindModel.FK_Orders_Customers"><End Role="Customers" EntitySet="Customers" /><End Role="Orders" EntitySet="Orders" /></AssociationSet><AssociationSet Name="FK_Employees_Employees" Association="NorthwindModel.FK_Employees_Employees"><End Role="Employees" EntitySet="Employees" /><End Role="Employees1" EntitySet="Employees" /></AssociationSet><AssociationSet Name="FK_Orders_Employees" Association="NorthwindModel.FK_Orders_Employees"><End Role="Employees" EntitySet="Employees" /><End Role="Orders" EntitySet="Ord
ers" /></AssociationSet><AssociationSet Name="EmployeeTerritories" Association="NorthwindModel.EmployeeTerritories"><End Role="Employees" EntitySet="Employees" /><End Role="Territories" EntitySet="Territories" /></AssociationSet><AssociationSet Name="FK_Order_Details_Orders" Association="NorthwindModel.FK_Order_Details_Orders"><End Role="Order_Details" EntitySet="Order_Details" /><End Role="Orders" EntitySet="Orders" /></AssociationSet><AssociationSet Name="FK_Order_Details_Products" Association="NorthwindModel.FK_Order_Details_Products"><End Role="Order_Details" EntitySet="Order_Details" /><End Role="Products" EntitySet="Products" /></AssociationSet><AssociationSet Name="FK_Orders_Shippers" Association="NorthwindModel.FK_Orders_Shippers"><End Role="Orders" EntitySet="Orders" /><End Role="Shippers" EntitySet="Shippers" /></AssociationSet><AssociationSet Name="FK_Products_Suppliers" Association="NorthwindModel.FK_Products_Suppliers"><End Role="Products" EntitySet="Products" /><End Ro
le="Suppliers" EntitySet="Suppliers" /></AssociationSet><AssociationSet Name="FK_Territories_Region" Association="NorthwindModel.FK_Territories_Region"><End Role="Region" EntitySet="Regions" /><End Role="Territories" EntitySet="Territories" /></AssociationSet></EntityContainer></Schema></edmx:DataServices></edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/serviceDocument.json
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/serviceDocument.json b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/serviceDocument.json
new file mode 100644
index 0000000..791f961
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/serviceDocument.json
@@ -0,0 +1,33 @@
+{
+ "odata.metadata": "http://services.odata.org/V3/OData/OData.svc/$metadata",
+ "value": [
+ {
+ "name": "Products",
+ "url": "Products"
+ },
+ {
+ "name": "ProductDetails",
+ "url": "ProductDetails"
+ },
+ {
+ "name": "Categories",
+ "url": "Categories"
+ },
+ {
+ "name": "Suppliers",
+ "url": "Suppliers"
+ },
+ {
+ "name": "Persons",
+ "url": "Persons"
+ },
+ {
+ "name": "PersonDetails",
+ "url": "PersonDetails"
+ },
+ {
+ "name": "Advertisements",
+ "url": "Advertisements"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/serviceDocument.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/serviceDocument.xml b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/serviceDocument.xml
new file mode 100644
index 0000000..0981814
--- /dev/null
+++ b/lib/client-core/src/test/resources/org/apache/olingo/client/core/v3/serviceDocument.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<service xml:base="http://services.odata.org/V3/OData/OData.svc/"
+ xmlns="http://www.w3.org/2007/app"
+ xmlns:atom="http://www.w3.org/2005/Atom">
+ <workspace>
+ <atom:title>Default</atom:title>
+ <collection href="Products">
+ <atom:title>Products</atom:title>
+ </collection>
+ <collection href="ProductDetails">
+ <atom:title>ProductDetails</atom:title>
+ </collection>
+ <collection href="Categories">
+ <atom:title>Categories</atom:title>
+ </collection>
+ <collection href="Suppliers">
+ <atom:title>Suppliers</atom:title>
+ </collection>
+ <collection href="Persons">
+ <atom:title>Persons</atom:title>
+ </collection>
+ <collection href="PersonDetails">
+ <atom:title>PersonDetails</atom:title>
+ </collection>
+ <collection href="Advertisements">
+ <atom:title>Advertisements</atom:title>
+ </collection>
+ </workspace>
+</service>
[48/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityType.java
new file mode 100644
index 0000000..a413edf
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EntityType.java
@@ -0,0 +1,32 @@
+/*
+ * 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.api.edm.xml;
+
+public interface EntityType extends ComplexType {
+
+ boolean isAbstractEntityType();
+
+ String getBaseType();
+
+ boolean isOpenType();
+
+ EntityKey getKey();
+
+ boolean isHasStream();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EnumType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EnumType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EnumType.java
new file mode 100644
index 0000000..318dc17
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/EnumType.java
@@ -0,0 +1,34 @@
+/*
+ * 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.api.edm.xml;
+
+import java.util.List;
+
+public interface EnumType extends Named {
+
+ String getUnderlyingType();
+
+ boolean isFlags();
+
+ List<Member> getMembers();
+
+ Member getMember(String name);
+
+ Member getMember(Integer value);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Member.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Member.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Member.java
new file mode 100644
index 0000000..0cb9b74
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Member.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.edm.xml;
+
+public interface Member {
+
+ String getName();
+
+ String getValue();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Named.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Named.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Named.java
new file mode 100644
index 0000000..bf7d602
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Named.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.edm.xml;
+
+public interface Named {
+
+ String getName();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDelete.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDelete.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDelete.java
new file mode 100644
index 0000000..7ebbfb3
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDelete.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.edm.xml;
+
+public interface OnDelete {
+
+ OnDeleteAction getAction();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDeleteAction.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDeleteAction.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDeleteAction.java
new file mode 100644
index 0000000..b8daec0
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/OnDeleteAction.java
@@ -0,0 +1,28 @@
+/*
+ * 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.api.edm.xml;
+
+public enum OnDeleteAction {
+
+ Cascade,
+ None,
+ SetNull,
+ SetDefault;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/PropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/PropertyRef.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/PropertyRef.java
new file mode 100644
index 0000000..8de4a22
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/PropertyRef.java
@@ -0,0 +1,25 @@
+/*
+ * 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.api.edm.xml;
+
+public interface PropertyRef extends Named {
+
+ String getAlias();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Schema.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Schema.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Schema.java
new file mode 100644
index 0000000..cee0c9a
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/Schema.java
@@ -0,0 +1,74 @@
+/*
+ * 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.api.edm.xml;
+
+import java.util.List;
+
+public interface Schema {
+
+ String getNamespace();
+
+ String getAlias();
+
+ List<? extends EntityType> getEntityTypes();
+
+ List<EnumType> getEnumTypes();
+
+ EnumType getEnumType(String name);
+
+ List<? extends CommonAnnotations> getAnnotationsList();
+
+ CommonAnnotations getAnnotationsList(String target);
+
+ List<? extends ComplexType> getComplexTypes();
+
+ List<? extends EntityContainer> getEntityContainers();
+
+ /**
+ * Gets default entity container.
+ *
+ * @return default entity container.
+ */
+ EntityContainer getDefaultEntityContainer();
+
+ /**
+ * Gets entity container with the given name.
+ *
+ * @param name name.
+ * @return entity container.
+ */
+ EntityContainer getEntityContainer(String name);
+
+ /**
+ * Gets entity type with the given name.
+ *
+ * @param name name.
+ * @return entity type.
+ */
+ EntityType getEntityType(String name);
+
+ /**
+ * Gets complex type with the given name.
+ *
+ * @param name name.
+ * @return complex type.
+ */
+ ComplexType getComplexType(String name);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java
new file mode 100644
index 0000000..bcb5973
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/XMLMetadata.java
@@ -0,0 +1,59 @@
+/*
+ * 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.api.edm.xml;
+
+import java.util.List;
+
+/**
+ * Entry point for access information about EDM metadata.
+ */
+public interface XMLMetadata {
+
+ /**
+ * Checks whether the given key is a valid namespace or alias in the EdM metadata document.
+ *
+ * @param key namespace or alias
+ * @return true if key is valid namespace or alias
+ */
+ boolean isNsOrAlias(String key);
+
+ /**
+ * Returns the Schema at the specified position in the EdM metadata document.
+ *
+ * @param index index of the Schema to return
+ * @return the Schema at the specified position in the EdM metadata document
+ */
+ Schema getSchema(final int index);
+
+ /**
+ * Returns the Schema with the specified key (namespace or alias) in the EdM metadata document.
+ *
+ * @param key namespace or alias
+ * @return the Schema with the specified key in the EdM metadata document
+ */
+ Schema getSchema(final String key);
+
+ /**
+ * Returns all Schema objects defined in the EdM metadata document.
+ *
+ * @return all Schema objects defined in the EdM metadata document
+ */
+ List<? extends Schema> getSchemas();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Annotations.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Annotations.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Annotations.java
new file mode 100644
index 0000000..55ee38e
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Annotations.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.CommonAnnotations;
+
+public interface Annotations extends CommonAnnotations {
+
+ List<TypeAnnotation> getTypeAnnotations();
+
+ List<ValueAnnotation> getValueAnnotations();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Association.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Association.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Association.java
new file mode 100644
index 0000000..5c53201
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Association.java
@@ -0,0 +1,31 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface Association extends Named {
+
+ ReferentialConstraint getReferentialConstraint();
+
+ List<AssociationEnd> getEnds();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationEnd.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationEnd.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationEnd.java
new file mode 100644
index 0000000..88cd78e
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationEnd.java
@@ -0,0 +1,32 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import org.apache.olingo.client.api.edm.xml.OnDelete;
+
+public interface AssociationEnd {
+
+ String getType();
+
+ String getRole();
+
+ String getMultiplicity();
+
+ OnDelete getOnDelete();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationSet.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationSet.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationSet.java
new file mode 100644
index 0000000..a6b4b44
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationSet.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface AssociationSet extends Named {
+
+ String getAssociation();
+
+ List<AssociationSetEnd> getEnds();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationSetEnd.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationSetEnd.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationSetEnd.java
new file mode 100644
index 0000000..2db89cc
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/AssociationSetEnd.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.edm.xml.v3;
+
+public interface AssociationSetEnd {
+
+ String getRole();
+
+ String getEntitySet();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/FunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/FunctionImport.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/FunctionImport.java
new file mode 100644
index 0000000..212507b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/FunctionImport.java
@@ -0,0 +1,43 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import java.util.List;
+
+public interface FunctionImport extends org.apache.olingo.client.api.edm.xml.CommonFunctionImport {
+
+ String getReturnType();
+
+ String getEntitySet();
+
+ String getEntitySetPath();
+
+ boolean isComposable();
+
+ boolean isSideEffecting();
+
+ boolean isBindable();
+
+ boolean isAlwaysBindable();
+
+ String getHttpMethod();
+
+ List<Parameter> getParameters();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/NavigationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/NavigationProperty.java
new file mode 100644
index 0000000..d7ef556
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/NavigationProperty.java
@@ -0,0 +1,29 @@
+/*
+ * 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.api.edm.xml.v3;
+
+public interface NavigationProperty extends org.apache.olingo.client.api.edm.xml.CommonNavigationProperty {
+
+ String getRelationship();
+
+ String getToRole();
+
+ String getFromRole();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Parameter.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Parameter.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Parameter.java
new file mode 100644
index 0000000..a5f5c88
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Parameter.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.edm.xml.v3;
+
+public interface Parameter extends org.apache.olingo.client.api.edm.xml.CommonParameter {
+
+ ParameterMode getMode();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ParameterMode.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ParameterMode.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ParameterMode.java
new file mode 100644
index 0000000..a9710a1
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ParameterMode.java
@@ -0,0 +1,27 @@
+/*
+ * 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.api.edm.xml.v3;
+
+public enum ParameterMode {
+
+ In,
+ Out,
+ InOut
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Property.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Property.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Property.java
new file mode 100644
index 0000000..c254f9a
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Property.java
@@ -0,0 +1,38 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import org.apache.olingo.client.api.edm.xml.CommonProperty;
+import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
+
+public interface Property extends CommonProperty {
+
+ String getFcSourcePath();
+
+ String getFcTargetPath();
+
+ EdmContentKind getFcContentKind();
+
+ String getFcNSPrefix();
+
+ String getFcNSURI();
+
+ boolean isFcKeepInContent();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/PropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/PropertyValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/PropertyValue.java
new file mode 100644
index 0000000..96ce4be
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/PropertyValue.java
@@ -0,0 +1,43 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+
+public interface PropertyValue {
+
+ String getProperty();
+
+ String getPath();
+
+ String getString();
+
+ BigInteger getInt();
+
+ Double getFloat();
+
+ BigDecimal getDecimal();
+
+ Boolean getBool();
+
+ Date getDateTime();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ReferentialConstraint.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ReferentialConstraint.java
new file mode 100644
index 0000000..bbb2574
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ReferentialConstraint.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.edm.xml.v3;
+
+public interface ReferentialConstraint {
+
+ ReferentialConstraintRole getPrincipal();
+
+ ReferentialConstraintRole getDependent();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ReferentialConstraintRole.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ReferentialConstraintRole.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ReferentialConstraintRole.java
new file mode 100644
index 0000000..f5a76dc
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ReferentialConstraintRole.java
@@ -0,0 +1,31 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.PropertyRef;
+
+public interface ReferentialConstraintRole {
+
+ String getRole();
+
+ List<PropertyRef> getPropertyRefs();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/TypeAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/TypeAnnotation.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/TypeAnnotation.java
new file mode 100644
index 0000000..26a8475
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/TypeAnnotation.java
@@ -0,0 +1,31 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import java.util.List;
+
+public interface TypeAnnotation {
+
+ String getTerm();
+
+ String getQualifier();
+
+ List<PropertyValue> getPropertyValues();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Using.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Using.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Using.java
new file mode 100644
index 0000000..aa9dc77
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/Using.java
@@ -0,0 +1,27 @@
+/*
+ * 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.api.edm.xml.v3;
+
+public interface Using {
+
+ String getNamespace();
+
+ String getAlias();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ValueAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ValueAnnotation.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ValueAnnotation.java
new file mode 100644
index 0000000..d6f8d71
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ValueAnnotation.java
@@ -0,0 +1,45 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+
+public interface ValueAnnotation {
+
+ Boolean getBool();
+
+ Date getDateTime();
+
+ BigDecimal getDecimal();
+
+ Double getFloat();
+
+ BigInteger getInt();
+
+ String getPath();
+
+ String getQualifier();
+
+ String getString();
+
+ String getTerm();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ValueTerm.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ValueTerm.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ValueTerm.java
new file mode 100644
index 0000000..09b9a81
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v3/ValueTerm.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.edm.xml.v3;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface ValueTerm extends Named {
+
+ String getType();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Action.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Action.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Action.java
new file mode 100644
index 0000000..1591c5f
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Action.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.api.edm.xml.v4;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface Action extends Named {
+
+ boolean isBound();
+
+ String getEntitySetPath();
+
+ List<Parameter> getParameters();
+
+ Parameter getParameter(String name);
+
+ ReturnType getReturnType();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ActionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ActionImport.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ActionImport.java
new file mode 100644
index 0000000..3cf9713
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ActionImport.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface ActionImport extends OperationImport {
+
+ String getAction();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/AnnotatedEdmItem.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/AnnotatedEdmItem.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/AnnotatedEdmItem.java
new file mode 100644
index 0000000..e488629
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/AnnotatedEdmItem.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface AnnotatedEdmItem {
+
+ Annotation getAnnotation();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Annotation.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Annotation.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Annotation.java
new file mode 100644
index 0000000..b70e729
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Annotation.java
@@ -0,0 +1,33 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.ConstExprConstruct;
+import org.apache.olingo.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+public interface Annotation {
+
+ String getTerm();
+
+ String getQualifier();
+
+ ConstExprConstruct getConstExpr();
+
+ DynExprConstruct getDynExpr();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Annotations.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Annotations.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Annotations.java
new file mode 100644
index 0000000..fc481a2
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Annotations.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.CommonAnnotations;
+
+public interface Annotations extends CommonAnnotations {
+
+ List<? extends Annotation> getAnnotations();
+
+ Annotation getAnnotation(String term);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/BindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/BindingTarget.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/BindingTarget.java
new file mode 100644
index 0000000..f4d8491
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/BindingTarget.java
@@ -0,0 +1,28 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface BindingTarget extends Named, AnnotatedEdmItem {
+
+ List<? extends NavigationPropertyBinding> getNavigationPropertyBindings();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/CSDLElement.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/CSDLElement.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/CSDLElement.java
new file mode 100644
index 0000000..18489e7
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/CSDLElement.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.api.edm.xml.v4;
+
+public enum CSDLElement {
+
+ ActionImport,
+ ComplexType,
+ EntityContainer,
+ EntitySet,
+ EntityType,
+ EnumType,
+ FunctionImport,
+ Member,
+ NavigationProperty,
+ Property,
+ Singleton,
+ Term,
+ TypeDefinition
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ComplexType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ComplexType.java
new file mode 100644
index 0000000..bc93911
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ComplexType.java
@@ -0,0 +1,43 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.util.List;
+
+public interface ComplexType extends org.apache.olingo.client.api.edm.xml.ComplexType, AnnotatedEdmItem {
+
+ boolean isAbstractEntityType();
+
+ String getBaseType();
+
+ boolean isOpenType();
+
+ @Override
+ Property getProperty(String name);
+
+ @Override
+ List<Property> getProperties();
+
+ @Override
+ NavigationProperty getNavigationProperty(String name);
+
+ @Override
+ List<NavigationProperty> getNavigationProperties();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Edmx.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Edmx.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Edmx.java
new file mode 100644
index 0000000..aa3eb5c
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Edmx.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.util.List;
+
+public interface Edmx extends org.apache.olingo.client.api.edm.xml.Edmx {
+
+ List<Reference> getReferences();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntityContainer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntityContainer.java
new file mode 100644
index 0000000..a12cc47
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntityContainer.java
@@ -0,0 +1,44 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.util.List;
+
+public interface EntityContainer extends org.apache.olingo.client.api.edm.xml.EntityContainer {
+
+ EntitySet getEntitySet(String name);
+
+ List<EntitySet> getEntitySets();
+
+ List<Singleton> getSingletons();
+
+ Singleton getSingleton(String name);
+
+ ActionImport getActionImport(String name);
+
+ List<ActionImport> getActionImports(String name);
+
+ List<ActionImport> getActionImports();
+
+ FunctionImport getFunctionImport(String name);
+
+ List<FunctionImport> getFunctionImports(String name);
+
+ List<FunctionImport> getFunctionImports();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntitySet.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntitySet.java
new file mode 100644
index 0000000..c72c277
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntitySet.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface EntitySet extends org.apache.olingo.client.api.edm.xml.EntitySet, BindingTarget {
+
+ boolean isIncludeInServiceDocument();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntityType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntityType.java
new file mode 100644
index 0000000..132c82b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/EntityType.java
@@ -0,0 +1,23 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface EntityType extends org.apache.olingo.client.api.edm.xml.EntityType, ComplexType {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Function.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Function.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Function.java
new file mode 100644
index 0000000..e097c6b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Function.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface Function extends Action {
+
+ boolean isComposable();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/FunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/FunctionImport.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/FunctionImport.java
new file mode 100644
index 0000000..fa1b8dc
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/FunctionImport.java
@@ -0,0 +1,28 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.CommonFunctionImport;
+
+public interface FunctionImport extends OperationImport, CommonFunctionImport {
+
+ String getFunction();
+
+ boolean isIncludeInServiceDocument();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Include.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Include.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Include.java
new file mode 100644
index 0000000..96708e4
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Include.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface Include {
+
+ String getAlias();
+
+ String getNamespace();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/IncludeAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/IncludeAnnotations.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/IncludeAnnotations.java
new file mode 100644
index 0000000..b200ee9
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/IncludeAnnotations.java
@@ -0,0 +1,28 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface IncludeAnnotations {
+
+ String getQualifier();
+
+ String getTargeyNamespace();
+
+ String getTermNamespace();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/NavigationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/NavigationProperty.java
new file mode 100644
index 0000000..e0885fe
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/NavigationProperty.java
@@ -0,0 +1,40 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.OnDelete;
+
+import java.util.List;
+
+public interface NavigationProperty
+ extends org.apache.olingo.client.api.edm.xml.CommonNavigationProperty, AnnotatedEdmItem {
+
+ String getType();
+
+ boolean isNullable();
+
+ String getPartner();
+
+ boolean isContainsTarget();
+
+ List<ReferentialConstraint> getReferentialConstraints();
+
+ OnDelete getOnDelete();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/NavigationPropertyBinding.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/NavigationPropertyBinding.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/NavigationPropertyBinding.java
new file mode 100644
index 0000000..35d76f8
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/NavigationPropertyBinding.java
@@ -0,0 +1,27 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface NavigationPropertyBinding {
+
+ String getPath();
+
+ String getTarget();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/OperationImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/OperationImport.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/OperationImport.java
new file mode 100644
index 0000000..292df86
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/OperationImport.java
@@ -0,0 +1,28 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface OperationImport extends Named, AnnotatedEdmItem {
+
+ String getEntitySet();
+
+ void setEntitySet(String entitySet);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Parameter.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Parameter.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Parameter.java
new file mode 100644
index 0000000..0b8b975
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Parameter.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface Parameter extends org.apache.olingo.client.api.edm.xml.CommonParameter {
+
+ String getSrid();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Property.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Property.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Property.java
new file mode 100644
index 0000000..20d909a
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Property.java
@@ -0,0 +1,25 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.CommonProperty;
+
+public interface Property extends CommonProperty, AnnotatedEdmItem {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Reference.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Reference.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Reference.java
new file mode 100644
index 0000000..d9f2f6b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Reference.java
@@ -0,0 +1,33 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.net.URI;
+import java.util.List;
+
+public interface Reference {
+
+ URI getUri();
+
+ List<Include> getIncludes();
+
+ List<IncludeAnnotations> getIncludeAnnotations();
+
+ List<Annotation> getAnnotations();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ReferentialConstraint.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ReferentialConstraint.java
new file mode 100644
index 0000000..98c64c5
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ReferentialConstraint.java
@@ -0,0 +1,27 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface ReferentialConstraint {
+
+ String getProperty();
+
+ String getReferencedProperty();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ReturnType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ReturnType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ReturnType.java
new file mode 100644
index 0000000..6ace4fe
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/ReturnType.java
@@ -0,0 +1,34 @@
+/*
+ * 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.api.edm.xml.v4;
+
+public interface ReturnType {
+
+ Integer getMaxLength();
+
+ Integer getPrecision();
+
+ Integer getScale();
+
+ String getSrid();
+
+ String getType();
+
+ boolean isNullable();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Schema.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Schema.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Schema.java
new file mode 100644
index 0000000..961b27e
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Schema.java
@@ -0,0 +1,64 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.util.List;
+
+public interface Schema extends org.apache.olingo.client.api.edm.xml.Schema, AnnotatedEdmItem {
+
+ @Override
+ List<EntityContainer> getEntityContainers();
+
+ EntityContainer getEntityContainer();
+
+ @Override
+ ComplexType getComplexType(String name);
+
+ @Override
+ List<ComplexType> getComplexTypes();
+
+ @Override
+ EntityType getEntityType(String name);
+
+ @Override
+ List<EntityType> getEntityTypes();
+
+ List<Action> getActions();
+
+ List<Action> getActions(String name);
+
+ List<Annotation> getAnnotations();
+
+ List<Function> getFunctions();
+
+ List<Function> getFunctions(String name);
+
+ List<Term> getTerms();
+
+ TypeDefinition getTypeDefinition(String name);
+
+ List<TypeDefinition> getTypeDefinitions();
+
+ @Override
+ List<Annotations> getAnnotationsList();
+
+ @Override
+ Annotations getAnnotationsList(String target);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Singleton.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Singleton.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Singleton.java
new file mode 100644
index 0000000..b1df8f4
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Singleton.java
@@ -0,0 +1,25 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import org.apache.olingo.client.api.edm.xml.EntitySet;
+
+public interface Singleton extends EntitySet, BindingTarget {
+
+}
[33/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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();
- }
-}
[32/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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/EntitySetBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntitySetBuilder.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntitySetBuilder.java
deleted file mode 100644
index 8d4faad..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntitySetBuilder.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 org.apache.olingo.odata4.client.core.deserializer;
-
-import java.io.IOException;
-
-import org.apache.olingo.odata4.client.api.deserializer.EntitySet;
-
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-
-public class EntitySetBuilder {
-
- private final JsonParser parser;
-
- public EntitySetBuilder(final JsonParser jp) {
- parser = jp;
- }
-
- public EntitySet buildEntitySet() throws JsonParseException, IOException {
- return parseEntitySet(parser);
- }
-
- private EntitySet parseEntitySet(final JsonParser jp) throws JsonParseException, IOException {
- final EntitySetImpl entitySet = new EntitySetImpl();
- boolean arrayStarted = false;
-
- while (jp.nextToken() != null) {
- final JsonToken token = jp.getCurrentToken();
- switch (token) {
- case START_ARRAY:
- final PropertyCollectionBuilder builder = new PropertyCollectionBuilder(jp, entitySet);
- entitySet.setPropertyCollectionBuilder(builder);
- arrayStarted = true;
- break;
-
- case START_OBJECT:
- if (arrayStarted) {
- return entitySet;
- }
- break;
-
- case VALUE_NUMBER_INT:
- case VALUE_STRING:
- entitySet.addAnnotation(jp.getCurrentName(), jp.getValueAsString());
- break;
-
- default:
- break;
- }
- }
-
- return entitySet;
- }
-}
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/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntitySetImpl.java
deleted file mode 100644
index 1c9dd66..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/EntitySetImpl.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 org.apache.olingo.odata4.client.core.deserializer;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.olingo.odata4.client.api.deserializer.Entity;
-import org.apache.olingo.odata4.client.api.deserializer.EntitySet;
-
-import com.fasterxml.jackson.core.JsonParseException;
-
-public class EntitySetImpl implements EntitySet, Iterator<Entity> {
-
- private String odataContext;
-
- private Long odataCount;
-
- private String odataNextLink;
-
- private String odataDeltaLink;
-
- private List<Entity> entities = null;
-
- private PropertyCollectionBuilder propertyCollectionsBuilder;
-
- @Override
- public String getODataContext() {
- return odataContext;
- }
-
- @Override
- public Long getODataCount() {
- return odataCount;
- }
-
- @Override
- public String getODataNextLink() {
- return odataNextLink;
- }
-
- @Override
- public String getODataDeltaLink() {
- return odataDeltaLink;
- }
-
- public void addAnnotation(final String name, final String value) {
- if ("odata.context".equalsIgnoreCase(name)) {
- odataContext = value;
- } else if ("odata.deltaLink".equalsIgnoreCase(name)) {
- odataDeltaLink = value;
- } else if ("odata.count".equalsIgnoreCase(name)) {
- odataCount = Long.parseLong(value);
- } else if ("odata.nextLink".equalsIgnoreCase(name)) {
- odataNextLink = value;
- }
- }
-
- @Override
- public List<Entity> getEntities() {
- if (entities == null) {
- entities = new ArrayList<Entity>();
-
- while (propertyCollectionsBuilder.parseNext()) {
- entities.add(propertyCollectionsBuilder.buildEntity());
- }
- }
-
- return entities;
- }
-
- public void setPropertyCollectionBuilder(final PropertyCollectionBuilder builder) {
- propertyCollectionsBuilder = builder;
- }
-
- @Override
- public boolean hasNext() {
- try {
- return propertyCollectionsBuilder.hasNext();
- } catch (JsonParseException e) {
- } catch (IOException e) {
- }
- return false;
- }
-
- @Override
- public Entity next() {
- if (propertyCollectionsBuilder.parseNext()) {
- return propertyCollectionsBuilder.buildEntity();
- }
- return null;
- }
-
- @Override
- public void remove() {
- }
-
- @Override
- public Iterator<Entity> iterator() {
- return 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/deserializer/JsonReader.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/JsonReader.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/JsonReader.java
deleted file mode 100644
index 1cbe6c1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/JsonReader.java
+++ /dev/null
@@ -1,89 +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.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-
-import org.apache.olingo.odata4.client.api.deserializer.ClientException;
-import org.apache.olingo.odata4.client.api.deserializer.Entity;
-import org.apache.olingo.odata4.client.api.deserializer.EntitySet;
-import org.apache.olingo.odata4.client.api.deserializer.Property;
-import org.apache.olingo.odata4.client.api.deserializer.Reader;
-import org.apache.olingo.odata4.client.api.deserializer.StructuralProperty;
-
-import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonParser;
-
-public class JsonReader implements Reader {
-
- @Override
- public EntitySet readEntitySet(final InputStream in) throws ClientException {
-
- final JsonFactory jsonFactory = new JsonFactory();
- // or, for data binding, org.codehaus.jackson.mapper.MappingJsonFactory
- try {
- JsonParser jp = jsonFactory.createParser(in);
- EntitySetBuilder entitySet = new EntitySetBuilder(jp);
- return entitySet.buildEntitySet();
- } catch (JsonParseException e) {
- throw new ClientException("JSON Parsing failed.", e);
- } catch (IOException e) {
- throw new ClientException("JSON Parsing failed.", e);
- }
- }
-
- @Override
- public Entity readEntity(final InputStream in) throws ClientException {
- Entity entity = null;
-
- final JsonFactory jsonFactory = new JsonFactory();
- // or, for data binding, org.codehaus.jackson.mapper.MappingJsonFactory
- try {
- final JsonParser jp = jsonFactory.createParser(in);
- final PropertyCollectionBuilder builder = new PropertyCollectionBuilder(jp);
- builder.parseNext();
- entity = builder.buildEntity();
- } catch (JsonParseException e) {
- throw new ClientException("JSON Parsing failed.", e);
- } catch (IOException e) {
- throw new ClientException("JSON Parsing failed.", e);
- }
-
- return entity;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.olingo.core.consumer.Reader#parseProperty(java.io.InputStream)
- */
- @Override
- public Property readProperty(final InputStream in) throws ClientException {
- final Entity entity = readEntity(in);
-
- final Map<String, StructuralProperty> properties = entity.getStructuralProperties();
- if (properties.size() == 1) {
- return properties.values().iterator().next();
- }
- return null;
- }
-}
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/NavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/NavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/NavigationPropertyImpl.java
deleted file mode 100644
index c16dafb..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/NavigationPropertyImpl.java
+++ /dev/null
@@ -1,89 +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.NavigationProperty;
-
-public class NavigationPropertyImpl implements NavigationProperty {
-
- private final String name;
-
- private String associationLink;
-
- private String navigationLink;
-
- public NavigationPropertyImpl(final String name) {
- this.name = parseName(name);
- }
-
- public NavigationPropertyImpl(final String name, final String link) {
- this(name);
- updateLink(name, link);
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getAssociationLink() {
- return associationLink;
- }
-
- @Override
- public String getNavigationLink() {
- return navigationLink;
- }
-
- public void updateLink(final String name, final String link) {
- final String regexNavigationLink = ".*@odata.navigationLink$";
- final String regexAssociationLink = ".*@odata.associationLink$";
- if (name.matches(regexNavigationLink)) {
- navigationLink = link;
- } else if (name.matches(regexAssociationLink)) {
- associationLink = link;
- }
- }
-
- private String parseName(final String nameToParse) {
- final String[] split = nameToParse.split("@");
- if (split.length == 2) {
- return split[0];
- } else {
- throw new IllegalArgumentException("Got OData Navigation with unparseable format '"
- + nameToParse + "'.");
- }
- }
-
- public void updateLink(final NavigationProperty navigationProperty) {
- if (navigationProperty.getAssociationLink() != null) {
- associationLink = navigationProperty.getAssociationLink();
- }
- if (navigationProperty.getNavigationLink() != null) {
- navigationLink = navigationProperty.getNavigationLink();
- }
- }
-
- @Override
- public String toString() {
- return "NavigationPropertyImpl [name=" + name + ", associationLink=" + associationLink
- + ", navigationLink=" + navigationLink + "]";
- }
-}
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/PrimitiveValue.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/PrimitiveValue.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/PrimitiveValue.java
deleted file mode 100644
index b0de76d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/PrimitiveValue.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.deserializer;
-
-import org.apache.olingo.odata4.client.api.deserializer.Value;
-
-public class PrimitiveValue implements Value {
-
- private final Object content;
-
- public PrimitiveValue(final Object content) {
- this.content = content;
- }
-
- @Override
- public boolean isComplex() {
- return false;
- }
-
- @Override
- public Object getContent() {
- return content;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public <T> T getContentAs(final T type) {
- return (T) content;
- }
-
- @Override
- public String toString() {
- return String.valueOf(content);
- }
-}
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/PropertyCollection.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/PropertyCollection.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/PropertyCollection.java
deleted file mode 100644
index 0784ea4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/PropertyCollection.java
+++ /dev/null
@@ -1,96 +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.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.olingo.odata4.client.api.deserializer.AnnotationProperty;
-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;
-
-abstract class PropertyCollection {
-
- protected Map<String, AnnotationProperty> annotationProperties = new HashMap<String, AnnotationProperty>();
-
- protected Map<String, NavigationProperty> navigationProperties = new HashMap<String, NavigationProperty>();
-
- protected Map<String, StructuralProperty> structuralProperties = new HashMap<String, StructuralProperty>();
-
- public PropertyCollection() {
- }
-
- protected PropertyCollection(final Map<String, AnnotationProperty> annotationProperties,
- final Map<String, NavigationProperty> navigationProperties,
- final Map<String, StructuralProperty> structuralProperties) {
-
- this.annotationProperties = annotationProperties;
- this.navigationProperties = navigationProperties;
- this.structuralProperties = structuralProperties;
- }
-
- public List<Property> getProperties() {
- final int initialCapacity = annotationProperties.size() + navigationProperties.size() + structuralProperties.size();
-
- final List<Property> properties = new ArrayList<Property>(initialCapacity);
- properties.addAll(annotationProperties.values());
- properties.addAll(navigationProperties.values());
- properties.addAll(structuralProperties.values());
-
- return properties;
- }
-
- public Map<String, AnnotationProperty> getAnnotationProperties() {
- return Collections.unmodifiableMap(annotationProperties);
- }
-
- public Map<String, NavigationProperty> getNavigationProperties() {
- return Collections.unmodifiableMap(navigationProperties);
- }
-
- public Map<String, StructuralProperty> getStructuralProperties() {
- return Collections.unmodifiableMap(structuralProperties);
- }
-
- public void addProperty(final Property property) {
- if (property == null) {
- throw new IllegalArgumentException("Property parameter MUST NOT be NULL.");
- }
-
- if (property instanceof NavigationPropertyImpl) {
- final NavigationPropertyImpl navProperty = (NavigationPropertyImpl) navigationProperties.get(property.getName());
- if (navProperty == null) {
- navigationProperties.put(property.getName(), (NavigationPropertyImpl) property);
- } else {
- final NavigationProperty temp = (NavigationProperty) property;
- navProperty.updateLink(temp);
- }
- } else if (property instanceof AnnotationPropertyImpl) {
- annotationProperties.put(property.getName(), (AnnotationPropertyImpl) property);
- } else if (property instanceof StructuralProperty) {
- structuralProperties.put(property.getName(), (StructuralProperty) property);
- } else {
- throw new IllegalArgumentException("Unknown class '" + property.getClass() + "'.");
- }
- }
-}
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/PropertyCollectionBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/PropertyCollectionBuilder.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/PropertyCollectionBuilder.java
deleted file mode 100644
index 30f048d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/PropertyCollectionBuilder.java
+++ /dev/null
@@ -1,220 +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.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-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.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;
-import org.apache.olingo.odata4.client.api.deserializer.Value;
-
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class PropertyCollectionBuilder extends PropertyCollection {
-
- private static final Logger LOG = LoggerFactory.getLogger(PropertyCollectionBuilder.class);
-
- private JsonParser parser;
-
- private EntitySetImpl enclosingEntitySet;
-
- private PropertyCollectionBuilder next = null;
-
- public PropertyCollectionBuilder(final JsonParser parser) {
- this.parser = parser;
- }
-
- private PropertyCollectionBuilder() {
- }
-
- public PropertyCollectionBuilder(final JsonParser jp, final EntitySetImpl entitySet) {
- this(jp);
- enclosingEntitySet = entitySet;
- }
-
- public Entity buildEntity() {
- final Entity entity = new EntityImpl(annotationProperties, navigationProperties, structuralProperties);
- resetProperties();
- return entity;
- }
-
- public ComplexValue buildComplexValue() {
- final ComplexValue value = new ComplexValueImpl(annotationProperties, navigationProperties, structuralProperties);
- resetProperties();
- return value;
- }
-
- private void resetProperties() {
- annotationProperties = new HashMap<String, AnnotationProperty>();
- navigationProperties = new HashMap<String, NavigationProperty>();
- structuralProperties = new HashMap<String, StructuralProperty>();
- }
-
- public boolean hasNext() throws JsonParseException, IOException {
- if (parser.isClosed()) {
- return false;
- }
- next = parseNextObject(parser, this);
- return (next != null);
- }
-
- public boolean parseNext() {
- try {
- if (hasNext()) {
- if (next != null) {
- return true;
- }
-
- if (next == null) {
- parser.close();
- return false;
- }
- return true;
- }
- } catch (JsonParseException e) {
- LOG.error("While parsing", e);
- } catch (IOException e) {
- LOG.error("While parsing", e);
- }
- return false;
-
- }
-
- /**
- *
- * @param jp
- * @param builder
- * @return
- * @throws IOException
- * @throws JsonParseException
- */
- private PropertyCollectionBuilder parseNextObject(final JsonParser jp, final PropertyCollectionBuilder builder)
- throws JsonParseException, IOException {
-
- boolean endReached = readToStartObjectOrEnd(jp);
- if (endReached) {
- return null;
- }
-
- //
- String currentFieldName = null;
- List<Value> values = null;
-
- while (jp.nextToken() != null) {
- final JsonToken token = jp.getCurrentToken();
- switch (token) {
- case START_OBJECT:
- if (currentFieldName != null) {
- final ComplexValue cvp = parseNextObject(jp, new PropertyCollectionBuilder()).buildComplexValue();
- if (values == null) {
- builder.addProperty(new StructuralPropertyImpl(currentFieldName, cvp));
- } else {
- values.add(cvp);
- }
- }
- break;
- case END_OBJECT:
- return builder;
- case START_ARRAY:
- values = new ArrayList<Value>();
- break;
- case END_ARRAY:
- if (values != null) {
- builder.addProperty(new StructuralPropertyImpl(currentFieldName, values));
- values = null;
- }
- break;
- case FIELD_NAME:
- currentFieldName = jp.getCurrentName();
- break;
- case NOT_AVAILABLE:
- break;
- case VALUE_EMBEDDED_OBJECT:
- break;
- case VALUE_NULL:
- Property nullProperty = createProperty(jp.getCurrentName(), null);
- builder.addProperty(nullProperty);
- break;
- case VALUE_FALSE:
- case VALUE_NUMBER_FLOAT:
- case VALUE_NUMBER_INT:
- case VALUE_STRING:
- case VALUE_TRUE:
- if (values == null) {
- Property property = createProperty(jp.getCurrentName(), jp.getValueAsString());
- builder.addProperty(property);
- } else {
- PrimitiveValue value = new PrimitiveValue(jp.getValueAsString());
- values.add(value);
- }
- break;
- default:
- break;
- }
- }
-
- return null;
- }
-
- private boolean readToStartObjectOrEnd(final JsonParser jp) throws IOException, JsonParseException {
- final JsonToken endToken = JsonToken.START_OBJECT;
- JsonToken token = jp.getCurrentToken() == null ? jp.nextToken() : jp.getCurrentToken();
- while (token != null && token != endToken) {
- if (enclosingEntitySet != null) {
- switch (token) {
- case VALUE_FALSE:
- case VALUE_NUMBER_FLOAT:
- case VALUE_NUMBER_INT:
- case VALUE_TRUE:
- case VALUE_STRING:
- enclosingEntitySet.addAnnotation(jp.getCurrentName(), jp.getValueAsString());
- break;
-
- default:
- break;
- }
- }
- //
- token = jp.nextToken();
- }
-
- return token == null;
- }
-
- private Property createProperty(final String name, final String value) {
- if (name.contains("@")) {
- return new NavigationPropertyImpl(name, value);
- } else if (name.contains(".")) {
- return new AnnotationPropertyImpl(name, value);
- } else {
- return new StructuralPropertyImpl(name, new PrimitiveValue(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/StructuralPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/StructuralPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/StructuralPropertyImpl.java
deleted file mode 100644
index 8e4f62e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/deserializer/StructuralPropertyImpl.java
+++ /dev/null
@@ -1,83 +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.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.olingo.odata4.client.api.deserializer.StructuralProperty;
-import org.apache.olingo.odata4.client.api.deserializer.Value;
-
-public class StructuralPropertyImpl implements StructuralProperty {
-
- private final List<Value> values;
-
- private final String name;
-
- private final boolean containsCollection;
-
- public StructuralPropertyImpl(final String name, final Value value) {
- this(name, false, value);
- }
-
- public StructuralPropertyImpl(final String name, final List<Value> values) {
- // XXX: ugly -> refactor
- this(name, true, values.toArray(new Value[0]));
- }
-
- public StructuralPropertyImpl(final String name, final boolean asCollection, final Value... value) {
- if (value == null || value.length == 0) {
- throw new IllegalArgumentException("Missing or NULL value argument.");
- }
-
- containsCollection = asCollection;
- this.name = name;
- values = new ArrayList<Value>(value.length);
- for (Value v : value) {
- values.add(v);
- }
- }
-
- @Override
- public Value getValue() {
- return values.get(0);
- }
-
- @Override
- public List<Value> getValues() {
- return Collections.unmodifiableList(values);
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public boolean containsCollection() {
- return containsCollection;
- }
-
- @Override
- public String toString() {
- return "StructuralPropertyImpl [name=" + name + ", containsCollection=" + containsCollection
- + ", values=" + values + "]";
- }
-}
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/edm/AbstractEdmServiceMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/AbstractEdmServiceMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/AbstractEdmServiceMetadataImpl.java
deleted file mode 100644
index 15e7e2c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/AbstractEdmServiceMetadataImpl.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 org.apache.olingo.odata4.client.core.edm;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-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.edm.xml.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.EntitySet;
-import org.apache.olingo.odata4.client.api.edm.xml.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImportInfo;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySetInfo;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImportInfo;
-import org.apache.olingo.odata4.commons.api.edm.EdmServiceMetadata;
-import org.apache.olingo.odata4.commons.core.edm.EdmEntitySetInfoImpl;
-
-public abstract class AbstractEdmServiceMetadataImpl implements EdmServiceMetadata {
-
- protected final XMLMetadata xmlMetadata;
-
- private List<EdmEntitySetInfo> entitySetInfos;
-
- protected List<EdmFunctionImportInfo> functionImportInfos;
-
- protected List<EdmActionImportInfo> actionImportInfos;
-
- public static EdmServiceMetadata getInstance(final XMLMetadata xmlMetadata) {
- return xmlMetadata instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.XMLMetadataImpl
- ? new org.apache.olingo.odata4.client.core.edm.v3.EdmServiceMetadataImpl(
- (org.apache.olingo.odata4.client.core.edm.xml.v3.XMLMetadataImpl) xmlMetadata)
- : new org.apache.olingo.odata4.client.core.edm.v4.EdmServiceMetadataImpl(
- (org.apache.olingo.odata4.client.core.edm.xml.v4.XMLMetadataImpl) xmlMetadata);
-
- }
-
- public AbstractEdmServiceMetadataImpl(final XMLMetadata xmlMetadata) {
- this.xmlMetadata = xmlMetadata;
- }
-
- @Override
- public InputStream getMetadata() {
- throw new UnsupportedOperationException("Not supported in client code.");
- }
-
- @Override
- public List<EdmEntitySetInfo> getEntitySetInfos() {
- synchronized (this) {
- if (entitySetInfos == null) {
- entitySetInfos = new ArrayList<EdmEntitySetInfo>();
- for (Schema schema : xmlMetadata.getSchemas()) {
- for (EntityContainer entityContainer : schema.getEntityContainers()) {
- for (EntitySet entitySet : entityContainer.getEntitySets()) {
- entitySetInfos.add(
- new EdmEntitySetInfoImpl(entityContainer.getName(), entitySet.getName()));
- }
- }
- }
- }
- return entitySetInfos;
- }
- }
-
- @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/edm/EdmActionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmActionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmActionImpl.java
deleted file mode 100644
index 8cf1eed..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmActionImpl.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.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Action;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public class EdmActionImpl extends EdmOperationImpl implements EdmAction {
-
- public static EdmActionImpl getInstance(final Edm edm, final FullQualifiedName name, final Action action) {
- return EdmOperationImpl.getInstance(new EdmActionImpl(edm, name, action));
- }
-
- private EdmActionImpl(final Edm edm, final FullQualifiedName name, final Action action) {
- super(edm, name, action, EdmTypeKind.ACTION);
- }
-
-}
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/edm/EdmActionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmActionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmActionImportImpl.java
deleted file mode 100644
index 1af0f47..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmActionImportImpl.java
+++ /dev/null
@@ -1,45 +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.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ActionImport;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-
-public class EdmActionImportImpl extends EdmOperationImportImpl implements EdmActionImport {
-
- private final ActionImport actionImport;
-
- public EdmActionImportImpl(final Edm edm, final EdmEntityContainer container, final String name,
- final ActionImport actionImport) {
-
- super(edm, container, name, actionImport.getEntitySet());
- this.actionImport = actionImport;
- }
-
- @Override
- public EdmAction getAction() {
- return edm.getAction(
- new EdmTypeInfo(actionImport.getAction(), container.getNamespace()).getFullQualifiedName(), null, null);
- }
-
-}
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/edm/EdmBindingTargetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmBindingTargetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmBindingTargetImpl.java
deleted file mode 100644
index fd4c66a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmBindingTargetImpl.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.edm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.BindingTarget;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationPropertyBinding;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmBindingTarget;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.Target;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmBindingTarget;
-
-public abstract class EdmBindingTargetImpl extends AbstractEdmBindingTarget {
-
- private final BindingTarget target;
-
- public EdmBindingTargetImpl(final Edm edm, final EdmEntityContainer container,
- final String name, final FullQualifiedName type, final BindingTarget target) {
-
- super(edm, container, name, type);
- this.target = target;
- }
-
- @Override
- public EdmBindingTarget getRelatedBindingTarget(final String path) {
- EdmBindingTarget bindingTarget = null;
-
- final List<? extends NavigationPropertyBinding> navigationPropertyBindings = target.getNavigationPropertyBindings();
- boolean found = false;
- for (final Iterator<? extends NavigationPropertyBinding> itor = navigationPropertyBindings.iterator();
- itor.hasNext() && !found;) {
-
- final NavigationPropertyBinding binding = itor.next();
- if (binding.getPath().equals(path)) {
- final Target edmTarget = new Target.Builder(binding.getTarget(), container).build();
-
- final EdmEntityContainer entityContainer = edm.getEntityContainer(edmTarget.getEntityContainer());
- if (entityContainer == null) {
- throw new EdmException("Cannot find entity container with name: " + edmTarget.getEntityContainer());
- }
- bindingTarget = entityContainer.getEntitySet(edmTarget.getTargetName());
- if (bindingTarget == null) {
- bindingTarget = entityContainer.getSingleton(edmTarget.getTargetName());
- if (bindingTarget == null) {
- throw new EdmException("Cannot find target with name: " + edmTarget.getTargetName());
- }
-
- found = true;
- } else {
- found = true;
- }
- }
- }
-
- return bindingTarget;
- }
-
-}
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/edm/EdmClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmClientImpl.java
deleted file mode 100644
index 905a310..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmClientImpl.java
+++ /dev/null
@@ -1,370 +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.edm;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.apache.commons.lang3.StringUtils;
-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.edm.xml.CommonParameter;
-import org.apache.olingo.odata4.client.api.edm.xml.EnumType;
-import org.apache.olingo.odata4.client.api.edm.xml.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata;
-import org.apache.olingo.odata4.client.api.edm.xml.ComplexType;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityType;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.TypeDefinition;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.client.api.UnsupportedInV3Exception;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Action;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Function;
-import org.apache.olingo.odata4.client.core.edm.v3.EdmActionProxy;
-import org.apache.olingo.odata4.client.core.edm.v3.EdmFunctionProxy;
-import org.apache.olingo.odata4.client.core.edm.v3.V3FunctionImportUtils;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.EdmServiceMetadata;
-import org.apache.olingo.odata4.commons.api.edm.EdmTypeDefinition;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmImpl;
-
-public class EdmClientImpl extends AbstractEdmImpl {
-
- private final XMLMetadata xmlMetadata;
-
- private final EdmServiceMetadata serviceMetadata;
-
- public EdmClientImpl(final XMLMetadata xmlMetadata) {
- this.xmlMetadata = xmlMetadata;
- this.serviceMetadata = AbstractEdmServiceMetadataImpl.getInstance(xmlMetadata);
- }
-
- public XMLMetadata getXMLMetadata() {
- return xmlMetadata;
- }
-
- @Override
- protected EdmServiceMetadata createServiceMetadata() {
- return serviceMetadata;
- }
-
- @Override
- protected Map<String, String> createAliasToNamespaceInfo() {
- final Map<String, String> aliasToNamespace = new HashMap<String, String>();
-
- for (Schema schema : xmlMetadata.getSchemas()) {
- aliasToNamespace.put(null, schema.getNamespace());
- if (StringUtils.isNotBlank(schema.getAlias())) {
- aliasToNamespace.put(schema.getAlias(), schema.getNamespace());
- }
- }
-
- return aliasToNamespace;
- }
-
- @Override
- protected EdmEntityContainer createEntityContainer(final FullQualifiedName containerName) {
- EdmEntityContainer result = null;
-
- final Schema schema = xmlMetadata.getSchema(containerName.getNamespace());
- if (schema != null) {
- final EntityContainer xmlEntityContainer = schema.getDefaultEntityContainer();
- if (xmlEntityContainer != null) {
- result = new EdmEntityContainerImpl(this, containerName, xmlEntityContainer, xmlMetadata);
- }
- }
-
- return result;
- }
-
- @Override
- protected EdmEnumType createEnumType(final FullQualifiedName enumName) {
- EdmEnumType result = null;
-
- final Schema schema = xmlMetadata.getSchema(enumName.getNamespace());
- if (schema != null) {
- final EnumType xmlEnumType = schema.getEnumType(enumName.getName());
- if (xmlEnumType != null) {
- result = new EdmEnumTypeImpl(this, enumName, xmlEnumType);
- }
- }
-
- return result;
- }
-
- @Override
- protected EdmTypeDefinition createTypeDefinition(final FullQualifiedName typeDefinitionName) {
- EdmTypeDefinition result = null;
-
- final Schema schema = xmlMetadata.getSchema(typeDefinitionName.getNamespace());
- if (schema instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) {
- final TypeDefinition xmlTypeDefinition = ((org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) schema).
- getTypeDefinition(typeDefinitionName.getName());
- if (xmlTypeDefinition != null) {
- result = new EdmTypeDefinitionImpl(this, typeDefinitionName, xmlTypeDefinition);
- }
- } else {
- throw new UnsupportedInV3Exception();
- }
-
- return result;
- }
-
- @Override
- protected EdmEntityType createEntityType(final FullQualifiedName entityTypeName) {
- EdmEntityType result = null;
-
- final Schema schema = xmlMetadata.getSchema(entityTypeName.getNamespace());
- final EntityType xmlEntityType = schema.getEntityType(entityTypeName.getName());
- if (xmlEntityType != null) {
- result = EdmEntityTypeImpl.getInstance(this, entityTypeName, xmlEntityType);
- }
-
- return result;
- }
-
- @Override
- protected EdmComplexType createComplexType(final FullQualifiedName complexTypeName) {
- EdmComplexType result = null;
-
- final Schema schema = xmlMetadata.getSchema(complexTypeName.getNamespace());
- final ComplexType xmlComplexType = schema.getComplexType(complexTypeName.getName());
- if (xmlComplexType != null) {
- result = EdmComplexTypeImpl.getInstance(this, complexTypeName, xmlComplexType);
- }
-
- return result;
- }
-
- @Override
- protected EdmAction createUnboundAction(final FullQualifiedName actionName) {
- EdmAction result = null;
-
- final Schema schema = xmlMetadata.getSchema(actionName.getNamespace());
- if (schema instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) {
- final List<Action> actions = ((org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) schema).
- getActions(actionName.getName());
- boolean found = false;
- for (final Iterator<Action> itor = actions.iterator(); itor.hasNext() && !found;) {
- final Action action = itor.next();
- if (!action.isBound()) {
- found = true;
- result = EdmActionImpl.getInstance(this, actionName, action);
- }
- }
- } else {
- for (EntityContainer entityContainer : schema.getEntityContainers()) {
- @SuppressWarnings("unchecked")
- final List<FunctionImport> functionImports = (List<FunctionImport>) entityContainer.
- getFunctionImports(actionName.getName());
- boolean found = false;
- for (final Iterator<FunctionImport> itor = functionImports.iterator(); itor.hasNext() && !found;) {
- final FunctionImport functionImport = itor.next();
- if (!V3FunctionImportUtils.canProxyFunction(functionImport) && !functionImport.isBindable()) {
- found = functionImport.getParameters().isEmpty();
- result = EdmActionProxy.getInstance(this, actionName, functionImport);
- }
- }
- }
- }
-
- return result;
- }
-
- @Override
- protected EdmFunction createUnboundFunction(final FullQualifiedName functionName, final List<String> parameterNames) {
- EdmFunction result = null;
-
- final Schema schema = xmlMetadata.getSchema(functionName.getNamespace());
- if (schema instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) {
- final List<Function> functions = ((org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) schema).
- getFunctions(functionName.getName());
- boolean found = false;
- for (final Iterator<Function> itor = functions.iterator(); itor.hasNext() && !found;) {
- final Function function = itor.next();
- if (!function.isBound()) {
- final Set<String> functionParamNames = new HashSet<String>();
- for (CommonParameter param : function.getParameters()) {
- functionParamNames.add(param.getName());
- }
- found = parameterNames == null
- ? functionParamNames.isEmpty()
- : functionParamNames.containsAll(parameterNames);
- result = EdmFunctionImpl.getInstance(this, functionName, function);
- }
- }
- } else {
- for (EntityContainer entityContainer : schema.getEntityContainers()) {
- @SuppressWarnings("unchecked")
- final List<FunctionImport> functionImports = (List<FunctionImport>) entityContainer.
- getFunctionImports(functionName.getName());
- boolean found = false;
- for (final Iterator<FunctionImport> itor = functionImports.iterator(); itor.hasNext() && !found;) {
- final FunctionImport functionImport = itor.next();
- if (V3FunctionImportUtils.canProxyFunction(functionImport) && !functionImport.isBindable()) {
- final Set<String> functionParamNames = new HashSet<String>();
- for (CommonParameter param : functionImport.getParameters()) {
- functionParamNames.add(param.getName());
- }
- found = parameterNames == null
- ? functionParamNames.isEmpty()
- : functionParamNames.containsAll(parameterNames);
- result = EdmFunctionProxy.getInstance(this, functionName, functionImport);
- }
- }
- }
- }
-
- return result;
- }
-
- @Override
- protected EdmAction createBoundAction(final FullQualifiedName actionName,
- final FullQualifiedName bindingParameterTypeName, final Boolean isBindingParameterCollection) {
-
- EdmAction result = null;
-
- final Schema schema = xmlMetadata.getSchema(actionName.getNamespace());
- if (schema instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) {
- final List<Action> actions = ((org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) schema).
- getActions(actionName.getName());
- boolean found = false;
- for (final Iterator<Action> itor = actions.iterator(); itor.hasNext() && !found;) {
- final Action action = itor.next();
- if (action.isBound()) {
- final EdmTypeInfo boundParam = new EdmTypeInfo(action.getParameters().get(0).getType());
- if (bindingParameterTypeName.equals(boundParam.getFullQualifiedName())
- && isBindingParameterCollection.booleanValue() == boundParam.isCollection()) {
-
- found = true;
- result = EdmActionImpl.getInstance(this, actionName, action);
- }
- }
- }
- } else {
- for (EntityContainer entityContainer : schema.getEntityContainers()) {
- @SuppressWarnings("unchecked")
- final List<FunctionImport> functionImports = (List<FunctionImport>) entityContainer.
- getFunctionImports(actionName.getName());
- boolean found = false;
- for (final Iterator<FunctionImport> itor = functionImports.iterator(); itor.hasNext() && !found;) {
- final FunctionImport functionImport = itor.next();
- if (!V3FunctionImportUtils.canProxyFunction(functionImport) && functionImport.isBindable()) {
- final EdmTypeInfo boundParam = new EdmTypeInfo(functionImport.getParameters().get(0).getType());
- if (bindingParameterTypeName.equals(boundParam.getFullQualifiedName())
- && isBindingParameterCollection.booleanValue() == boundParam.isCollection()) {
-
- found = true;
- result = EdmActionProxy.getInstance(this, actionName, functionImport);
- }
- }
- }
- }
- }
-
- return result;
- }
-
- @Override
- protected EdmFunction createBoundFunction(final FullQualifiedName functionName,
- final FullQualifiedName bindingParameterTypeName, final Boolean isBindingParameterCollection,
- final List<String> parameterNames) {
-
- EdmFunction result = null;
-
- final Schema schema = xmlMetadata.getSchema(functionName.getNamespace());
- if (schema instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) {
- final List<Function> functions = ((org.apache.olingo.odata4.client.api.edm.xml.v4.Schema) schema).
- getFunctions(functionName.getName());
- boolean found = false;
- for (final Iterator<Function> itor = functions.iterator(); itor.hasNext() && !found;) {
- final Function function = itor.next();
- if (function.isBound()) {
- final EdmTypeInfo boundParam = new EdmTypeInfo(function.getParameters().get(0).getType());
- if (bindingParameterTypeName.equals(boundParam.getFullQualifiedName())
- && isBindingParameterCollection.booleanValue() == boundParam.isCollection()) {
-
- final Set<String> functionParamNames = new HashSet<String>();
- for (CommonParameter param : function.getParameters()) {
- functionParamNames.add(param.getName());
- }
- found = parameterNames == null
- ? functionParamNames.isEmpty()
- : functionParamNames.containsAll(parameterNames);
- result = EdmFunctionImpl.getInstance(this, functionName, function);
- }
- }
- }
- } else {
- for (EntityContainer entityContainer : schema.getEntityContainers()) {
- @SuppressWarnings("unchecked")
- final List<FunctionImport> functionImports = (List<FunctionImport>) entityContainer.
- getFunctionImports(functionName.getName());
- boolean found = false;
- for (final Iterator<FunctionImport> itor = functionImports.iterator(); itor.hasNext() && !found;) {
- final FunctionImport functionImport = itor.next();
- if (!V3FunctionImportUtils.canProxyFunction(functionImport) && functionImport.isBindable()) {
- final EdmTypeInfo boundParam = new EdmTypeInfo(functionImport.getParameters().get(0).getType());
- if (bindingParameterTypeName.equals(boundParam.getFullQualifiedName())
- && isBindingParameterCollection.booleanValue() == boundParam.isCollection()) {
-
- final Set<String> functionParamNames = new HashSet<String>();
- for (CommonParameter param : functionImport.getParameters()) {
- functionParamNames.add(param.getName());
- }
- found = parameterNames == null
- ? functionParamNames.isEmpty()
- : functionParamNames.containsAll(parameterNames);
- result = EdmFunctionProxy.getInstance(this, functionName, functionImport);
- }
- }
- }
- }
- }
-
- return result;
- }
-
- @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/edm/EdmComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmComplexTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmComplexTypeImpl.java
deleted file mode 100644
index b10bf79..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmComplexTypeImpl.java
+++ /dev/null
@@ -1,67 +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.edm;
-
-import java.util.Map;
-import org.apache.olingo.odata4.client.api.edm.xml.ComplexType;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmComplexType;
-import org.apache.olingo.odata4.commons.core.edm.EdmStructuredTypeHelper;
-
-public class EdmComplexTypeImpl extends AbstractEdmComplexType {
-
- private final EdmStructuredTypeHelper helper;
-
- public static EdmComplexTypeImpl getInstance(final Edm edm, final FullQualifiedName fqn,
- final ComplexType complexType) {
-
- FullQualifiedName baseTypeName = null;
- if (complexType instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.ComplexType) {
- final String baseType = ((org.apache.olingo.odata4.client.api.edm.xml.v4.ComplexType) complexType).getBaseType();
- baseTypeName = baseType == null
- ? null : new EdmTypeInfo(baseType).getFullQualifiedName();
- }
- final EdmComplexTypeImpl instance = new EdmComplexTypeImpl(edm, fqn, baseTypeName, complexType);
- instance.baseType = instance.buildBaseType(baseTypeName);
-
- return instance;
- }
-
- private EdmComplexTypeImpl(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName,
- final ComplexType complexType) {
-
- super(edm, fqn, baseTypeName);
- this.helper = new EdmStructuredTypeHelperImpl(edm, complexType);
- }
-
- @Override
- protected Map<String, EdmProperty> getProperties() {
- return helper.getProperties();
- }
-
- @Override
- protected Map<String, EdmNavigationProperty> getNavigationProperties() {
- return helper.getNavigationProperties();
- }
-
-}
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/edm/EdmEntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEntityContainerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEntityContainerImpl.java
deleted file mode 100644
index 9cde1b1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEntityContainerImpl.java
+++ /dev/null
@@ -1,125 +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.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ActionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.EntitySet;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonFunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Singleton;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.client.api.UnsupportedInV3Exception;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.core.edm.v3.EdmActionImportProxy;
-import org.apache.olingo.odata4.client.core.edm.v3.EdmEntitySetProxy;
-import org.apache.olingo.odata4.client.core.edm.v3.EdmFunctionImportProxy;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmSingleton;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmEntityContainer;
-
-public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
-
- private final EntityContainer xmlEntityContainer;
-
- private final XMLMetadata xmlMetadata;
-
- public EdmEntityContainerImpl(final Edm edm, final FullQualifiedName entityContainerName,
- final EntityContainer xmlEntityContainer, final XMLMetadata xmlMetadata) {
-
- super(edm, entityContainerName);
-
- this.xmlEntityContainer = xmlEntityContainer;
- this.xmlMetadata = xmlMetadata;
- }
-
- @Override
- protected EdmSingleton createSingleton(final String singletonName) {
- if (!(xmlEntityContainer instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.EntityContainer)) {
- throw new UnsupportedInV3Exception();
- }
-
- final Singleton singleton = ((org.apache.olingo.odata4.client.api.edm.xml.v4.EntityContainer) xmlEntityContainer).
- getSingleton(singletonName);
- if (singleton == null) {
- throw new EdmException("Singleton named '" + singletonName + "' not found in " + entityContainerName);
- }
- return new EdmSingletonImpl(edm, this, singletonName,
- new EdmTypeInfo(singleton.getEntityType(), entityContainerName.getNamespace()).getFullQualifiedName(),
- singleton);
- }
-
- @Override
- protected EdmEntitySet createEntitySet(final String entitySetName) {
- final EntitySet entitySet = xmlEntityContainer.getEntitySet(entitySetName);
- if (entitySet == null) {
- throw new EdmException("EntitySet named '" + entitySetName + "' not found in " + entityContainerName);
- }
-
- if (entitySet instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.EntitySet) {
- return new EdmEntitySetImpl(edm, this, entitySetName,
- new EdmTypeInfo(entitySet.getEntityType(), entityContainerName.getNamespace()).getFullQualifiedName(),
- (org.apache.olingo.odata4.client.api.edm.xml.v4.EntitySet) entitySet);
- } else {
- return new EdmEntitySetProxy(edm, this, entitySetName,
- new EdmTypeInfo(entitySet.getEntityType(), entityContainerName.getNamespace()).getFullQualifiedName(),
- xmlMetadata);
- }
- }
-
- @Override
- protected EdmActionImport createActionImport(final String actionImportName) {
- if (xmlEntityContainer instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.EntityContainer) {
- final ActionImport actionImport
- = ((org.apache.olingo.odata4.client.api.edm.xml.v4.EntityContainer) xmlEntityContainer).
- getActionImport(actionImportName);
- if (actionImport == null) {
- throw new EdmException("ActionImport named '" + actionImportName + "' not found in " + entityContainerName);
- }
- return new EdmActionImportImpl(edm, this, actionImportName, actionImport);
- } else {
- final FunctionImport functionImport = (FunctionImport) xmlEntityContainer.getFunctionImport(actionImportName);
- if (functionImport == null) {
- throw new EdmException("FunctionImport named '" + actionImportName + "' not found in " + entityContainerName);
- }
- return new EdmActionImportProxy(edm, this, actionImportName, functionImport);
- }
- }
-
- @Override
- protected EdmFunctionImport createFunctionImport(final String functionImportName) {
- final CommonFunctionImport functionImport = xmlEntityContainer.getFunctionImport(functionImportName);
- if (functionImport == null) {
- throw new EdmException("FunctionImport named '" + functionImportName + "' not found in " + entityContainerName);
- }
-
- if (functionImport instanceof org.apache.olingo.odata4.client.api.edm.xml.v4.FunctionImport) {
- return new EdmFunctionImportImpl(edm, this, functionImportName,
- (org.apache.olingo.odata4.client.api.edm.xml.v4.FunctionImport) functionImport);
- } else {
- return new EdmFunctionImportProxy(edm, this, functionImportName,
- (org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport) functionImport);
- }
- }
-}
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/edm/EdmEntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEntitySetImpl.java
deleted file mode 100644
index 669e431..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEntitySetImpl.java
+++ /dev/null
@@ -1,35 +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.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntitySet;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class EdmEntitySetImpl extends EdmBindingTargetImpl implements EdmEntitySet {
-
- public EdmEntitySetImpl(final Edm edm, final EdmEntityContainer container, final String name,
- final FullQualifiedName type, final EntitySet entitySet) {
-
- super(edm, container, name, type, entitySet);
- }
-
-}
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/edm/EdmEntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEntityTypeImpl.java
deleted file mode 100644
index f94807d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEntityTypeImpl.java
+++ /dev/null
@@ -1,79 +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.edm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import org.apache.olingo.odata4.client.api.edm.xml.PropertyRef;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityType;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmKeyPropertyRef;
-import org.apache.olingo.odata4.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmEntityType;
-import org.apache.olingo.odata4.commons.core.edm.EdmStructuredTypeHelper;
-
-public class EdmEntityTypeImpl extends AbstractEdmEntityType {
-
- private final EdmStructuredTypeHelper helper;
-
- public static EdmEntityTypeImpl getInstance(final Edm edm, final FullQualifiedName fqn, final EntityType entityType) {
- final FullQualifiedName baseTypeName = entityType.getBaseType() == null
- ? null : new EdmTypeInfo(entityType.getBaseType()).getFullQualifiedName();
- final EdmEntityTypeImpl instance = new EdmEntityTypeImpl(edm, fqn, baseTypeName, entityType);
- instance.baseType = instance.buildBaseType(baseTypeName);
-
- if (instance.baseType == null) {
- instance.entityBaseType = null;
-
- final List<EdmKeyPropertyRef> edmKey = new ArrayList<EdmKeyPropertyRef>(
- entityType.getKey().getPropertyRefs().size());
- for (PropertyRef ref : entityType.getKey().getPropertyRefs()) {
- edmKey.add(new EdmKeyPropertyRefImpl(instance, ref));
- }
- instance.setEdmKeyPropertyRef(edmKey);
- } else {
- instance.entityBaseType = (EdmEntityType) instance.baseType;
- }
-
- return instance;
- }
-
- private EdmEntityTypeImpl(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName,
- final EntityType entityType) {
-
- super(edm, fqn, baseTypeName, entityType.isHasStream());
- this.helper = new EdmStructuredTypeHelperImpl(edm, entityType);
- }
-
- @Override
- protected Map<String, EdmProperty> getProperties() {
- return helper.getProperties();
- }
-
- @Override
- protected Map<String, EdmNavigationProperty> getNavigationProperties() {
- return helper.getNavigationProperties();
- }
-
-}
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/edm/EdmEnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEnumTypeImpl.java
deleted file mode 100644
index 6d090ab..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmEnumTypeImpl.java
+++ /dev/null
@@ -1,83 +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.edm;
-
-import org.apache.olingo.odata4.commons.core.edm.EdmMemberImpl;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.olingo.odata4.client.api.edm.xml.EnumType;
-import org.apache.olingo.odata4.client.api.edm.xml.Member;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-import org.apache.olingo.odata4.commons.api.edm.EdmMember;
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmEnumType;
-import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
-
-public class EdmEnumTypeImpl extends AbstractEdmEnumType implements EdmEnumType {
-
- private final EdmPrimitiveType underlyingType;
-
- private final List<String> memberNames;
-
- private final Map<String, EdmMember> members;
-
- public EdmEnumTypeImpl(final Edm edm, final FullQualifiedName fqn, final EnumType xmlEnumType) {
- super(edm, fqn, xmlEnumType.isFlags());
-
- if (xmlEnumType.getUnderlyingType() == null) {
- this.underlyingType = EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance();
- } else {
- this.underlyingType = EdmPrimitiveTypeKind.fromString(
- xmlEnumType.getUnderlyingType()).getEdmPrimitiveTypeInstance();
- // TODO: Should we validate that the underlying type is of byte, sbyte, in16, int32 or int64?
- }
-
- final List<? extends Member> xmlMembers = xmlEnumType.getMembers();
- final List<String> _memberNames = new ArrayList<String>();
- final Map<String, EdmMember> _members = new LinkedHashMap<String, EdmMember>(xmlMembers.size());
- for (Member xmlMember : xmlMembers) {
- _memberNames.add(xmlMember.getName());
- _members.put(xmlMember.getName(), new EdmMemberImpl(edm, xmlMember.getName(), xmlMember.getValue()));
- }
- this.memberNames = Collections.unmodifiableList(_memberNames);
- this.members = Collections.unmodifiableMap(_members);
- }
-
- @Override
- public EdmPrimitiveType getUnderlyingType() {
- return underlyingType;
- }
-
- @Override
- public List<String> getMemberNames() {
- return memberNames;
- }
-
- @Override
- protected Collection<? extends EdmMember> getMembers() {
- return members.values();
- }
-
-}
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/edm/EdmFunctionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmFunctionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmFunctionImpl.java
deleted file mode 100644
index aa83cb3..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmFunctionImpl.java
+++ /dev/null
@@ -1,44 +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.edm;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Function;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-
-public class EdmFunctionImpl extends EdmOperationImpl implements EdmFunction {
-
- private final Function function;
-
- public static EdmFunctionImpl getInstance(final Edm edm, final FullQualifiedName name, final Function function) {
- return EdmOperationImpl.getInstance(new EdmFunctionImpl(edm, name, function));
- }
-
- private EdmFunctionImpl(final Edm edm, final FullQualifiedName name, final Function function) {
- super(edm, name, function, EdmTypeKind.FUNCTION);
- this.function = function;
- }
-
- @Override
- public boolean isComposable() {
- return function.isComposable();
- }
-}
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/edm/EdmFunctionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmFunctionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmFunctionImportImpl.java
deleted file mode 100644
index 8a7ef6d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/EdmFunctionImportImpl.java
+++ /dev/null
@@ -1,47 +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.edm;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.FunctionImport;
-import org.apache.olingo.odata4.client.api.utils.EdmTypeInfo;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImport;
-
-public class EdmFunctionImportImpl extends EdmOperationImportImpl implements EdmFunctionImport {
-
- private final FunctionImport functionImport;
-
- public EdmFunctionImportImpl(final Edm edm, final EdmEntityContainer container, final String name,
- final FunctionImport functionImport) {
-
- super(edm, container, name, functionImport.getEntitySet());
- this.functionImport = functionImport;
- }
-
- @Override
- public EdmFunction getFunction(final List<String> parameterNames) {
- return edm.getFunction(
- new EdmTypeInfo(functionImport.getFunction(), container.getNamespace()).getFullQualifiedName(),
- null, null, parameterNames);
- }
-
-}
[09/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/EdmImplCachingTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/EdmImplCachingTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/EdmImplCachingTest.java
deleted file mode 100644
index 2888c16..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/EdmImplCachingTest.java
+++ /dev/null
@@ -1,388 +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.commons.core.edm;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.EdmServiceMetadata;
-import org.apache.olingo.odata4.commons.api.edm.EdmTypeDefinition;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.junit.Before;
-import org.junit.Test;
-
-public class EdmImplCachingTest {
-
- private final FullQualifiedName NAME1 = new FullQualifiedName("testNamespace1", "testName1");
-
- private final FullQualifiedName NAME2 = new FullQualifiedName("testNamespace2", "testName2");
-
- private Edm edm;
-
- @Test
- public void cacheEntityContainer() {
- EdmEntityContainer entityContainer = edm.getEntityContainer(null);
- assertNotNull(entityContainer);
-
- EdmEntityContainer cachedContainer = edm.getEntityContainer(NAME1);
- assertNotNull(entityContainer);
-
- assertTrue(entityContainer == cachedContainer);
- assertEquals(entityContainer, cachedContainer);
-
- cachedContainer = edm.getEntityContainer(NAME1);
- assertNotNull(cachedContainer);
-
- assertTrue(entityContainer == cachedContainer);
- assertEquals(entityContainer, cachedContainer);
-
- EdmEntityContainer entityContainer2 = edm.getEntityContainer(NAME2);
- assertNotNull(entityContainer2);
-
- assertNotSame(entityContainer, entityContainer2);
- }
-
- @Test
- public void cacheEnumType() {
- EdmEnumType enumType = edm.getEnumType(NAME1);
- assertNotNull(enumType);
-
- EdmEnumType cachedType = edm.getEnumType(NAME1);
- assertNotNull(cachedType);
-
- assertTrue(enumType == cachedType);
- assertEquals(enumType, cachedType);
-
- EdmEnumType enumType2 = edm.getEnumType(NAME2);
- assertNotNull(enumType2);
-
- assertNotSame(enumType, enumType2);
- }
-
- @Test
- public void cacheTypeDefinition() {
- EdmTypeDefinition typeDefinition = edm.getTypeDefinition(NAME1);
- assertNotNull(typeDefinition);
-
- EdmTypeDefinition cachedDefinition = edm.getTypeDefinition(NAME1);
- assertNotNull(cachedDefinition);
-
- assertTrue(typeDefinition == cachedDefinition);
- assertEquals(typeDefinition, cachedDefinition);
-
- EdmTypeDefinition typeDefinition2 = edm.getTypeDefinition(NAME2);
- assertNotNull(typeDefinition2);
-
- assertNotSame(typeDefinition, typeDefinition2);
- }
-
- @Test
- public void cacheEntityType() {
- EdmEntityType entityType = edm.getEntityType(NAME1);
- assertNotNull(entityType);
-
- EdmEntityType cachedType = edm.getEntityType(NAME1);
- assertNotNull(cachedType);
-
- assertTrue(entityType == cachedType);
- assertEquals(entityType, cachedType);
-
- EdmEntityType entityType2 = edm.getEntityType(NAME2);
- assertNotNull(entityType2);
-
- assertNotSame(entityType, entityType2);
- }
-
- @Test
- public void cacheComplexType() {
- EdmComplexType complexType = edm.getComplexType(NAME1);
- assertNotNull(complexType);
-
- EdmComplexType cachedType = edm.getComplexType(NAME1);
- assertNotNull(cachedType);
-
- assertTrue(complexType == cachedType);
- assertEquals(complexType, cachedType);
-
- EdmComplexType complexType2 = edm.getComplexType(NAME2);
- assertNotNull(complexType2);
-
- assertNotSame(complexType, complexType2);
- }
-
- @Test
- public void cacheUnboundAction() {
- EdmAction action = edm.getAction(NAME1, null, null);
- assertNotNull(action);
-
- EdmAction cachedAction = edm.getAction(NAME1, null, null);
- assertNotNull(cachedAction);
-
- assertTrue(action == cachedAction);
- assertEquals(action, cachedAction);
-
- EdmAction action2 = edm.getAction(NAME2, null, false);
- assertNotNull(action2);
- assertNotSame(action, action2);
- }
-
- @Test
- public void cacheBoundAction() {
- EdmAction action = edm.getAction(NAME1, NAME2, true);
- assertNotNull(action);
-
- EdmAction cachedAction = edm.getAction(NAME1, NAME2, true);
- assertNotNull(cachedAction);
-
- assertTrue(action == cachedAction);
- assertEquals(action, cachedAction);
-
- EdmAction action2 = edm.getAction(NAME2, NAME2, true);
- assertNotNull(action2);
- assertNotSame(action, action2);
-
- }
-
- @Test
- public void cacheUnboundFunctionNoParameters() {
- EdmFunction function = edm.getFunction(NAME1, null, null, null);
- assertNotNull(function);
-
- EdmFunction cachedfunction = edm.getFunction(NAME1, null, null, null);
- assertNotNull(cachedfunction);
-
- assertTrue(function == cachedfunction);
- assertEquals(function, cachedfunction);
-
- EdmFunction function2 = edm.getFunction(NAME2, null, false, null);
- assertNotNull(function2);
-
- assertNotSame(function, function2);
- }
-
- @Test
- public void cacheBoundFunction() {
- EdmFunction function = edm.getFunction(NAME1, NAME2, true, new ArrayList<String>());
- assertNotNull(function);
-
- EdmFunction cachedfunction = edm.getFunction(NAME1, NAME2, true, new ArrayList<String>());
- assertNotNull(cachedfunction);
-
- assertTrue(function == cachedfunction);
- assertEquals(function, cachedfunction);
-
- EdmFunction function2 = edm.getFunction(NAME2, NAME2, true, new ArrayList<String>());
- assertNotNull(function2);
-
- assertNotSame(function, function2);
- }
-
- @Test
- public void cacheUnboundFunctionWithParameters() {
- ArrayList<String> parameters1 = new ArrayList<String>();
- parameters1.add("A");
- parameters1.add("B");
- EdmFunction function = edm.getFunction(NAME1, NAME2, true, parameters1);
- assertNotNull(function);
-
- ArrayList<String> parameters2 = new ArrayList<String>();
- parameters2.add("B");
- parameters2.add("A");
- EdmFunction cachedfunction = edm.getFunction(NAME1, NAME2, true, parameters2);
- assertNotNull(cachedfunction);
-
- assertTrue(function == cachedfunction);
- assertEquals(function, cachedfunction);
-
- EdmFunction function2 = edm.getFunction(NAME2, NAME2, true, new ArrayList<String>());
- assertNotNull(function2);
-
- assertNotSame(function, function2);
- }
-
- @Test
- public void cacheServiceMetadata() {
- EdmServiceMetadata serviceMetadata = edm.getServiceMetadata();
- EdmServiceMetadata cachedMetadata = edm.getServiceMetadata();
-
- assertTrue(serviceMetadata == cachedMetadata);
- assertEquals(serviceMetadata, cachedMetadata);
- }
-
- @Before
- public void setup() {
- edm = new LocalEdm();
- }
-
- private class LocalEdm extends AbstractEdmImpl {
-
- @Override
- public EdmEntityContainer createEntityContainer(final FullQualifiedName fqn) {
- if (NAME1.equals(fqn) || fqn == null) {
- EdmEntityContainer container = mock(EdmEntityContainer.class);
- when(container.getNamespace()).thenReturn(NAME1.getNamespace());
- when(container.getName()).thenReturn(NAME1.getName());
- return container;
- } else if (NAME2.equals(fqn)) {
- EdmEntityContainer container = mock(EdmEntityContainer.class);
- when(container.getNamespace()).thenReturn(fqn.getNamespace());
- when(container.getName()).thenReturn(fqn.getName());
- return container;
- }
- return null;
- }
-
- @Override
- public EdmEnumType createEnumType(final FullQualifiedName fqn) {
- if (NAME1.equals(fqn) || NAME2.equals(fqn)) {
- EdmEnumType enumType = mock(EdmEnumType.class);
- when(enumType.getNamespace()).thenReturn(fqn.getNamespace());
- when(enumType.getName()).thenReturn(fqn.getName());
- return enumType;
- }
- return null;
- }
-
- @Override
- public EdmTypeDefinition createTypeDefinition(final FullQualifiedName fqn) {
- if (NAME1.equals(fqn) || NAME2.equals(fqn)) {
- EdmTypeDefinition typeDefinition = mock(EdmTypeDefinition.class);
- when(typeDefinition.getNamespace()).thenReturn(fqn.getNamespace());
- when(typeDefinition.getName()).thenReturn(fqn.getName());
- return typeDefinition;
- }
- return null;
- }
-
- @Override
- public EdmEntityType createEntityType(final FullQualifiedName fqn) {
- if (NAME1.equals(fqn) || NAME2.equals(fqn)) {
- EdmEntityType entityType = mock(EdmEntityType.class);
- when(entityType.getNamespace()).thenReturn(fqn.getNamespace());
- when(entityType.getName()).thenReturn(fqn.getName());
- return entityType;
- }
- return null;
- }
-
- @Override
- public EdmComplexType createComplexType(final FullQualifiedName fqn) {
- if (NAME1.equals(fqn) || NAME2.equals(fqn)) {
- EdmComplexType complexType = mock(EdmComplexType.class);
- when(complexType.getNamespace()).thenReturn(fqn.getNamespace());
- when(complexType.getName()).thenReturn(fqn.getName());
- return complexType;
- }
- return null;
- }
-
- @Override
- public EdmAction createBoundAction(final FullQualifiedName fqn, final FullQualifiedName bindingParameterTypeName,
- final Boolean isBindingParameterCollection) {
- if (NAME1.equals(fqn)) {
- EdmAction action = mock(EdmAction.class);
- when(action.getNamespace()).thenReturn(fqn.getNamespace());
- when(action.getName()).thenReturn(fqn.getName());
- return action;
- } else if (NAME2.equals(fqn)) {
- EdmAction action = mock(EdmAction.class);
- when(action.getNamespace()).thenReturn(fqn.getNamespace());
- when(action.getName()).thenReturn(fqn.getName());
- return action;
- }
- return null;
- }
-
- @Override
- public EdmFunction createBoundFunction(final FullQualifiedName fqn,
- final FullQualifiedName bindingParameterTypeName,
- final Boolean isBindingParameterCollection, final List<String> bindingParameterNames) {
- if (NAME1.equals(fqn)) {
- EdmFunction function = mock(EdmFunction.class);
- when(function.getNamespace()).thenReturn(fqn.getNamespace());
- when(function.getName()).thenReturn(fqn.getName());
- return function;
- } else if (NAME2.equals(fqn)) {
- EdmFunction function = mock(EdmFunction.class);
- when(function.getNamespace()).thenReturn(fqn.getNamespace());
- when(function.getName()).thenReturn(fqn.getName());
- return function;
- }
- return null;
- }
-
- @Override
- public EdmServiceMetadata createServiceMetadata() {
- return mock(EdmServiceMetadata.class);
- }
-
- @Override
- protected Map<String, String> createAliasToNamespaceInfo() {
- return new HashMap<String, String>();
- }
-
- @Override
- protected EdmAction createUnboundAction(final FullQualifiedName fqn) {
- if (NAME1.equals(fqn)) {
- EdmAction action = mock(EdmAction.class);
- when(action.getNamespace()).thenReturn(fqn.getNamespace());
- when(action.getName()).thenReturn(fqn.getName());
- return action;
- } else if (NAME2.equals(fqn)) {
- EdmAction action = mock(EdmAction.class);
- when(action.getNamespace()).thenReturn(fqn.getNamespace());
- when(action.getName()).thenReturn(fqn.getName());
- return action;
- }
- return null;
- }
-
- @Override
- protected EdmFunction createUnboundFunction(final FullQualifiedName fqn, final List<String> parameterNames) {
- if (NAME1.equals(fqn)) {
- EdmFunction function = mock(EdmFunction.class);
- when(function.getNamespace()).thenReturn(fqn.getNamespace());
- when(function.getName()).thenReturn(fqn.getName());
- return function;
- } else if (NAME2.equals(fqn)) {
- EdmFunction function = mock(EdmFunction.class);
- when(function.getNamespace()).thenReturn(fqn.getNamespace());
- when(function.getName()).thenReturn(fqn.getName());
- return function;
- }
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/EdmImplCallCreateTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/EdmImplCallCreateTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/EdmImplCallCreateTest.java
deleted file mode 100644
index f4f30f3..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/EdmImplCallCreateTest.java
+++ /dev/null
@@ -1,267 +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.commons.core.edm;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.EdmServiceMetadata;
-import org.apache.olingo.odata4.commons.api.edm.EdmTypeDefinition;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.junit.Before;
-import org.junit.Test;
-
-public class EdmImplCallCreateTest {
-
- private final FullQualifiedName FQN = new FullQualifiedName("testNamespace", "testName");
-
- private final FullQualifiedName WRONG_FQN = new FullQualifiedName("wrong", "wrong");
-
- private Edm edm;
-
- @Test
- public void callCreateEntityContainer() {
- EdmEntityContainer entityContainer = edm.getEntityContainer(FQN);
- assertNotNull(entityContainer);
- assertEquals(FQN.getNamespace(), entityContainer.getNamespace());
- assertEquals(FQN.getName(), entityContainer.getName());
-
- entityContainer = edm.getEntityContainer(null);
- assertNotNull(entityContainer);
- assertEquals(FQN.getNamespace(), entityContainer.getNamespace());
- assertEquals(FQN.getName(), entityContainer.getName());
-
- assertNull(edm.getEntityContainer(WRONG_FQN));
- }
-
- @Test
- public void callCreateEnumType() {
- EdmEnumType enumType = edm.getEnumType(FQN);
- assertNotNull(enumType);
- assertEquals(FQN.getNamespace(), enumType.getNamespace());
- assertEquals(FQN.getName(), enumType.getName());
-
- assertNull(edm.getEnumType(WRONG_FQN));
- }
-
- @Test
- public void callCreateTypeDefinition() {
- EdmTypeDefinition typeDefinition = edm.getTypeDefinition(FQN);
- assertNotNull(typeDefinition);
- assertEquals(FQN.getNamespace(), typeDefinition.getNamespace());
- assertEquals(FQN.getName(), typeDefinition.getName());
-
- assertNull(edm.getTypeDefinition(WRONG_FQN));
- }
-
- @Test
- public void callCreateEntityType() {
- EdmEntityType entityType = edm.getEntityType(FQN);
- assertNotNull(entityType);
- assertEquals(FQN.getNamespace(), entityType.getNamespace());
- assertEquals(FQN.getName(), entityType.getName());
-
- assertNull(edm.getEntityType(WRONG_FQN));
- }
-
- @Test
- public void callCreateComplexType() {
- EdmComplexType complexType = edm.getComplexType(FQN);
- assertNotNull(complexType);
- assertEquals(FQN.getNamespace(), complexType.getNamespace());
- assertEquals(FQN.getName(), complexType.getName());
-
- assertNull(edm.getComplexType(WRONG_FQN));
- }
-
- @Test
- public void callCreateAction() {
- EdmAction action = edm.getAction(FQN, null, null);
- assertNotNull(action);
- assertEquals(FQN.getNamespace(), action.getNamespace());
- assertEquals(FQN.getName(), action.getName());
-
- EdmAction action2 = edm.getAction(FQN, FQN, true);
- assertNotNull(action2);
- assertEquals(FQN.getNamespace(), action2.getNamespace());
- assertEquals(FQN.getName(), action2.getName());
-
- assertNotSame(action, action2);
-
- assertNull(edm.getAction(WRONG_FQN, null, null));
- }
-
- @Test
- public void callCreateFunction() {
- EdmFunction function = edm.getFunction(FQN, null, null, null);
- assertNotNull(function);
- assertEquals(FQN.getNamespace(), function.getNamespace());
- assertEquals(FQN.getName(), function.getName());
-
- EdmFunction function2 = edm.getFunction(FQN, FQN, true, new ArrayList<String>());
- assertNotNull(function2);
- assertEquals(FQN.getNamespace(), function2.getNamespace());
- assertEquals(FQN.getName(), function2.getName());
-
- assertNotSame(function, function2);
-
- assertNull(edm.getFunction(WRONG_FQN, null, null, null));
- }
-
- @Test
- public void callCreateServiceMetadata() {
- assertNotNull(edm.getServiceMetadata());
- }
-
- @Before
- public void setup() {
- edm = new LocalEdm();
- }
-
- private class LocalEdm extends AbstractEdmImpl {
-
- @Override
- public EdmEntityContainer createEntityContainer(final FullQualifiedName fqn) {
- if (fqn == null || FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
- EdmEntityContainer container = mock(EdmEntityContainer.class);
- when(container.getNamespace()).thenReturn(FQN.getNamespace());
- when(container.getName()).thenReturn(FQN.getName());
- return container;
- }
- return null;
- }
-
- @Override
- public EdmEnumType createEnumType(final FullQualifiedName fqn) {
- if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
- EdmEnumType enumType = mock(EdmEnumType.class);
- when(enumType.getNamespace()).thenReturn(fqn.getNamespace());
- when(enumType.getName()).thenReturn(fqn.getName());
- return enumType;
- }
- return null;
- }
-
- @Override
- public EdmTypeDefinition createTypeDefinition(final FullQualifiedName fqn) {
- if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
- EdmTypeDefinition typeDefinition = mock(EdmTypeDefinition.class);
- when(typeDefinition.getNamespace()).thenReturn(fqn.getNamespace());
- when(typeDefinition.getName()).thenReturn(fqn.getName());
- return typeDefinition;
- }
- return null;
- }
-
- @Override
- public EdmEntityType createEntityType(final FullQualifiedName fqn) {
- if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
- EdmEntityType entityType = mock(EdmEntityType.class);
- when(entityType.getNamespace()).thenReturn(fqn.getNamespace());
- when(entityType.getName()).thenReturn(fqn.getName());
- return entityType;
- }
- return null;
- }
-
- @Override
- public EdmComplexType createComplexType(final FullQualifiedName fqn) {
- if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
- EdmComplexType complexType = mock(EdmComplexType.class);
- when(complexType.getNamespace()).thenReturn(fqn.getNamespace());
- when(complexType.getName()).thenReturn(fqn.getName());
- return complexType;
- }
- return null;
- }
-
- @Override
- public EdmAction createBoundAction(final FullQualifiedName fqn, final FullQualifiedName bindingParameterTypeName,
- final Boolean isBindingParameterCollection) {
- if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
- EdmAction action = mock(EdmAction.class);
- when(action.getNamespace()).thenReturn(fqn.getNamespace());
- when(action.getName()).thenReturn(fqn.getName());
- return action;
- }
- return null;
- }
-
- @Override
- public EdmFunction createBoundFunction(final FullQualifiedName fqn,
- final FullQualifiedName bindingParameterTypeName,
- final Boolean isBindingParameterCollection, final List<String> bindingParameterNames) {
- if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
- EdmFunction function = mock(EdmFunction.class);
- when(function.getNamespace()).thenReturn(fqn.getNamespace());
- when(function.getName()).thenReturn(fqn.getName());
- return function;
- }
- return null;
- }
-
- @Override
- public EdmServiceMetadata createServiceMetadata() {
- return mock(EdmServiceMetadata.class);
- }
-
- @Override
- protected Map<String, String> createAliasToNamespaceInfo() {
- return new HashMap<String, String>();
- }
-
- @Override
- protected EdmAction createUnboundAction(final FullQualifiedName fqn) {
- if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
- EdmAction action = mock(EdmAction.class);
- when(action.getNamespace()).thenReturn(fqn.getNamespace());
- when(action.getName()).thenReturn(fqn.getName());
- return action;
- }
- return null;
- }
-
- @Override
- protected EdmFunction createUnboundFunction(final FullQualifiedName fqn, final List<String> parameterNames) {
- if (FQN.getNamespace().equals(fqn.getNamespace()) && FQN.getName().equals(fqn.getName())) {
- EdmFunction function = mock(EdmFunction.class);
- when(function.getNamespace()).thenReturn(fqn.getNamespace());
- when(function.getName()).thenReturn(fqn.getName());
- return function;
- }
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/FunctionMapKeyTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/FunctionMapKeyTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/FunctionMapKeyTest.java
deleted file mode 100644
index 640be39..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/FunctionMapKeyTest.java
+++ /dev/null
@@ -1,251 +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.commons.core.edm;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotSame;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.junit.Test;
-
-public class FunctionMapKeyTest {
-
- private final FullQualifiedName fqn = new FullQualifiedName("namespace", "name");
-
- private final FullQualifiedName fqnType = new FullQualifiedName("namespace2", "name2");
-
- @Test
- public void testEqualsPositive() {
- FunctionMapKey key = new FunctionMapKey(fqn, null, null, null);
- FunctionMapKey someKey = new FunctionMapKey(fqn, null, null, null);
- assertEquals(key, someKey);
-
- key = new FunctionMapKey(fqn, null, true, null);
- someKey = new FunctionMapKey(fqn, null, true, null);
- assertEquals(key, someKey);
-
- key = new FunctionMapKey(fqn, fqnType, true, null);
- someKey = new FunctionMapKey(fqn, fqnType, true, null);
- assertEquals(key, someKey);
-
- key = new FunctionMapKey(fqn, fqnType, false, null);
- someKey = new FunctionMapKey(fqn, fqnType, false, null);
- assertEquals(key, someKey);
-
- key = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
- someKey = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
- assertEquals(key, someKey);
-
- List<String> keyList = new ArrayList<String>();
- keyList.add("Employee");
- List<String> someKeyList = new ArrayList<String>();
- someKeyList.add("Employee");
- key = new FunctionMapKey(fqn, fqnType, false, keyList);
- someKey = new FunctionMapKey(fqn, fqnType, false, someKeyList);
- assertEquals(key, someKey);
-
- key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- someKey = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- assertEquals(key, someKey);
-
- keyList = new ArrayList<String>();
- keyList.add("Employee");
- someKeyList = new ArrayList<String>();
- someKeyList.add("Employee");
- key = new FunctionMapKey(fqn, null, null, keyList);
- someKey = new FunctionMapKey(fqn, null, null, someKeyList);
- assertEquals(key, someKey);
- }
-
- @Test
- public void testEqualsNegative() {
- FunctionMapKey key = new FunctionMapKey(fqn, null, null, null);
- FunctionMapKey someKey = new FunctionMapKey(fqn, null, true, null);
- assertNotSame(key, someKey);
-
- key = new FunctionMapKey(fqn, null, true, null);
- someKey = new FunctionMapKey(fqn, null, false, null);
- assertNotSame(key, someKey);
-
- key = new FunctionMapKey(fqn, fqnType, true, null);
- someKey = new FunctionMapKey(fqn, null, true, null);
- assertNotSame(key, someKey);
-
- key = new FunctionMapKey(fqn, null, false, null);
- someKey = new FunctionMapKey(fqn, fqnType, true, null);
- assertNotSame(key, someKey);
-
- key = new FunctionMapKey(fqn, fqnType, false, null);
- someKey = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
- assertNotSame(key, someKey);
-
- List<String> keyList = new ArrayList<String>();
- keyList.add("Employee");
- List<String> someKeyList = new ArrayList<String>();
- someKeyList.add("Employee2");
- key = new FunctionMapKey(fqn, fqnType, false, keyList);
- someKey = new FunctionMapKey(fqn, fqnType, false, someKeyList);
- assertNotSame(key, someKey);
-
- key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- someKey = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- assertNotSame(key, someKey);
-
- keyList = new ArrayList<String>();
- keyList.add("Employee");
- someKeyList = new ArrayList<String>();
- someKeyList.add("Employee2");
- key = new FunctionMapKey(fqn, null, null, keyList);
- someKey = new FunctionMapKey(fqn, null, null, someKeyList);
- assertNotSame(key, someKey);
-
- key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- someKey = new FunctionMapKey(fqn, null, null, null);
- assertNotSame(key, someKey);
-
- keyList = new ArrayList<String>();
- keyList.add("Employee");
- someKeyList = new ArrayList<String>();
- key = new FunctionMapKey(fqn, null, null, keyList);
- someKey = new FunctionMapKey(fqn, null, null, someKeyList);
- assertNotSame(key, someKey);
-
- keyList = new ArrayList<String>();
- keyList.add("Employee");
- someKeyList = new ArrayList<String>();
- someKeyList.add("EmpLoYeE");
- key = new FunctionMapKey(fqn, null, null, keyList);
- someKey = new FunctionMapKey(fqn, null, null, someKeyList);
- assertNotSame(key, someKey);
- }
-
- @Test
- public void testHashCodePositive() {
- FunctionMapKey key = new FunctionMapKey(fqn, null, null, null);
- FunctionMapKey someKey = new FunctionMapKey(fqn, null, null, null);
- assertEquals(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, null, true, null);
- someKey = new FunctionMapKey(fqn, null, true, null);
- assertEquals(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, fqnType, true, null);
- someKey = new FunctionMapKey(fqn, fqnType, true, null);
- assertEquals(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, fqnType, false, null);
- someKey = new FunctionMapKey(fqn, fqnType, false, null);
- assertEquals(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
- someKey = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
- assertEquals(key.hashCode(), someKey.hashCode());
-
- List<String> keyList = new ArrayList<String>();
- keyList.add("Employee");
- List<String> someKeyList = new ArrayList<String>();
- someKeyList.add("Employee");
- key = new FunctionMapKey(fqn, fqnType, false, keyList);
- someKey = new FunctionMapKey(fqn, fqnType, false, someKeyList);
- assertEquals(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- someKey = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- assertEquals(key.hashCode(), someKey.hashCode());
-
- keyList = new ArrayList<String>();
- keyList.add("Employee");
- someKeyList = new ArrayList<String>();
- someKeyList.add("Employee");
- key = new FunctionMapKey(fqn, null, null, keyList);
- someKey = new FunctionMapKey(fqn, null, null, someKeyList);
- assertEquals(key.hashCode(), someKey.hashCode());
-
- keyList = new ArrayList<String>();
- keyList.add("Employee");
- keyList.add("employee");
- someKeyList = new ArrayList<String>();
- someKeyList.add("Employee");
- someKeyList.add("employee");
- key = new FunctionMapKey(fqn, null, null, keyList);
- someKey = new FunctionMapKey(fqn, null, null, someKeyList);
- assertEquals(key.hashCode(), someKey.hashCode());
-
- keyList = new ArrayList<String>();
- keyList.add("Employee");
- keyList.add("Employee2");
- someKeyList = new ArrayList<String>();
- someKeyList.add("Employee2");
- someKeyList.add("Employee");
- key = new FunctionMapKey(fqn, null, null, keyList);
- someKey = new FunctionMapKey(fqn, null, null, someKeyList);
- assertEquals(key.hashCode(), someKey.hashCode());
- }
-
- @Test
- public void testHashCodeNegative() {
- FunctionMapKey key = new FunctionMapKey(fqn, null, null, null);
- FunctionMapKey someKey = new FunctionMapKey(fqn, null, true, null);
- assertNotSame(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, null, true, null);
- someKey = new FunctionMapKey(fqn, null, false, null);
- assertNotSame(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, fqnType, true, null);
- someKey = new FunctionMapKey(fqn, null, true, null);
- assertNotSame(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, null, false, null);
- someKey = new FunctionMapKey(fqn, fqnType, true, null);
- assertNotSame(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, fqnType, false, null);
- someKey = new FunctionMapKey(fqn, fqnType, false, new ArrayList<String>());
- assertNotSame(key.hashCode(), someKey.hashCode());
-
- List<String> keyList = new ArrayList<String>();
- keyList.add("Employee");
- List<String> someKeyList = new ArrayList<String>();
- someKeyList.add("Employee2");
- key = new FunctionMapKey(fqn, fqnType, false, keyList);
- someKey = new FunctionMapKey(fqn, fqnType, false, someKeyList);
- assertNotSame(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- someKey = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- assertNotSame(key.hashCode(), someKey.hashCode());
-
- keyList = new ArrayList<String>();
- keyList.add("Employee");
- someKeyList = new ArrayList<String>();
- someKeyList.add("Employee2");
- key = new FunctionMapKey(fqn, null, null, keyList);
- someKey = new FunctionMapKey(fqn, null, null, someKeyList);
- assertNotSame(key.hashCode(), someKey.hashCode());
-
- key = new FunctionMapKey(fqn, null, null, new ArrayList<String>());
- someKey = new FunctionMapKey(fqn, null, null, null);
- assertNotSame(key.hashCode(), someKey.hashCode());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/CommonPrimitiveTypeTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/CommonPrimitiveTypeTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/CommonPrimitiveTypeTest.java
deleted file mode 100644
index 95e11c1..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/CommonPrimitiveTypeTest.java
+++ /dev/null
@@ -1,172 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.math.BigDecimal;
-import java.util.Calendar;
-import java.util.UUID;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-import org.junit.Test;
-
-public class CommonPrimitiveTypeTest extends PrimitiveTypeBaseTest {
-
- @Test
- public void nameSpace() throws Exception {
- assertEquals(EdmPrimitiveType.SYSTEM_NAMESPACE, Uint7.getInstance().getNamespace());
-
- assertEquals(EdmPrimitiveType.EDM_NAMESPACE, EdmNull.getInstance().getNamespace());
- for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
- final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
- assertEquals(EdmPrimitiveType.EDM_NAMESPACE, instance.getNamespace());
- }
- }
-
- @Test
- public void names() throws Exception {
- assertEquals("Uint7", Uint7.getInstance().getName());
-
- assertEquals("Null", EdmNull.getInstance().getName());
- assertEquals("Binary", EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Boolean", EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Byte", EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Date", EdmPrimitiveTypeKind.Date.getEdmPrimitiveTypeInstance().getName());
- assertEquals("DateTimeOffset", EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Decimal", EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Double", EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Duration", EdmPrimitiveTypeKind.Duration.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Guid", EdmPrimitiveTypeKind.Guid.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Int16", EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Int32", EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Int64", EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance().getName());
- assertEquals("SByte", EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance().getName());
- assertEquals("Single", EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance().getName());
- assertEquals("String", EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance().getName());
- assertEquals("TimeOfDay", EdmPrimitiveTypeKind.TimeOfDay.getEdmPrimitiveTypeInstance().getName());
- }
-
- @Test
- public void kind() throws Exception {
- for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
- assertEquals(EdmTypeKind.PRIMITIVE, kind.getEdmPrimitiveTypeInstance().getKind());
- }
- }
-
- @Test
- public void toStringAll() throws Exception {
- assertEquals("System.Uint7", Uint7.getInstance().toString());
-
- assertEquals("Edm.Null", EdmNull.getInstance().toString());
- assertEquals("Edm.Binary", EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Boolean", EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Byte", EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Date", EdmPrimitiveTypeKind.Date.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.DateTimeOffset", EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Decimal", EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Double", EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Duration", EdmPrimitiveTypeKind.Duration.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Guid", EdmPrimitiveTypeKind.Guid.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Int16", EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Int32", EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Int64", EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.SByte", EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.Single", EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.String", EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance().toString());
- assertEquals("Edm.TimeOfDay", EdmPrimitiveTypeKind.TimeOfDay.getEdmPrimitiveTypeInstance().toString());
-
- for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
- final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
- assertEquals(instance.toString(), kind.getFullQualifiedName().toString());
- }
- }
-
- @Test
- public void compatibility() {
- for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
- final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
- assertTrue(instance.isCompatible(instance));
- assertFalse(instance.isCompatible(
- (kind == EdmPrimitiveTypeKind.String ? EdmPrimitiveTypeKind.Binary : EdmPrimitiveTypeKind.String)
- .getEdmPrimitiveTypeInstance()));
- }
- }
-
- @Test
- public void defaultType() throws Exception {
- assertEquals(Byte.class, Uint7.getInstance().getDefaultType());
- assertNull(EdmNull.getInstance().getDefaultType());
-
- assertEquals(byte[].class, EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Boolean.class, EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Short.class, EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Calendar.class, EdmPrimitiveTypeKind.Date.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Calendar.class, EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(BigDecimal.class, EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Double.class, EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(BigDecimal.class, EdmPrimitiveTypeKind.Duration.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(UUID.class, EdmPrimitiveTypeKind.Guid.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Short.class, EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Integer.class, EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Long.class, EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Byte.class, EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Float.class, EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(String.class, EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance().getDefaultType());
- assertEquals(Calendar.class, EdmPrimitiveTypeKind.TimeOfDay.getEdmPrimitiveTypeInstance().getDefaultType());
- }
-
- @Test
- public void validate() throws Exception {
- for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
- final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
- assertTrue(instance.validate(null, null, null, null, null, null));
- assertTrue(instance.validate(null, true, null, null, null, null));
- assertFalse(instance.validate(null, false, null, null, null, null));
- assertFalse(instance.validate("ä", null, null, null, null, false));
- if (kind != EdmPrimitiveTypeKind.String && kind != EdmPrimitiveTypeKind.Binary) {
- assertFalse(instance.validate("", null, null, null, null, null));
- }
- if (kind != EdmPrimitiveTypeKind.String) {
- assertFalse(instance.validate("ä", null, null, null, null, null));
- }
- }
-
- assertTrue(EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().validate("abcd", null, 3, null, null, null));
- assertFalse(EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance().validate("abcd", null, 2, null, null, null));
-
- assertTrue(EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().validate("1", null, null, null, null,
- null));
- assertFalse(EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance().validate("1.2", null, null, null, 0, null));
- }
-
- @Test
- public void uriLiteral() throws Exception {
- for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
- final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
- assertEquals("test", instance.fromUriLiteral(instance.toUriLiteral("test")));
- assertNull(instance.toUriLiteral(null));
- assertNull(instance.fromUriLiteral(null));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBinaryTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBinaryTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBinaryTest.java
deleted file mode 100644
index 09914a5..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBinaryTest.java
+++ /dev/null
@@ -1,105 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Arrays;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmBinaryTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Binary.getEdmPrimitiveTypeInstance();
-
- @Test
- public void validate() throws Exception {
- assertTrue(instance.validate(null, null, null, null, null, null));
- assertTrue(instance.validate(null, true, null, null, null, null));
- assertFalse(instance.validate(null, false, null, null, null, null));
- assertTrue(instance.validate("", null, null, null, null, null));
- assertFalse(instance.validate("????", null, null, null, null, null));
-
- assertTrue(instance.validate("qrvM3e7_", null, null, null, null, null));
- assertTrue(instance.validate("qrvM3e7_", null, 6, null, null, null));
- assertFalse(instance.validate("qrvM3e7_", null, 5, null, null, null));
- }
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("binary'+hKqoQ=='", instance.toUriLiteral("+hKqoQ=="));
- assertEquals("binary''", instance.toUriLiteral(""));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("+hKqoQ==", instance.fromUriLiteral("binary'+hKqoQ=='"));
- assertEquals("", instance.fromUriLiteral("binary''"));
-
- expectErrorInFromUriLiteral(instance, "");
- expectErrorInFromUriLiteral(instance, "binary'\"");
- expectErrorInFromUriLiteral(instance, "X''");
- expectErrorInFromUriLiteral(instance, "Xinary''");
- }
-
- @Test
- public void valueToString() throws Exception {
- final byte[] binary = new byte[] { (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF };
-
- assertEquals("qrvM3e7_", instance.valueToString(binary, null, null, null, null, null));
-
- assertEquals("qrvM3e7_", instance.valueToString(binary, null, 6, null, null, null));
- assertEquals("qrvM3e7_", instance.valueToString(binary, null, Integer.MAX_VALUE, null, null, null));
-
- assertEquals("qg", instance.valueToString(new Byte[] { new Byte((byte) 170) }, null, null, null, null, null));
-
- expectFacetsErrorInValueToString(instance, binary, null, 3, null, null, null);
-
- expectTypeErrorInValueToString(instance, 0);
- }
-
- @Test
- public void valueOfString() throws Exception {
- final byte[] binary = new byte[] { (byte) 0xAA, (byte) 0xBB, (byte) 0xCC, (byte) 0xDD, (byte) 0xEE, (byte) 0xFF };
-
- assertTrue(Arrays.equals(binary, instance.valueOfString("qrvM3e7_", null, null, null, null, null, byte[].class)));
- assertTrue(Arrays.equals(new Byte[] { binary[0], binary[1], binary[2] }, instance.valueOfString("qrvM", null, null,
- null, null, null, Byte[].class)));
-
- assertTrue(Arrays.equals(binary, instance.valueOfString("qrvM3e7_", null, 6, null, null, null, byte[].class)));
- assertTrue(Arrays.equals(new byte[] { 42 }, instance.valueOfString("Kg==", null, 1, null, null, null,
- byte[].class)));
- assertTrue(Arrays.equals(new byte[] { 42 }, instance.valueOfString("Kg", null, 1, null, null, null,
- byte[].class)));
- assertTrue(Arrays.equals(new byte[] { 1, 2 }, instance.valueOfString("AQI=", null, 2, null, null, null,
- byte[].class)));
- assertTrue(Arrays.equals(binary, instance.valueOfString("qrvM3e7_", null, 6, null, null, null,
- byte[].class)));
- assertTrue(Arrays.equals(binary, instance.valueOfString("qrvM3e7_", null, Integer.MAX_VALUE, null, null, null,
- byte[].class)));
-
- expectFacetsErrorInValueOfString(instance, "qrvM3e7_", null, 3, null, null, null);
- expectContentErrorInValueOfString(instance, "@");
-
- expectTypeErrorInValueOfString(instance, "qrvM3e7_");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBooleanTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBooleanTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBooleanTest.java
deleted file mode 100644
index bc93aee..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmBooleanTest.java
+++ /dev/null
@@ -1,63 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmBooleanTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance();
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("true", instance.toUriLiteral("true"));
- assertEquals("false", instance.toUriLiteral("false"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("true", instance.fromUriLiteral("true"));
- assertEquals("false", instance.fromUriLiteral("false"));
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("true", instance.valueToString(true, null, null, null, null, null));
- assertEquals("false", instance.valueToString(Boolean.FALSE, null, null, null, null, null));
-
- expectTypeErrorInValueToString(instance, 0);
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(true, instance.valueOfString("true", null, null, null, null, null, Boolean.class));
- assertEquals(false, instance.valueOfString("false", null, null, null, null, null, Boolean.class));
-
- expectContentErrorInValueOfString(instance, "True");
- expectContentErrorInValueOfString(instance, "1");
- expectContentErrorInValueOfString(instance, "0");
- expectContentErrorInValueOfString(instance, "-1");
- expectContentErrorInValueOfString(instance, "FALSE");
-
- expectTypeErrorInValueOfString(instance, "true");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmByteTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmByteTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmByteTest.java
deleted file mode 100644
index a3b9a78..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmByteTest.java
+++ /dev/null
@@ -1,84 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmByteTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance();
-
- @Test
- public void compatibility() {
- assertTrue(instance.isCompatible(Uint7.getInstance()));
- }
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("127", instance.toUriLiteral("127"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("127", instance.fromUriLiteral("127"));
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("0", instance.valueToString(0, null, null, null, null, null));
- assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
- assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
- assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
- assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
- assertEquals("255", instance.valueToString(BigInteger.valueOf(255), null, null, null, null, null));
-
- expectContentErrorInValueToString(instance, -1);
- expectContentErrorInValueToString(instance, 256);
- expectContentErrorInValueToString(instance, BigInteger.valueOf(-1));
- expectContentErrorInValueToString(instance, BigInteger.valueOf(256));
-
- expectTypeErrorInValueToString(instance, 'A');
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(Short.valueOf((short) 1), instance.valueOfString("1", null, null, null, null, null, Short.class));
- assertEquals(Integer.valueOf(2), instance.valueOfString("2", null, null, null, null, null, Integer.class));
- assertEquals(Byte.valueOf((byte) 127), instance.valueOfString("127", null, null, null, null, null, Byte.class));
- assertEquals(Short.valueOf((short) 255), instance.valueOfString("255", null, null, null, null, null, Short.class));
- assertEquals(Long.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Long.class));
- assertEquals(BigInteger.TEN, instance.valueOfString("10", null, null, null, null, null, BigInteger.class));
-
- expectContentErrorInValueOfString(instance, "0x42");
- expectContentErrorInValueOfString(instance, "abc");
- expectContentErrorInValueOfString(instance, "256");
- expectContentErrorInValueOfString(instance, "-1");
- expectContentErrorInValueOfString(instance, "1.0");
-
- expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
-
- expectTypeErrorInValueOfString(instance, "1");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTest.java
deleted file mode 100644
index 45bd479..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTest.java
+++ /dev/null
@@ -1,92 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmDateTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Date.getEdmPrimitiveTypeInstance();
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("2009-12-26", instance.toUriLiteral("2009-12-26"));
- assertEquals("-2009-12-26", instance.toUriLiteral("-2009-12-26"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("2009-12-26", instance.fromUriLiteral("2009-12-26"));
- assertEquals("-2009-12-26", instance.fromUriLiteral("-2009-12-26"));
- }
-
- @Test
- public void valueToString() throws Exception {
- Calendar dateTime = Calendar.getInstance();
- dateTime.clear();
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT-11:30"));
- dateTime.set(2012, 1, 29, 13, 0, 0);
- assertEquals("2012-02-29", instance.valueToString(dateTime, null, null, null, null, null));
-
- final Long millis = 1330558323007L;
- assertEquals("2012-02-29", instance.valueToString(millis, null, null, null, null, null));
-
- assertEquals("1969-12-31", instance.valueToString(new Date(-43200000), null, null, null, null, null));
-
- dateTime.set(Calendar.YEAR, 12344);
- assertEquals("12344-02-29", instance.valueToString(dateTime, null, null, null, null, null));
-
- expectTypeErrorInValueToString(instance, 0);
- }
-
- @Test
- public void valueOfString() throws Exception {
- Calendar dateTime = Calendar.getInstance();
- dateTime.clear();
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
- dateTime.set(2012, 1, 29);
- assertEquals(dateTime, instance.valueOfString("2012-02-29", null, null, null, null, null, Calendar.class));
- assertEquals(Long.valueOf(dateTime.getTimeInMillis()), instance.valueOfString("2012-02-29", null, null, null, null,
- null, Long.class));
- assertEquals(dateTime.getTime(), instance.valueOfString("2012-02-29", null, null, null, null, null, Date.class));
-
- dateTime.set(Calendar.YEAR, 12344);
- assertEquals(dateTime, instance.valueOfString("12344-02-29", null, null, null, null, null, Calendar.class));
-
- // TODO: Clarify whether negative years are really needed.
- // dateTime.set(-1, 1, 28);
- // assertEquals(dateTime, instance.valueOfString("-0001-02-28", null, Calendar.class));
-
- expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02");
- expectContentErrorInValueOfString(instance, "2012-02-30");
- expectContentErrorInValueOfString(instance, "20120229");
- expectContentErrorInValueOfString(instance, "2012-02-1");
- expectContentErrorInValueOfString(instance, "2012-2-12");
- expectContentErrorInValueOfString(instance, "123-02-03");
-
- expectTypeErrorInValueOfString(instance, "2012-02-29");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTimeOffsetTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTimeOffsetTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTimeOffsetTest.java
deleted file mode 100644
index a6b8551..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDateTimeOffsetTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmDateTimeOffsetTest extends PrimitiveTypeBaseTest {
-
- final EdmPrimitiveType instance = EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance();
-
- @Test
- public void toUriLiteral() throws Exception {
- assertEquals("2009-12-26T21:23:38Z", instance.toUriLiteral("2009-12-26T21:23:38Z"));
- assertEquals("2002-10-10T12:00:00-05:00", instance.toUriLiteral("2002-10-10T12:00:00-05:00"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("2009-12-26T21:23:38Z", instance.fromUriLiteral("2009-12-26T21:23:38Z"));
- assertEquals("2002-10-10T12:00:00-05:00", instance.fromUriLiteral("2002-10-10T12:00:00-05:00"));
- }
-
- @Test
- public void valueToString() throws Exception {
- Calendar dateTime = Calendar.getInstance();
- dateTime.clear();
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
- dateTime.set(2012, 1, 29, 1, 2, 3);
- assertEquals("2012-02-29T01:02:03Z", instance.valueToString(dateTime, null, null, null, null, null));
- assertEquals("2012-02-29T01:02:03Z", instance.valueToString(dateTime, null, null, 0, null, null));
- assertEquals("2012-02-29T01:02:03Z", instance.valueToString(dateTime, null, null, 5, null, null));
-
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT-1:30"));
- assertEquals("2012-02-29T01:02:03-01:30", instance.valueToString(dateTime, null, null, null, null, null));
-
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT+11:00"));
- assertEquals("2012-02-29T01:02:03+11:00", instance.valueToString(dateTime, null, null, null, null, null));
-
- final Long millis = 1330558323007L;
- assertEquals("2012-02-29T23:32:03.007Z", instance.valueToString(millis, null, null, 3, null, null));
- assertEquals("1969-12-31T23:59:59.9Z", instance.valueToString(-100L, null, null, 1, null, null));
- assertEquals("1969-12-31T23:59:59.98Z", instance.valueToString(-20L, null, null, 2, null, null));
-
- final Date date = new Date(millis);
- final String time = date.toString().substring(11, 19);
- assertTrue(instance.valueToString(date, null, null, 3, null, null).contains(time));
-
- expectFacetsErrorInValueToString(instance, millis, null, null, null, null, null);
- expectFacetsErrorInValueToString(instance, 3L, null, null, 2, null, null);
-
- expectTypeErrorInValueToString(instance, 0);
- }
-
- @Test
- public void valueOfString() throws Exception {
- Calendar dateTime = Calendar.getInstance();
- dateTime.clear();
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
- dateTime.set(2012, 1, 29, 1, 2, 3);
- assertEquals(dateTime, instance.valueOfString("2012-02-29T01:02:03Z", null, null, null, null, null,
- Calendar.class));
- assertEquals(Long.valueOf(dateTime.getTimeInMillis()), instance.valueOfString("2012-02-29T01:02:03+00:00", null,
- null, null, null, null, Long.class));
- assertEquals(dateTime, instance.valueOfString("2012-02-29T01:02:03", null, null, null, null, null,
- Calendar.class));
-
- dateTime.clear();
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT-01:30"));
- dateTime.set(2012, 1, 29, 1, 2, 3);
- assertEquals(dateTime.getTime(), instance.valueOfString("2012-02-29T01:02:03-01:30", null, null, null, null, null,
- Date.class));
-
- dateTime.clear();
- dateTime.setTimeZone(TimeZone.getTimeZone("GMT+11:00"));
- dateTime.set(2012, 1, 29, 1, 2, 3);
- assertEquals(dateTime, instance.valueOfString("2012-02-29T01:02:03+11:00", null, null, null, null, null,
- Calendar.class));
-
- dateTime.add(Calendar.MILLISECOND, 7);
- assertEquals(dateTime, instance.valueOfString("2012-02-29T01:02:03.007+11:00", null, null, 3, null, null,
- Calendar.class));
-
- assertEquals(Long.valueOf(120000L), instance.valueOfString("1970-01-01T00:02", null, null, null, null, null,
- Long.class));
- assertEquals(Long.valueOf(12L), instance.valueOfString("1970-01-01T00:00:00.012", null, null, 3, null, null,
- Long.class));
- assertEquals(Long.valueOf(120L), instance.valueOfString("1970-01-01T00:00:00.12", null, null, 2, null, null,
- Long.class));
-
- expectFacetsErrorInValueOfString(instance, "2012-02-29T23:32:02.9Z", null, null, null, null, null);
- expectFacetsErrorInValueOfString(instance, "2012-02-29T23:32:02.9Z", null, null, 0, null, null);
- expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02X");
- expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02+24:00");
- expectContentErrorInValueOfString(instance, "2012-02-30T01:02:03");
- expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02.");
- expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02.0000000000000");
-
- expectTypeErrorInValueOfString(instance, "2012-02-29T01:02:03Z");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDecimalTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDecimalTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDecimalTest.java
deleted file mode 100644
index 7bff071..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDecimalTest.java
+++ /dev/null
@@ -1,130 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmDecimalTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance();
-
- @Test
- public void compatibility() {
- assertTrue(instance.isCompatible(Uint7.getInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance()));
- }
-
- @Test
- public void uriLiteral() throws Exception {
- assertEquals("12.34", instance.toUriLiteral("12.34"));
- assertEquals("12.34", instance.fromUriLiteral("12.34"));
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("0", instance.valueToString(0, null, null, null, null, null));
- assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
- assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
- assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
- assertEquals("-32768", instance.valueToString(-32768, null, null, null, null, null));
- assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
- assertEquals("1234567890123456789012345678901", instance.valueToString(new BigInteger(
- "1234567890123456789012345678901"), null, null, null, null, null));
- assertEquals("0.00390625", instance.valueToString(1.0 / 256, null, null, null, 8, null));
- assertEquals("-0.125", instance.valueToString(-0.125f, null, null, null, 3, null));
- assertEquals("-1234567890.1234567890", instance.valueToString(new BigDecimal(
- "-1234567890.1234567890"), null, null, null, 10, null));
-
- assertEquals("-32768", instance.valueToString(-32768, null, null, 42, null, null));
- assertEquals("-32768", instance.valueToString(-32768, null, null, 5, null, null));
- assertEquals("32768", instance.valueToString(32768, null, null, 5, null, null));
- assertEquals("0.5", instance.valueToString(0.5, null, null, 1, 1, null));
- assertEquals("0.5", instance.valueToString(0.5, null, null, null, 1, null));
- assertEquals("100", instance.valueToString(new BigDecimal(BigInteger.ONE, -2), null, null, 3, null, null));
-
- expectFacetsErrorInValueToString(instance, 0.5, null, null, null, null, null);
- expectFacetsErrorInValueToString(instance, -1234, null, null, 2, null, null);
- expectFacetsErrorInValueToString(instance, 1234, null, null, 3, null, null);
- expectFacetsErrorInValueToString(instance, 0.00390625, null, null, 5, null, null);
- expectFacetsErrorInValueToString(instance, 0.00390625, null, null, null, 7, null);
-
- expectContentErrorInValueToString(instance, Double.NaN);
-
- expectTypeErrorInValueToString(instance, 'A');
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(BigDecimal.ONE, instance.valueOfString("1", null, null, null, null, null, BigDecimal.class));
- assertEquals(Byte.valueOf((byte) -2), instance.valueOfString("-2", null, null, null, null, null, Byte.class));
- assertEquals(new BigDecimal("-123456789012345678901234567890"), instance.valueOfString(
- "-123456789012345678901234567890", null, null, null, null, null, BigDecimal.class));
- assertEquals(Short.valueOf((short) 0), instance.valueOfString("0", null, null, null, null, null, Short.class));
-
- assertEquals(Integer.valueOf(-32768), instance.valueOfString("-32768", null, null, 42, null, null, Integer.class));
- assertEquals(Long.valueOf(-32768), instance.valueOfString("-32768", null, null, 5, null, null, Long.class));
- assertEquals(BigInteger.valueOf(32768), instance.valueOfString("32768", null, null, 5, null, null,
- BigInteger.class));
- assertEquals(Double.valueOf(0.5), instance.valueOfString("0.5", null, null, 1, 1, null, Double.class));
- assertEquals(Float.valueOf(0.5F), instance.valueOfString("0.5", null, null, null, 1, null, Float.class));
- assertEquals(new BigDecimal("12.3"), instance.valueOfString("12.3", null, null, 3, 1, null, BigDecimal.class));
-
- expectFacetsErrorInValueOfString(instance, "0.5", null, null, null, null, null);
- expectFacetsErrorInValueOfString(instance, "-1234", null, null, 2, null, null);
- expectFacetsErrorInValueOfString(instance, "1234", null, null, 3, null, null);
- expectFacetsErrorInValueOfString(instance, "12.34", null, null, 3, null, null);
- expectFacetsErrorInValueOfString(instance, "12.34", null, null, 3, 2, null);
- expectFacetsErrorInValueOfString(instance, "12.34", null, null, 4, 1, null);
- expectFacetsErrorInValueOfString(instance, "0.00390625", null, null, 5, null, null);
- expectFacetsErrorInValueOfString(instance, "0.00390625", null, null, null, 7, null);
-
- expectContentErrorInValueOfString(instance, "-1E2");
- expectContentErrorInValueOfString(instance, "1.");
- expectContentErrorInValueOfString(instance, ".1");
- expectContentErrorInValueOfString(instance, "1.0.1");
- expectContentErrorInValueOfString(instance, "1M");
- expectContentErrorInValueOfString(instance, "0x42");
-
- expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "-2147483649", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "2147483648", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "-9223372036854775809", Long.class);
- expectUnconvertibleErrorInValueOfString(instance, "9223372036854775808", Long.class);
- expectUnconvertibleErrorInValueOfString(instance, "12345678901234567", Double.class);
- expectUnconvertibleErrorInValueOfString(instance, "1234567890", Float.class);
-
- expectTypeErrorInValueOfString(instance, "1");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDoubleTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDoubleTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDoubleTest.java
deleted file mode 100644
index 9085a68..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/primitivetype/EdmDoubleTest.java
+++ /dev/null
@@ -1,130 +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.commons.core.edm.primitivetype;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmPrimitiveType;
-import org.junit.Test;
-
-public class EdmDoubleTest extends PrimitiveTypeBaseTest {
-
- private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance();
-
- @Test
- public void compatibility() {
- assertTrue(instance.isCompatible(Uint7.getInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance()));
- assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance()));
- }
-
- @Test
- public void toUriLiteral() {
- assertEquals("127E42", instance.toUriLiteral("127E42"));
- }
-
- @Test
- public void fromUriLiteral() throws Exception {
- assertEquals("127E42", instance.fromUriLiteral("127E42"));
- }
-
- @Test
- public void valueToString() throws Exception {
- assertEquals("0", instance.valueToString(0, null, null, null, null, null));
- assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
- assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
- assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
- assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
- assertEquals("0.00390625", instance.valueToString(1.0 / 256, null, null, null, null, null));
- assertEquals("4.2E-41", instance.valueToString(42e-42, null, null, null, null, null));
- assertEquals("INF", instance.valueToString(Double.POSITIVE_INFINITY, null, null, null, null, null));
- assertEquals("-INF", instance.valueToString(Double.NEGATIVE_INFINITY, null, null, null, null, null));
- assertEquals("NaN", instance.valueToString(Double.NaN, null, null, null, null, null));
- assertEquals("-0.125", instance.valueToString(-0.125f, null, null, null, null, null));
- assertEquals("INF", instance.valueToString(Float.POSITIVE_INFINITY, null, null, null, null, null));
- assertEquals("-INF", instance.valueToString(Float.NEGATIVE_INFINITY, null, null, null, null, null));
- assertEquals("NaN", instance.valueToString(Float.NaN, null, null, null, null, null));
- assertEquals("-1234567890.12345", instance.valueToString(new BigDecimal("-1234567890.12345"), null, null, null,
- null, null));
-
- expectContentErrorInValueToString(instance, 3234567890123456L);
- expectContentErrorInValueToString(instance, new BigDecimal("98765432109876543"));
- expectContentErrorInValueToString(instance, new BigDecimal(BigInteger.ONE, 324));
- expectContentErrorInValueToString(instance, new BigDecimal(BigInteger.ONE.negate(), -309));
-
- expectTypeErrorInValueToString(instance, 'A');
- }
-
- @Test
- public void valueOfString() throws Exception {
- assertEquals(Double.valueOf(1.42), instance.valueOfString("1.42", null, null, null, null, null, Double.class));
- assertEquals(Float.valueOf(-42.25F), instance.valueOfString("-42.25", null, null, null, null, null, Float.class));
- assertEquals(Double.valueOf(42.0), instance.valueOfString("42", null, null, null, null, null, Double.class));
- assertEquals(Double.valueOf(42E42), instance.valueOfString("42E42", null, null, null, null, null, Double.class));
- assertEquals(BigDecimal.TEN, instance.valueOfString("10", null, null, null, null, null, BigDecimal.class));
- assertEquals(Byte.valueOf((byte) 0), instance.valueOfString("0", null, null, null, null, null, Byte.class));
- assertEquals(Short.valueOf((short) 1), instance.valueOfString("1.00", null, null, null, null, null, Short.class));
- assertEquals(Integer.valueOf(42), instance.valueOfString("4.2E1", null, null, null, null, null, Integer.class));
- assertEquals(Long.valueOf(1234567890), instance.valueOfString("1234567890E-00", null, null, null, null, null,
- Long.class));
-
- assertEquals(Double.valueOf(Double.NaN), instance.valueOfString("NaN", null, null, null, null, null,
- Double.class));
- assertEquals(Double.valueOf(Double.NEGATIVE_INFINITY), instance.valueOfString("-INF", null, null, null, null,
- null, Double.class));
- assertEquals(Float.valueOf(Float.POSITIVE_INFINITY), instance.valueOfString("INF", null, null, null, null, null,
- Float.class));
-
- expectContentErrorInValueOfString(instance, "0.");
- expectContentErrorInValueOfString(instance, ".0");
- expectContentErrorInValueOfString(instance, "1234567890.12345678");
- expectContentErrorInValueOfString(instance, "42E400");
- expectContentErrorInValueOfString(instance, "42.42.42");
- expectContentErrorInValueOfString(instance, "42F");
- expectContentErrorInValueOfString(instance, "0x42P42");
-
- expectUnconvertibleErrorInValueOfString(instance, "INF", BigDecimal.class);
- expectUnconvertibleErrorInValueOfString(instance, "NaN", BigDecimal.class);
- expectUnconvertibleErrorInValueOfString(instance, "1234567.0625", Float.class);
- expectUnconvertibleErrorInValueOfString(instance, "-INF", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "NaN", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "5E-1", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "5E-1", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "5E-1", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "5E-1", Long.class);
- expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
- expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
- expectUnconvertibleErrorInValueOfString(instance, "-2147483649", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "2147483648", Integer.class);
- expectUnconvertibleErrorInValueOfString(instance, "-922337203685477.5E10", Long.class);
- expectUnconvertibleErrorInValueOfString(instance, "922337203685477.5E10", Long.class);
-
- expectTypeErrorInValueOfString(instance, "1.42");
- }
-}
[03/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExceptionVisitExpand.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExceptionVisitExpand.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExceptionVisitExpand.java
new file mode 100644
index 0000000..084b387
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExceptionVisitExpand.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public class ExceptionVisitExpand extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.java
new file mode 100644
index 0000000..d15c4b8
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandItem.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.server.api.uri.queryoption;
+
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.server.api.uri.UriInfoResource;
+
+public interface ExpandItem {
+
+ LevelsExpandOption getLevelsOption();
+
+ FilterOption getFilterOption();
+
+ SearchOption getSearchOption();
+
+ OrderByOption getOrderByOption();
+
+ SkipOption getSkipOption();
+
+ TopOption getTopOption();
+
+ CountOption getInlineCountOption();
+
+ SelectOption getSelectOption();
+
+ ExpandOption getExpandOption();
+
+ UriInfoResource getResourcePath();
+
+ boolean isStar();
+
+ boolean isRef();
+
+ EdmType getStartTypeFilter();
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandOption.java
new file mode 100644
index 0000000..db5b6ea
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/ExpandOption.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+import java.util.List;
+
+public interface ExpandOption extends SystemQueryOption {
+
+ List<ExpandItem> getExpandItems();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FilterOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FilterOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FilterOption.java
new file mode 100644
index 0000000..0da541a
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FilterOption.java
@@ -0,0 +1,26 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+
+public interface FilterOption extends SystemQueryOption {
+
+ Expression getExpression();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FormatOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FormatOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FormatOption.java
new file mode 100644
index 0000000..e2f6d0a
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/FormatOption.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface FormatOption extends SystemQueryOption {
+
+ // TODO planned: define best representation for format to enable plugging in custom formats
+ String getFormat();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/IdOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/IdOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/IdOption.java
new file mode 100644
index 0000000..7ef8d71
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/IdOption.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface IdOption extends SystemQueryOption {
+
+ String getValue();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/LevelsExpandOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/LevelsExpandOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/LevelsExpandOption.java
new file mode 100644
index 0000000..1026b0c
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/LevelsExpandOption.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface LevelsExpandOption {
+
+ boolean isMax();
+
+ int getValue();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByItem.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByItem.java
new file mode 100644
index 0000000..856cc43
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByItem.java
@@ -0,0 +1,33 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+
+public interface OrderByItem {
+
+ /**
+ * Returns the sort order of the orderBy item
+ * @return if false (default) the sort order is ascending, if true the sort order is descending
+ */
+ boolean isDescending();
+
+ Expression getExpression();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByOption.java
new file mode 100644
index 0000000..1752747
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/OrderByOption.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+import java.util.List;
+
+public interface OrderByOption extends SystemQueryOption {
+
+ List<OrderByItem> getOrders();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/QueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/QueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/QueryOption.java
new file mode 100644
index 0000000..72cef7b
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/QueryOption.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface QueryOption {
+
+ public String getName();
+
+ public String getText();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SearchOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SearchOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SearchOption.java
new file mode 100644
index 0000000..17716b7
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SearchOption.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+import org.apache.olingo.server.api.uri.queryoption.search.SearchExpression;
+
+public interface SearchOption extends SystemQueryOption {
+
+ SearchExpression getSearchExpression();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectItem.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectItem.java
new file mode 100644
index 0000000..16c551f
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectItem.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.server.api.uri.queryoption;
+
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.uri.UriInfoResource;
+
+public interface SelectItem {
+
+ boolean isStar();
+
+ boolean isAllOperationsInSchema();
+
+ FullQualifiedName getAllOperationsInSchemaNameSpace();
+
+ UriInfoResource getResourcePath();
+
+ EdmType getStartTypeFilter();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectOption.java
new file mode 100644
index 0000000..bb878f5
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SelectOption.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+import java.util.List;
+
+public interface SelectOption extends SystemQueryOption {
+
+ List<SelectItem> getSelectItems();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipOption.java
new file mode 100644
index 0000000..1156bc4
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipOption.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface SkipOption extends SystemQueryOption {
+
+ String getValue();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipTokenOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipTokenOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipTokenOption.java
new file mode 100644
index 0000000..c0d6cc6
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SkipTokenOption.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface SkipTokenOption extends SystemQueryOption {
+
+ String getValue();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SupportedQueryOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SupportedQueryOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SupportedQueryOptions.java
new file mode 100644
index 0000000..b29c5e5
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SupportedQueryOptions.java
@@ -0,0 +1,45 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public enum SupportedQueryOptions {
+ FILTER("$filter"),
+ FORMAT("$format"),
+ EXPAND("$expand"),
+ ID("$id"),
+ COUNT("$count"),
+ ORDERBY("$orderby"),
+ SEARCH("$search"),
+ SELECT("$select"),
+ SKIP("$skip"),
+ SKIPTOKEN("$skiptoken"),
+ TOP("$top"),
+ LEVELS("$level");
+
+ String syntax;
+
+ private SupportedQueryOptions(final String syntax) {
+ this.syntax = syntax;
+ }
+
+ @Override
+ public String toString() {
+ return syntax;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOption.java
new file mode 100644
index 0000000..a34f16c
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/SystemQueryOption.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface SystemQueryOption extends QueryOption {
+
+ SupportedQueryOptions getKind();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/TopOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/TopOption.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/TopOption.java
new file mode 100644
index 0000000..26ca27b
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/TopOption.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption;
+
+public interface TopOption extends SystemQueryOption {
+
+ String getValue();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/AliasExpression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/AliasExpression.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/AliasExpression.java
new file mode 100644
index 0000000..9a0a59f
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/AliasExpression.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+public interface AliasExpression extends Expression {
+
+ public String getParameterName();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryExpression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryExpression.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryExpression.java
new file mode 100644
index 0000000..94ebfb5
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryExpression.java
@@ -0,0 +1,29 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+public interface BinaryExpression extends Expression {
+
+ public BinaryOperatorKind getOperator();
+
+ public Expression getLeftOperand();
+
+ public Expression getRightOperand();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryOperatorKind.java
new file mode 100644
index 0000000..e8eb1a1
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/BinaryOperatorKind.java
@@ -0,0 +1,57 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+
+public enum BinaryOperatorKind {
+
+ // enum
+ HAS("has"),
+ // multiplicative
+ MUL("mul"), DIV("div"), MOD("mod"),
+ // additive
+ ADD("add"), SUB("sub"),
+ // comparism
+ GT("gt"), GE("ge"), LT("lt"), LE("le"),
+ // equality
+ EQ("eq"), NE("ne"),
+ // and/or
+ AND("and"), OR("or");
+
+ private String syntax;
+
+ private BinaryOperatorKind(final String syntax) {
+ this.syntax = syntax;
+ }
+
+ public static BinaryOperatorKind get(final String operator) {
+ for (BinaryOperatorKind op : BinaryOperatorKind.values()) {
+ if (op.toString().equals(operator)) {
+ return op;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ return syntax;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Enumeration.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Enumeration.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Enumeration.java
new file mode 100644
index 0000000..baea2b7
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Enumeration.java
@@ -0,0 +1,31 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+
+public interface Enumeration extends Expression {
+
+ public List<String> getValues();
+
+ public EdmEnumType getType();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Expression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Expression.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Expression.java
new file mode 100644
index 0000000..61504da
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Expression.java
@@ -0,0 +1,23 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+public interface Expression extends VisitableExression {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java
new file mode 100644
index 0000000..8e33a9a
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitException.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+public class ExpressionVisitException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
new file mode 100644
index 0000000..39080ef
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/ExpressionVisitor.java
@@ -0,0 +1,57 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataApplicationException;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.server.api.uri.UriInfoResource;
+
+public interface ExpressionVisitor<T> {
+
+ T visitBinaryOperator(BinaryOperatorKind operator, T left, T right)
+ throws ExpressionVisitException, ODataApplicationException;
+
+ T visitUnaryOperator(UnaryOperatorKind operator, T operand)
+ throws ExpressionVisitException, ODataApplicationException;
+
+
+ T visitMethodCall(MethodCallKind methodCall, List<T> parameters)
+ throws ExpressionVisitException, ODataApplicationException;
+
+
+ T visitLambdaExpression(String functionText, String variableText, Expression expression)
+ throws ExpressionVisitException, ODataApplicationException;
+
+ T visitLiteral(String literal) throws ExpressionVisitException, ODataApplicationException;
+
+ T visitMember(UriInfoResource member) throws ExpressionVisitException, ODataApplicationException;
+
+ T visitAlias(String referenceName) throws ExpressionVisitException, ODataApplicationException;
+
+ T visitTypeLiteral(EdmType type) throws ExpressionVisitException, ODataApplicationException;
+
+ T visitLambdaReference(String variableText) throws ExpressionVisitException, ODataApplicationException;
+
+ T visitEnum(EdmEnumType type, List<String> enumValues) throws ExpressionVisitException, ODataApplicationException;
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/LambdaRef.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/LambdaRef.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/LambdaRef.java
new file mode 100644
index 0000000..dce11b0
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/LambdaRef.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+public interface LambdaRef extends Expression {
+
+ public String getVariableName();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Literal.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Literal.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Literal.java
new file mode 100644
index 0000000..aea08a4
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Literal.java
@@ -0,0 +1,29 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+import org.apache.olingo.commons.api.edm.EdmType;
+
+public interface Literal extends Expression {
+
+ public String getText();
+
+ public EdmType getType();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Member.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Member.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Member.java
new file mode 100644
index 0000000..5eafc20
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/Member.java
@@ -0,0 +1,36 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.server.api.uri.UriInfoResource;
+
+public interface Member extends Expression {
+
+ public UriInfoResource getResourcePath();
+
+ public EdmType getType();
+ public EdmType getStartTypeFilter();
+
+ public boolean isCollection();
+
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodCall.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodCall.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodCall.java
new file mode 100644
index 0000000..88130a1
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodCall.java
@@ -0,0 +1,29 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+import java.util.List;
+
+public interface MethodCall extends Expression {
+
+ public MethodCallKind getMethod();
+
+ public List<Expression> getParameters();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodCallKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodCallKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodCallKind.java
new file mode 100644
index 0000000..53b6983
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/MethodCallKind.java
@@ -0,0 +1,58 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+public enum MethodCallKind {
+ CONTAINS("contains"), STARTSWITH("startswith"), ENDSWITH("endswith"), LENGTH("length"),
+ INDEXOF("indexof"), SUBSTRING("substring"), TOLOWER("tolower"), TOUPPER("toupper"), TRIM("trim"),
+ CONCAT("concat"),
+
+ YEAR("year"), MONTH("month"), DAY("day"), HOUR("hour"), MINUTE("minute"), SECOND("second"),
+ FRACTIONALSECONDS("fractionalseconds"), TOTALSECONDS("totalseconds"), DATE("date"), TIME("time"),
+ TOTALOFFSETMINUTES("totaloffsetminutes"), MINDATETIME("mindatetime"), MAXDATETIME("maxdatetime"), NOW("now"),
+
+ ROUND("round"), FLOOR("floor"),
+
+ CEILING("ceiling"), GEODISTANCE("geo.distance"), GEOLENGTH("geo.length"), GEOINTERSECTS("geo.intersects"),
+ CAST("cast"),
+ ISOF("isof");
+
+ private String syntax;
+
+ private MethodCallKind(final String syntax) {
+ this.syntax = syntax;
+ }
+
+ @Override
+ public String toString() {
+ return syntax;
+ }
+
+
+ public static MethodCallKind get(final String method) {
+ for (MethodCallKind op : MethodCallKind.values()) {
+
+ if (op.toString().equals(method)) {
+ return op;
+ }
+ }
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/TypeLiteral.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/TypeLiteral.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/TypeLiteral.java
new file mode 100644
index 0000000..a80ea2e
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/TypeLiteral.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+import org.apache.olingo.commons.api.edm.EdmType;
+
+public interface TypeLiteral extends Expression {
+
+ public EdmType getType();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperator.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperator.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperator.java
new file mode 100644
index 0000000..e5aafb8
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperator.java
@@ -0,0 +1,27 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+public interface UnaryOperator extends Expression {
+
+ public Expression getOperand();
+
+ public UnaryOperatorKind getOperator();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperatorKind.java
new file mode 100644
index 0000000..f446cd6
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/UnaryOperatorKind.java
@@ -0,0 +1,44 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+public enum UnaryOperatorKind {
+ MINUS("-"), NOT("not");
+
+ private String syntax;
+
+ private UnaryOperatorKind(final String syntax) {
+ this.syntax = syntax;
+ }
+
+ @Override
+ public String toString() {
+ return syntax;
+ }
+
+ public static UnaryOperatorKind get(final String operator) {
+ for (UnaryOperatorKind op : UnaryOperatorKind.values()) {
+ if (op.toString().equals(operator)) {
+ return op;
+ }
+ }
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/VisitableExression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/VisitableExression.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/VisitableExression.java
new file mode 100644
index 0000000..599069f
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/expression/VisitableExression.java
@@ -0,0 +1,47 @@
+/*
+ * 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.server.api.uri.queryoption.expression;
+
+import org.apache.olingo.commons.api.ODataApplicationException;
+
+public interface VisitableExression {
+
+ /**
+ * Method {@link #accept(ExpressionVisitor)} is called when traversing the expression tree. This method is invoked on
+ * each expression used as node in an expression tree. The implementations should
+ * behave as follows:
+ * <li>Call accept on all sub nodes and store the returned Objects which are of the generic type T
+ * <li>Call the appropriate method on the {@link ExpressionVisitor} instance and provide the stored return objects
+ * to that instance
+ * <li>Return the object which should be passed to the processing algorithm of the parent expression node
+ * <br>
+ * <br>
+ * @param visitor
+ * Object (implementing {@link ExpressionVisitor}) whose methods are called during traversing a
+ * expression node of the expression tree.
+ * @return
+ * Object of type T which should be passed to the processing algorithm of the parent expression node
+ * @throws ExpressionVisitException
+ * Exception occurred the OData library while traversing the tree
+ * @throws ODataApplicationException
+ * Exception thrown by the application who implemented the visitor
+ */
+ <T> T accept(ExpressionVisitor<T> visitor) throws ExpressionVisitException, ODataApplicationException;
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinary.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinary.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinary.java
new file mode 100644
index 0000000..8ba0843
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinary.java
@@ -0,0 +1,29 @@
+/*
+ * 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.server.api.uri.queryoption.search;
+
+public interface SearchBinary extends SearchExpression {
+
+ SearchBinaryOperatorKind getOperator();
+
+ SearchExpression getLeftOperand();
+
+ SearchExpression getRightOperand();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
new file mode 100644
index 0000000..4ad5ff1
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchBinaryOperatorKind.java
@@ -0,0 +1,45 @@
+/*
+ * 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.server.api.uri.queryoption.search;
+
+public enum SearchBinaryOperatorKind {
+ // and/or
+ AND("and"), OR("or");
+
+ private String syntax;
+
+ private SearchBinaryOperatorKind(final String syntax) {
+ this.syntax = syntax;
+ }
+
+ @Override
+ public String toString() {
+ return syntax;
+ }
+
+ public static SearchBinaryOperatorKind get(final String operator) {
+ for (SearchBinaryOperatorKind op : SearchBinaryOperatorKind.values()) {
+ if (op.toString().equals(operator)) {
+ return op;
+ }
+ }
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchExpression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchExpression.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchExpression.java
new file mode 100644
index 0000000..a87888c
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchExpression.java
@@ -0,0 +1,23 @@
+/*
+ * 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.server.api.uri.queryoption.search;
+
+public interface SearchExpression {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchTerm.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchTerm.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchTerm.java
new file mode 100644
index 0000000..a08f2bd
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchTerm.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption.search;
+
+public interface SearchTerm extends SearchExpression {
+
+ String getSearchTerm();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnary.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnary.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnary.java
new file mode 100644
index 0000000..5492deb
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnary.java
@@ -0,0 +1,25 @@
+/*
+ * 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.server.api.uri.queryoption.search;
+
+public interface SearchUnary {
+
+ SearchExpression getOperand();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
new file mode 100644
index 0000000..5176515
--- /dev/null
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/uri/queryoption/search/SearchUnaryOperatorKind.java
@@ -0,0 +1,43 @@
+/*
+ * 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.server.api.uri.queryoption.search;
+
+public enum SearchUnaryOperatorKind {
+ NOT("not");
+
+ private String syntax;
+
+ private SearchUnaryOperatorKind(final String syntax) {
+ this.syntax = syntax;
+ }
+
+ @Override
+ public String toString() {
+ return syntax;
+ }
+
+ public static SearchUnaryOperatorKind get(final String operator) {
+ for (SearchUnaryOperatorKind op : SearchUnaryOperatorKind.values()) {
+ if (op.toString().equals(operator)) {
+ return op;
+ }
+ }
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-core/pom.xml b/lib/server-core/pom.xml
index 2d7c2f2..5f30cf5 100644
--- a/lib/server-core/pom.xml
+++ b/lib/server-core/pom.xml
@@ -75,7 +75,7 @@
<visitor>true</visitor>
<!--maven antlr plugin has trouble with grammer import if the grammerfiles
are not directly inside src/main/antlr4, hence we have to set the libDirectory -->
- <libDirectory>src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr</libDirectory>
+ <libDirectory>src/main/antlr4/org/apache/olingo/server/core/uri/antlr</libDirectory>
</configuration>
</plugin>
</plugins>
[02/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriLexer.g4
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriLexer.g4 b/lib/server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriLexer.g4
deleted file mode 100644
index eee6486..0000000
--- a/lib/server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriLexer.g4
+++ /dev/null
@@ -1,404 +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.
- ******************************************************************************/
-lexer grammar UriLexer;
-
-//;==============================================================================
-// Mode "DEFAULT_MODE": Processes everything bevor the first '?' char
-// On '?' the next mode "MODE_QUERY" is used
-// The percent encoding rules a defined in RFC3986 ABNF rule "path-rootless" apply
-//;==============================================================================
-QM : '?' -> pushMode(MODE_QUERY); //first query parameter
-AMP : '&' -> pushMode(MODE_QUERY); //more query parameters
-STRING : '\'' -> more, pushMode(MODE_STRING); //reads up to next single '
-QUOTATION_MARK : ('\u0022' | '%22') -> more, pushMode(MODE_JSON_STRING); //reads up to next unescaped "
-SEARCH_INLINE : '$search' -> pushMode(MODE_SYSTEM_QUERY_SEARCH); //
-FRAGMENT : '#' -> pushMode(MODE_FRAGMENT); //
-
-GEOGRAPHY : G E O G R A P H Y SQUOTE -> pushMode(MODE_ODATA_GEO); //TODO make case insensitive
-GEOMETRY : G E O M E T R Y SQUOTE -> pushMode(MODE_ODATA_GEO);
-
-//Letters for case insensitivity
-fragment A : 'A'|'a';
-fragment B : 'B'|'b';
-fragment D : 'D'|'d';
-fragment E : 'E'|'e';
-fragment F : 'F'|'f';
-fragment G : 'G'|'g';
-fragment H : 'H'|'h';
-fragment I : 'I'|'i';
-fragment L : 'L'|'l';
-fragment M : 'M'|'m';
-fragment N : 'N'|'n';
-fragment O : 'O'|'o';
-fragment P : 'P'|'p';
-fragment R : 'R'|'r';
-fragment S : 'S'|'s';
-fragment T : 'T'|'t';
-fragment U : 'U'|'u';
-fragment Y : 'Y'|'y';
-fragment Z : 'Z'|'z';
-
-//special chars
-OPEN : '(' | '%28';
-CLOSE : ')' | '%29';
-COMMA : ',' | '%2C';
-SLASH : '/';
-POINT : '.';
-AT : '@';
-EQ : '=' ;
-STAR : '*';
-SEMI : ';' | '%3b';
-COLON : ':';
-
-EQ_sq : '=' -> type(EQ);
-AMP_sq : '&' -> type(AMP), popMode;
-fragment WS : ( ' ' | '%09' | '%20' | '%09' );
-WSP : WS+;
-
-//JSON support
-BEGIN_OBJECT : WS* ( '{' / '%7B' ) WS*;
-END_OBJECT : WS* ( '}' / '%7D' ) WS*;
-
-BEGIN_ARRAY : WS* ( '[' / '%5B' ) WS*;
-END_ARRAY : WS* ( ']' / '%5D' ) WS*;
-
-
-//alpha stuff
-fragment ALPHA : 'a'..'z' | 'A'..'Z';
-fragment ALPHA_A_TO_F : 'a'..'f' | 'A'..'F';
-fragment DIGIT : '0'..'9';
-fragment DIGITS : DIGIT+;
-fragment HEXDIG : DIGIT | ALPHA_A_TO_F;
-fragment ODI_LEADINGCHARACTER : ALPHA | '_'; //TODO; add Unicode characters from the categories L or Nl
-fragment ODI_CHARACTER : ALPHA | '_' | DIGIT; //TODO; add Unicode characters from the categories L, Nl, Nd, Mn, Mc, Pc, or Cf
-
-//helper for date/time values
-fragment ONE_TO_NINE : '1'..'9';
-fragment ZERO_TO_FIFTYNINE : ('0'..'5') DIGIT;
-fragment FRACTIONALSECONDS : DIGIT+;
-fragment SECOND : ZERO_TO_FIFTYNINE;
-fragment MINUTE : ZERO_TO_FIFTYNINE;
-fragment HOUR : ('0' | '1') DIGIT | '2' ( '0'..'3');
-fragment DAY : '0' '1'..'9' | ('1'|'2') DIGIT | '3' ('0'|'1');
-fragment MONTH : '0' ONE_TO_NINE | '1' ( '0' | '1' | '2' );
-fragment YEAR : ('-')? ( '0' DIGIT DIGIT DIGIT | ONE_TO_NINE DIGIT DIGIT DIGIT );
-
-//tags start with $
-BATCH : '$batch';
-ENTITY : '$entity';
-METADATA : '$metadata';
-
-ALL : '$all';
-CROSSJOIN : '$crossjoin';
-
-VALUE : '$value';
-REF : '$ref';
-COUNT : '$count';
-
-//inlined query parameters ( e.g. $skip)
-TOP_I : '$top' -> type(TOP);
-SKIP_I : '$skip' -> type(SKIP);
-FILTER_I : '$filter' -> type(FILTER);
-ORDERBY_I: '$orderby' -> type(ORDERBY);
-SELECT_I: '$select' -> type(SELECT);
-EXPAND_I: '$expand' -> type(EXPAND);
-LEVELS_I: '$levels' -> type(LEVELS);
-MAX: 'max';
-
-ROOT : '$root/';
-
-
-
-//rest
-NULLVALUE : 'null';
-
-TRUE : 'true';
-FALSE : 'false';
-BOOLEAN : T R U E | F A L S E;
-PLUS : '+';
-SIGN : PLUS | '%2B' |'-';
-INT : SIGN? DIGITS;
-DECIMAL : INT '.' DIGITS (('e'|'E') SIGN? DIGITS)?;
-NANINFINITY : 'NaN' | '-INF' | 'INF';
-//primary types
-BINARY : B I N A R Y SQUOTE (HEXDIG HEXDIG)* SQUOTE;
-DATE : YEAR '-' MONTH '-' DAY;
-DATETIMEOFFSET : YEAR '-' MONTH '-' DAY T HOUR ':' MINUTE ( ':' SECOND ( '.' FRACTIONALSECONDS )? )? ( Z | SIGN HOUR ':' MINUTE );
-fragment DUSECONDFRAG : DIGITS ('.' DIGITS)? 'S';
-fragment DUTIMEFRAG : 'T' (
- ( DIGITS 'H' (DIGITS 'M')? DUSECONDFRAG?)
- | (DIGITS 'M' DUSECONDFRAG?)
- | DUSECONDFRAG
- );
-fragment DUDAYTIMEFRAG : DIGITS 'D' DUTIMEFRAG? | DUTIMEFRAG;
-DURATION : D U R A T I O N SQUOTE '-'? 'P' DUDAYTIMEFRAG SQUOTE;
-TIMEOFDAY : HOUR ':' MINUTE ( ':' SECOND ( '.' FRACTIONALSECONDS )? )?;
-fragment GUIDVALUE : HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG'-'
- HEXDIG HEXDIG HEXDIG HEXDIG '-'
- HEXDIG HEXDIG HEXDIG HEXDIG '-'
- HEXDIG HEXDIG HEXDIG HEXDIG '-'
- HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG;
-GUID : GUIDVALUE;
-
-//expression tokens
-ASC : 'asc';
-DESC : 'desc';
-MUL : 'mul';
-DIV : 'div';
-MOD : 'mod';
-HAS : 'has';
-
-ADD : 'add';
-SUB : 'sub';
-
-ANY_LAMDA : 'any';
-ALL_LAMDA : 'all';
-
-GT : 'gt';
-GE : 'ge';
-LT : 'lt';
-LE : 'le';
-ISOF : 'isof';
-
-EQ_ALPHA : 'eq';
-NE : 'ne';
-
-AND : 'and';
-OR : 'or';
-
-
-NOT : 'not';
-MINUS :'-';
-
-IT : '$it';
-ITSLASH : '$it/';
-LEVELS : '$levels';
-
-CONTAINS_WORD : 'contains(';
-STARTSWITH_WORD : 'startswith(';
-ENDSWITH_WORD : 'endswith(';
-LENGTH_WORD : 'length(';
-INDEXOF_WORD : 'indexof(';
-SUBSTRING_WORD : 'substring(';
-TOLOWER_WORD : 'tolower(';
-TOUPPER_WORD : 'toupper(';
-TRIM_WORD : 'trim(';
-CONCAT_WORD : 'concat(';
-YEAR_WORD : 'year(';
-MONTH_WORD : 'month(';
-DAY_WORD : 'day(';
-HOUR_WORD : 'hour(';
-MINUTE_WORD : 'minute(';
-SECOND_WORD : 'second(';
-FRACTIONALSECONDS_WORD : 'fractionalseconds(';
-TOTALSECONDS_WORD : 'totalseconds(';
-DATE_WORD : 'date(';
-TIME_WORD : 'time(';
-TOTALOFFSETMINUTES_WORD : 'totaloffsetminutes(';
-
-MINDATETIME_WORD : 'mindatetime(';
-MAXDATETIME_WORD : 'maxdatetime(';
-NOW_WORD : 'now(';
-
-ROUND_WORD : 'round(';
-FLOOR_WORD : 'floor(';
-CEILING_WORD : 'ceiling(';
-
-GEO_DISTANCE_WORD : 'geo.distance(';
-GEO_LENGTH_WORD : 'geo.length(';
-GEO_INTERSECTS_WORD : 'geo.intersects(';
-ISOF_WORD : 'isof(';
-CAST_WORD : 'cast(';
-
-COLLECTION_REF : 'Collection($ref)';
-COLLECTION_ENTITY_TYPE : 'Collection(Edm.EntityType)';
-COLLECTION_COMPLEX_TYPE : 'Collection(Edm.ComplexType)';
-COLLECTION : 'Collection(' -> type(COLLECTION);
-
-//used in fragment only
-DELETED_ENTITY : '$deletedEntity';
-LINK : '$link';
-DELETED_LINK : '$deletedLink';
-DELTA : '$delta';
-
-//ODI
-ODATAIDENTIFIER : ODI_LEADINGCHARACTER (ODI_CHARACTER)*;
-
-//;==============================================================================
-// Mode "QUERY": Processes everything between the first '?' and the '#' char
-// On '?' the next mode "FRAGMENT" is used
-// The percent encoding rules a defined in RFC3986 ABNF rule "query" apply
-mode MODE_QUERY;
-//;==============================================================================
-
-FRAGMENT_q : '#' -> type(FRAGMENT);
-FILTER : '$filter' -> pushMode(DEFAULT_MODE);
-ORDERBY : '$orderby' -> pushMode(DEFAULT_MODE);
-EXPAND : '$expand' -> pushMode(DEFAULT_MODE);
-SELECT : '$select' -> pushMode(DEFAULT_MODE);
-SKIP : '$skip' -> pushMode(DEFAULT_MODE);
-SKIPTOKEN : '$skiptoken' -> pushMode(MODE_SYSTEM_QUERY_REST);
-TOP : '$top' -> pushMode(DEFAULT_MODE);
-LEVELS_q : '$levels' -> type(LEVELS), pushMode(DEFAULT_MODE);
-FORMAT : '$format' -> pushMode(MODE_SYSTEM_QUERY_PCHAR);
-COUNT_q : '$count' -> type(COUNT), pushMode(DEFAULT_MODE);
-REF_q : '$ref' -> type(REF);
-VALUE_q : '$value' -> type(VALUE);
-ID : '$id' -> pushMode(MODE_SYSTEM_QUERY_REST);
-SEARCH : '$search' -> pushMode(MODE_SYSTEM_QUERY_SEARCH);
-
-EQ_q : '=' -> type(EQ);
-AMP_q : '&' -> type(AMP);
-
-AT_Q : '@' -> pushMode(DEFAULT_MODE);
-
-CUSTOMNAME : ~[&=@$] ~[&=]* -> pushMode(MODE_SYSTEM_QUERY_REST);
-
-//;==============================================================================
-mode MODE_SYSTEM_QUERY_PCHAR;
-//;==============================================================================
-
-AMP_sqp : '&' -> type(AMP), popMode;
-
-fragment ALPHA_sqp : 'a'..'z'|'A'..'Z';
-fragment A_TO_F_sqp : 'a'..'f'|'A'..'F';
-fragment DIGIT_sqp : '0'..'9';
-fragment HEXDIG_sqp : DIGIT_sqp | A_TO_F_sqp;
-fragment PCT_ENCODED_sqp : '%' HEXDIG_sqp HEXDIG_sqp;
-fragment SUB_DELIMS_sqp : '$' | /*'&' |*/ '\'' | EQ_sqp | OTHER_DELIMS_sqp;
-fragment OTHER_DELIMS_sqp : '!' | '(' | ')' | '*' | '+' | ',' | ';';
-fragment UNRESERVED_sqp : ALPHA_sqp | DIGIT_sqp | '-' |'.' | '_' | '~';
-fragment PCHAR : UNRESERVED_sqp | PCT_ENCODED_sqp | SUB_DELIMS_sqp | ':' | '@';
-fragment PCHARSTART : UNRESERVED_sqp | PCT_ENCODED_sqp | '$' | /*'&' |*/ '\'' | OTHER_DELIMS_sqp | ':' | '@';
-
-
-ATOM : [Aa][Tt][Oo][Mm];
-JSON : [Jj][Ss][Oo][Nn];
-XML : [Xx][Mm][Ll];
-
-PCHARS : PCHARSTART PCHAR*;
-
-
-SLASH_sqp : '/' -> type(SLASH);
-EQ_sqp : '=' -> type(EQ);
-FRAGMENT_sqp : '#' -> type(FRAGMENT), pushMode(MODE_FRAGMENT);
-
-//;==============================================================================
-mode MODE_FRAGMENT;
-// Read the remaining characters of a URI queryparameter up to an & or #
-// character.
-//;==============================================================================
-
-REST_F : ~('\r'|'\n')* -> type(REST), popMode;
-
-//;==============================================================================
-mode MODE_SYSTEM_QUERY_REST;
-// Read the remaining characters of a URI queryparameter up to an & or #
-// character.
-//;==============================================================================
-
-AMP_sqr : '&' -> type(AMP), popMode;
-FRAGMENT_sqr : '#' -> type(FRAGMENT), popMode;
-
-EQ_sqr : '=' -> type(EQ);
-REST : ~[&#=] ~[&#]*;
-
-//;==============================================================================
-mode MODE_SYSTEM_QUERY_SEARCH;
-//;==============================================================================
-
-NOT_sqc : 'NOT' -> type(NOT);
-AND_sqc : 'AND' -> type(AND);
-OR_sqc : 'OR' -> type(OR);
-EQ_sqc : '=' -> type(EQ);
-
-fragment WS_sqc : ( ' ' | '\u0009' | '%20' | '%09' );
-WSP_sqc : WS_sqc+ -> type(WSP);
-
-QUOTATION_MARK_sqc : '\u0022' | '%22';
-
-SEARCHWORD : ('a'..'z'|'A'..'Z')+;
-SEARCHPHRASE : QUOTATION_MARK_sqc ~["]* QUOTATION_MARK_sqc -> popMode;
-
-
-//;==============================================================================
-mode MODE_STRING;
-// Read the remaining characters up to an ' character.
-// An "'" character inside a string are expressed as double ''
-//;==============================================================================
-
-STRING_s : ('\'\'' | ~[\u0027] )* '\'' -> type(STRING), popMode;
-
-//;==============================================================================
-mode MODE_JSON_STRING;
-// Read the remaining characters up to an " character.
-// An "'" character inside a string are expressed excaped \"
-//;==============================================================================
-
-STRING_IN_JSON : ('\\"' | ~[\u0022] )* ('"' | '%22') -> popMode;
-
-//;==============================================================================
-mode MODE_ODATA_GEO;
-//;==============================================================================
-
-fragment C_ : 'c'|'C';
-fragment D_ : 'd'|'D';
-fragment E_ : 'e'|'E';
-fragment G_ : 'g'|'G';
-fragment H_ : 'h'|'H';
-fragment I_ : 'i'|'I';
-fragment L_ : 'l'|'L';
-fragment M_ : 'm'|'M';
-fragment N_ : 'n'|'N';
-fragment O_ : 'o'|'O';
-fragment P_ : 'p'|'P';
-fragment R_ : 'r'|'R';
-fragment S_ : 's'|'S';
-fragment T_ : 't'|'T';
-fragment U_ : 'u'|'U';
-fragment Y_ : 'y'|'Y';
-
-fragment SP_g : ' ';//'\u0020'; // a simple space
-fragment WS_g : ( ' ' | '%20' | '%09' );
-
-OPEN_g : ('(' | '%28') -> type(OPEN);
-CLOSE_g : (')' | '%29') -> type(CLOSE);
-COMMA_g : (',' | '%2C') -> type(COMMA);
-WSP_g : WS_g+ -> type(WSP);
-POINT_g : '.' -> type(POINT);
-AT_g : '@' -> type(AT);
-SEMI_g : (';' | '%3B') -> type(SEMI);
-EQ_g : '=' -> type(EQ);
-
-fragment DIGIT_g : '0'..'9';
-fragment DIGITS_g : DIGIT_g+;
-SIGN_g : ('+' | '%2B' |'-') -> type(SIGN);
-INT_g : SIGN_g? DIGITS_g -> type(INT);
-DECIMAL_g : 'SS' INT_g '.' DIGITS_g (('e'|'E') SIGN_g? DIGITS_g)? -> type(DECIMAL);
-COLLECTION_g : C_ O_ L_ L_ E_ C_ T_ I_ O_ N_ -> type(COLLECTION);
-LINESTRING : L_ I_ N_ E_ S_ T_ R_ I_ N_ G_ ;
-MULTILINESTRING : M_ U_ L_ T_ I_ L_ I_ N_ E_ S_ T_ R_ I_ N_ G_;
-MULTIPOINT : M_ U_ L_ T_ I_ P_ O_ I_ N_ T_ ;
-MULTIPOLYGON : M_ U_ L_ T_ I_ P_ O_ L_ Y_ G_ O_ N_;
-GEO_POINT : P_ O_ I_ N_ T_;
-POLYGON : P_ O_ L_ Y_ G_ O_ N_ ;
-
-SRID : S_ R_ I_ D_;
-
-SQUOTE : '\'' -> popMode;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriParser.g4
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriParser.g4 b/lib/server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriParser.g4
deleted file mode 100644
index 3c36782..0000000
--- a/lib/server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriParser.g4
+++ /dev/null
@@ -1,439 +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.
- ******************************************************************************/
-
-grammar UriParser;
-
-//------------------------------------------------------------------------------
-// This grammer refers to the "odata-abnf-construction-rules.txt" Revision 517.
-// URL: https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/ABNF/odata-abnf-construction-rules.txt?rev=517
-
-// While contructing this grammer we tried to keep it close to the ABNF. However this is not really possible
-// in order to support
-// - percent decoding
-// - operator precedence
-// - have context free grammar ( without out java snipples to add context)
-// - generate the parser in diffend target languages
-// Currently not supported
-// - $search
-// - geometry data
-// - json data in url
-//------------------------------------------------------------------------------
-
-
-options {
- language = Java;
- tokenVocab = UriLexer;
-}
-
-//;------------------------------------------------------------------------------
-//; 0. URI
-//;------------------------------------------------------------------------------
-
-batchEOF : BATCH EOF;
-
-entityEOF : vNS=namespace vODI=odataIdentifier;
-
-metadataEOF : METADATA EOF;
-
-//;------------------------------------------------------------------------------
-//; 1. Resource Path
-//;------------------------------------------------------------------------------
-
-//resourcePathEOF : vlPS=pathSegments EOF;
-
-crossjoinEOF : CROSSJOIN OPEN WSP? vlODI+=odataIdentifier WSP? ( COMMA WSP? vlODI+=odataIdentifier WSP?)* CLOSE EOF;
-
-allEOF : ALL;
-
-pathSegmentEOF : (pathSegment | constSegment) EOF;
-
-pathSegments : vlPS+=pathSegment (SLASH vlPS+=pathSegment)* (SLASH vCS=constSegment)?;
-
-pathSegment : vNS=namespace? vODI=odataIdentifier vlNVO+=nameValueOptList*;
-
-nameValueOptList : OPEN (vVO=commonExpr | vNVL=nameValueList)? CLOSE;
-nameValueList : WSP* vlNVP+=nameValuePair WSP* ( COMMA WSP* vlNVP+=nameValuePair WSP*)* ;
-nameValuePair : vODI=odataIdentifier EQ (AT vALI=odataIdentifier | vCOM=commonExpr /*TODO | val2=enumX*/);
-
-constSegment : (vV=value | vC=count | vR=ref | vAll=allExpr | vAny=anyExpr);
-
-count : COUNT;
-ref : REF;
-value : VALUE;
-
-//;------------------------------------------------------------------------------
-//; 2. Query Options
-//;------------------------------------------------------------------------------
-
-queryOptions : vlQO+=queryOption ( AMP vlQO+=queryOption )*;//TODO can this be removed
-
-queryOption : systemQueryOption;
-
-systemQueryOption : expand
- | filter
- | inlinecount
- | orderBy
- | search
- | select
- | skip
- | skiptoken
- | top
- ;
-
-skiptoken : SKIPTOKEN EQ REST;
-expand : EXPAND EQ expandItems;
-
-expandItemsEOF : expandItems EOF;
-expandItems : vlEI+=expandItem ( COMMA vlEI+=expandItem )*;
-
-
-expandItem : vS=STAR ( SLASH vR=ref | OPEN LEVELS EQ ( vL=INT | vM=MAX) CLOSE )?
- | vEP=expandPath vEPE=expandPathExtension?;
-
-
-expandPath : vlPS+=pathSegment (SLASH vlPS+=pathSegment)*;
-
-expandPathExtension : OPEN vlEO+=expandOption ( SEMI vlEO+=expandOption )* CLOSE
- | SLASH vR=ref ( OPEN vlEOR+=expandRefOption ( SEMI vlEOR+=expandRefOption )* CLOSE )?
- | SLASH vC=count ( OPEN vlEOC+=expandCountOption ( SEMI vlEOC+=expandCountOption )* CLOSE )?
- ;
-
-expandCountOption : filter
- | search
- ;
-
-expandRefOption : expandCountOption
- | orderBy
- | skip
- | top
- | inlinecount
- ;
-
-expandOption : expandRefOption
- | select
- | expand
- | levels;
-
-levels : LEVELS EQ ( INT | MAX );
-
-filter : FILTER EQ commonExpr;
-
-filterExpressionEOF : commonExpr EOF;
-
-orderBy : ORDERBY EQ orderList;
-
-orderByEOF : orderList EOF;
-
-orderList : vlOI+=orderByItem ( WSP* COMMA WSP* vlOI+=orderByItem )*;
-
-orderByItem : vC=commonExpr ( WSP ( vA=ASC | vD=DESC ) )?;
-
-skip : SKIP EQ INT;
-top : TOP EQ INT;
-//format : FORMAT EQ ( ATOM | JSON | XML | PCHARS ( SLASH PCHARS)?);
-
-inlinecount : COUNT EQ booleanNonCase;
-
-search : SEARCH searchSpecialToken;
-searchInline : SEARCH_INLINE searchSpecialToken;
-
-searchSpecialToken : EQ WSP? searchExpr;
-
-searchExpr : (NOT WSP) searchExpr
- | searchExpr searchExpr
- | searchExpr WSP searchExpr
- | searchExpr ( WSP AND WSP) searchExpr
- | searchExpr ( WSP OR WSP) searchExpr
- | searchPhrase
- | searchWord
- ;
-
-searchPhrase : SEARCHPHRASE;
-searchWord : SEARCHWORD;
-
-select : SELECT EQ vlSI+=selectItem ( COMMA vlSI+=selectItem )*;
-selectEOF : vlSI+=selectItem ( COMMA vlSI+=selectItem )*;
-
-selectItem : vlSS+=selectSegment ( SLASH vlSS+=selectSegment ) *;
-selectSegment : vNS=namespace? ( vODI=odataIdentifier | vS=STAR );
-
-aliasAndValue : vODI=ODATAIDENTIFIER EQ vV=parameterValue;
-
-parameterValue : commonExpr //TODO json not supported arrayOrObject
- ;
-
-//;------------------------------------------------------------------------------
-//; 3. Context URL Fragments
-//;------------------------------------------------------------------------------
-
-contextFragment : REST; // the context fragment is only required on the client side
-
-//;------------------------------------------------------------------------------
-//; 4. Expressions
-//;------------------------------------------------------------------------------
-
-commonExpr : OPEN commonExpr CLOSE #altPharenthesis
- | vE1=commonExpr (WSP HAS WSP) vE2=commonExpr #altHas
- | methodCallExpr #altMethod
- | ( unary WSP ) commonExpr #altUnary
- | anyExpr #altAny
- | allExpr #altAll
- | memberExpr #altMember
- | vE1=commonExpr (WSP vO=MUL WSP | WSP vO=DIV WSP | WSP vO=MOD WSP ) vE2=commonExpr #altMult
- | vE1=commonExpr (WSP vO=ADD WSP | WSP vO=SUB WSP) vE2=commonExpr #altAdd
- | vE1=commonExpr (WSP vO=GT WSP | WSP vO=GE WSP | WSP vO=LT WSP
- | WSP vO=LE WSP ) vE2=commonExpr #altComparism
- | vE1=commonExpr (WSP vO=EQ_ALPHA WSP | WSP vO=NE WSP) vE2=commonExpr #altEquality
- | vE1=commonExpr (WSP AND WSP) vE2=commonExpr #altAnd
- | vE1=commonExpr (WSP OR WSP) vE2=commonExpr #altOr
- | rootExpr #altRoot // $...
- | AT odataIdentifier #altAlias // @...
- | primitiveLiteral #altLiteral // ...
- ;
-
-unary : (MINUS| NOT) ;
-
-rootExpr : ROOT vPs=pathSegments;
-
-memberExpr : vIt=IT ( SLASH (vANY=anyExpr | vALL=allExpr))?
- | vIts=ITSLASH? vPs=pathSegments ( SLASH (vANY=anyExpr | vALL=allExpr))?;
-
-anyExpr : ANY_LAMDA OPEN WSP? ( vLV=odataIdentifier WSP? COLON WSP? vLE=commonExpr WSP? )? CLOSE;
-allExpr : ALL_LAMDA OPEN WSP? vLV=odataIdentifier WSP? COLON WSP? vLE=commonExpr WSP? CLOSE;
-
-methodCallExpr : indexOfMethodCallExpr
- | toLowerMethodCallExpr
- | toUpperMethodCallExpr
- | trimMethodCallExpr
- | substringMethodCallExpr
- | concatMethodCallExpr
- | lengthMethodCallExpr
- | yearMethodCallExpr
- | monthMethodCallExpr
- | dayMethodCallExpr
- | hourMethodCallExpr
- | minuteMethodCallExpr
- | secondMethodCallExpr
- | fractionalsecondsMethodCallExpr
- | totalsecondsMethodCallExpr
- | dateMethodCallExpr
- | timeMethodCallExpr
- | roundMethodCallExpr
- | floorMethodCallExpr
- | ceilingMethodCallExpr
- | geoDistanceMethodCallExpr
- | geoLengthMethodCallExpr
- | totalOffsetMinutesMethodCallExpr
- | minDateTimeMethodCallExpr
- | maxDateTimeMethodCallExpr
- | nowMethodCallExpr
- //from boolean
- | isofExpr
- | castExpr
- | endsWithMethodCallExpr
- | startsWithMethodCallExpr
- | containsMethodCallExpr
- | geoIntersectsMethodCallExpr
- ;
-
-
-containsMethodCallExpr : CONTAINS_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-startsWithMethodCallExpr : STARTSWITH_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-endsWithMethodCallExpr : ENDSWITH_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-lengthMethodCallExpr : LENGTH_WORD WSP? vE1=commonExpr WSP? CLOSE;
-indexOfMethodCallExpr : INDEXOF_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-substringMethodCallExpr : SUBSTRING_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? ( COMMA WSP? vE3=commonExpr WSP? )? CLOSE;
-toLowerMethodCallExpr : TOLOWER_WORD WSP? vE1=commonExpr WSP? CLOSE;
-toUpperMethodCallExpr : TOUPPER_WORD WSP? vE1=commonExpr WSP? CLOSE;
-trimMethodCallExpr : TRIM_WORD WSP? vE1=commonExpr WSP? CLOSE;
-concatMethodCallExpr : CONCAT_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-
-yearMethodCallExpr : YEAR_WORD WSP? vE1=commonExpr WSP? CLOSE;
-monthMethodCallExpr : MONTH_WORD WSP? vE1=commonExpr WSP? CLOSE;
-dayMethodCallExpr : DAY_WORD WSP? vE1=commonExpr WSP? CLOSE;
-hourMethodCallExpr : HOUR_WORD WSP? vE1=commonExpr WSP? CLOSE;
-minuteMethodCallExpr : MINUTE_WORD WSP? vE1=commonExpr WSP? CLOSE;
-secondMethodCallExpr : SECOND_WORD WSP? vE1=commonExpr WSP? CLOSE;
-fractionalsecondsMethodCallExpr : FRACTIONALSECONDS_WORD WSP? vE1=commonExpr WSP? CLOSE;
-totalsecondsMethodCallExpr : TOTALSECONDS_WORD WSP? vE1=commonExpr WSP? CLOSE;
-dateMethodCallExpr : DATE_WORD WSP? vE1=commonExpr WSP? CLOSE;
-timeMethodCallExpr : TIME_WORD WSP? vE1=commonExpr WSP? CLOSE;
-totalOffsetMinutesMethodCallExpr : TOTALOFFSETMINUTES_WORD WSP? vE1=commonExpr WSP? CLOSE;
-
-minDateTimeMethodCallExpr : MINDATETIME_WORD WSP? CLOSE;
-maxDateTimeMethodCallExpr : MAXDATETIME_WORD WSP? CLOSE;
-nowMethodCallExpr : NOW_WORD WSP? CLOSE;
-
-roundMethodCallExpr : ROUND_WORD WSP? vE1=commonExpr WSP? CLOSE;
-floorMethodCallExpr : FLOOR_WORD WSP? vE1=commonExpr WSP? CLOSE;
-ceilingMethodCallExpr : CEILING_WORD WSP? vE1=commonExpr WSP? CLOSE;
-
-geoDistanceMethodCallExpr : GEO_DISTANCE_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-geoLengthMethodCallExpr : GEO_LENGTH_WORD WSP? vE1=commonExpr WSP? CLOSE;
-geoIntersectsMethodCallExpr : GEO_INTERSECTS_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
-
-isofExpr : ISOF_WORD WSP? ( vE1=commonExpr WSP? COMMA WSP? )? vNS=namespace vODI=odataIdentifier WSP? CLOSE;
-castExpr : CAST_WORD WSP? ( vE1=commonExpr WSP? COMMA WSP? )? vNS=namespace vODI=odataIdentifier WSP? CLOSE;
-
-//;------------------------------------------------------------------------------
-//; 5. JSON format for function parameters
-//;------------------------------------------------------------------------------
-//; Note: the query part of a URI needs to be partially percent-decoded before
-//; applying these rules, see comment at the top of this file
-//;------------------------------------------------------------------------------
-
-arrayOrObject : json_array
- | json_object;
-
-json_array : BEGIN_ARRAY json_value ( WSP? COMMA WSP? json_value)* END_ARRAY;
-
-json_value : jsonPrimitiv
- | rootExpr
- | json_object
- | json_array;
-
-json_object : BEGIN_OBJECT
- STRING_IN_JSON
- WSP? COLON WSP?
- json_value
- END_OBJECT;
-
-
-//; JSON syntax: adapted to URI restrictions from [RFC4627]
-jsonPrimitiv : STRING_IN_JSON
- | number_in_json
- | TRUE
- | FALSE
- | 'null'
- ;
-
-number_in_json : INT | DECIMAL;
-
-//;------------------------------------------------------------------------------
-//; 6. Names and identifiers
-//;------------------------------------------------------------------------------
-
-qualifiedtypename : namespace odataIdentifier
- | 'collection' OPEN ( namespace odataIdentifier ) CLOSE
- ;
-
-namespace : (odataIdentifier POINT)+;
-
-odataIdentifier : ODATAIDENTIFIER;
-
-//;------------------------------------------------------------------------------
-//; 7. Literal Data Values
-//;------------------------------------------------------------------------------
-
-
-primitiveLiteral : nullrule
- | booleanNonCase
- | DECIMAL //includes double and single literals
- | naninfinity
- | INT //includes int16/int32 and int64 literals
- | BINARY
- | DATE
- | DATETIMEOFFSET
- | DURATION
- | GUID
- | string
- | TIMEOFDAY
- | enumLit
- | geographyCollection
- | geographyLineString
- | geographyMultilineString
- | geographyMultipoint
- | geographyMultipolygon
- | geographyPoint
- | geographyPolygon
- | geometryCollection
- | geometryLineString
- | geometryMultilineString
- | geometryMultipoint
- | geometryMultipolygon
- | geometryPoint
- | geometryPolygon
- ;
-
-naninfinity : NANINFINITY;
-
-nullrule : NULLVALUE;
-booleanNonCase : BOOLEAN | TRUE | FALSE;
-string : STRING;
-
-enumLit : vNS=namespace vODI=odataIdentifier vValues=STRING;
-enumValues : vlODI+=odataIdentifier ( COMMA vlODI+=odataIdentifier )*;
-
-geographyCollection : GEOGRAPHY fullCollectionLiteral SQUOTE;
-fullCollectionLiteral : sridLiteral collectionLiteral;
-
-collectionLiteral : (COLLECTION ) OPEN geoLiteral ( COMMA geoLiteral )* CLOSE;
-
-geoLiteral : collectionLiteral
- | lineStringLiteral
- | multipointLiteral
- | multilineStringLiteral
- | multipolygonLiteral
- | pointLiteral
- | polygonLiteral;
-
-geographyLineString : GEOGRAPHY fullLineStringLiteral SQUOTE;
-fullLineStringLiteral : sridLiteral lineStringLiteral;
-lineStringLiteral : LINESTRING lineStringData;
-lineStringData : OPEN positionLiteral ( COMMA positionLiteral )* CLOSE;
-
-geographyMultilineString : GEOGRAPHY fullMultilineStringLiteral SQUOTE;
-fullMultilineStringLiteral : sridLiteral multilineStringLiteral;
-multilineStringLiteral : MULTILINESTRING OPEN ( lineStringData ( COMMA lineStringData )* )? CLOSE;
-
-geographyMultipoint : GEOGRAPHY fullMultipointLiteral SQUOTE;
-fullMultipointLiteral : sridLiteral multipointLiteral;
-multipointLiteral : MULTIPOINT OPEN ( pointData ( COMMA pointData )* )? CLOSE ;
-
-geographyMultipolygon : GEOGRAPHY fullmultipolygonLiteral SQUOTE;
-fullmultipolygonLiteral : sridLiteral multipolygonLiteral;
-multipolygonLiteral : MULTIPOLYGON OPEN ( polygonData ( COMMA polygonData )* )? CLOSE;
-
-geographyPoint : GEOGRAPHY fullpointLiteral SQUOTE;
-fullpointLiteral : sridLiteral pointLiteral;
-
-pointLiteral : GEO_POINT pointData;
-pointData : OPEN positionLiteral CLOSE;
-
-positionLiteral : (DECIMAL | INT ) WSP (DECIMAL | INT ); //; longitude, then latitude
-
-
-geographyPolygon : GEOGRAPHY fullPolygonLiteral SQUOTE;
-fullPolygonLiteral : sridLiteral polygonLiteral;
-polygonLiteral : POLYGON polygonData;
-polygonData : OPEN ringLiteral ( COMMA ringLiteral )* CLOSE;
-ringLiteral : OPEN positionLiteral ( COMMA positionLiteral )* CLOSE;
-
-
-geometryCollection : GEOMETRY fullCollectionLiteral SQUOTE;
-geometryLineString : GEOMETRY fullLineStringLiteral SQUOTE;
-geometryMultilineString : GEOMETRY fullMultilineStringLiteral SQUOTE;
-geometryMultipoint : GEOMETRY fullMultipointLiteral SQUOTE;
-geometryMultipolygon : GEOMETRY fullmultipolygonLiteral SQUOTE;
-geometryPoint : GEOMETRY fullpointLiteral SQUOTE;
-geometryPolygon : GEOMETRY fullPolygonLiteral SQUOTE;
-
-sridLiteral : SRID EQ INT SEMI;
-
-
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriLexer.g4
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriLexer.g4 b/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriLexer.g4
new file mode 100644
index 0000000..eee6486
--- /dev/null
+++ b/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriLexer.g4
@@ -0,0 +1,404 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+lexer grammar UriLexer;
+
+//;==============================================================================
+// Mode "DEFAULT_MODE": Processes everything bevor the first '?' char
+// On '?' the next mode "MODE_QUERY" is used
+// The percent encoding rules a defined in RFC3986 ABNF rule "path-rootless" apply
+//;==============================================================================
+QM : '?' -> pushMode(MODE_QUERY); //first query parameter
+AMP : '&' -> pushMode(MODE_QUERY); //more query parameters
+STRING : '\'' -> more, pushMode(MODE_STRING); //reads up to next single '
+QUOTATION_MARK : ('\u0022' | '%22') -> more, pushMode(MODE_JSON_STRING); //reads up to next unescaped "
+SEARCH_INLINE : '$search' -> pushMode(MODE_SYSTEM_QUERY_SEARCH); //
+FRAGMENT : '#' -> pushMode(MODE_FRAGMENT); //
+
+GEOGRAPHY : G E O G R A P H Y SQUOTE -> pushMode(MODE_ODATA_GEO); //TODO make case insensitive
+GEOMETRY : G E O M E T R Y SQUOTE -> pushMode(MODE_ODATA_GEO);
+
+//Letters for case insensitivity
+fragment A : 'A'|'a';
+fragment B : 'B'|'b';
+fragment D : 'D'|'d';
+fragment E : 'E'|'e';
+fragment F : 'F'|'f';
+fragment G : 'G'|'g';
+fragment H : 'H'|'h';
+fragment I : 'I'|'i';
+fragment L : 'L'|'l';
+fragment M : 'M'|'m';
+fragment N : 'N'|'n';
+fragment O : 'O'|'o';
+fragment P : 'P'|'p';
+fragment R : 'R'|'r';
+fragment S : 'S'|'s';
+fragment T : 'T'|'t';
+fragment U : 'U'|'u';
+fragment Y : 'Y'|'y';
+fragment Z : 'Z'|'z';
+
+//special chars
+OPEN : '(' | '%28';
+CLOSE : ')' | '%29';
+COMMA : ',' | '%2C';
+SLASH : '/';
+POINT : '.';
+AT : '@';
+EQ : '=' ;
+STAR : '*';
+SEMI : ';' | '%3b';
+COLON : ':';
+
+EQ_sq : '=' -> type(EQ);
+AMP_sq : '&' -> type(AMP), popMode;
+fragment WS : ( ' ' | '%09' | '%20' | '%09' );
+WSP : WS+;
+
+//JSON support
+BEGIN_OBJECT : WS* ( '{' / '%7B' ) WS*;
+END_OBJECT : WS* ( '}' / '%7D' ) WS*;
+
+BEGIN_ARRAY : WS* ( '[' / '%5B' ) WS*;
+END_ARRAY : WS* ( ']' / '%5D' ) WS*;
+
+
+//alpha stuff
+fragment ALPHA : 'a'..'z' | 'A'..'Z';
+fragment ALPHA_A_TO_F : 'a'..'f' | 'A'..'F';
+fragment DIGIT : '0'..'9';
+fragment DIGITS : DIGIT+;
+fragment HEXDIG : DIGIT | ALPHA_A_TO_F;
+fragment ODI_LEADINGCHARACTER : ALPHA | '_'; //TODO; add Unicode characters from the categories L or Nl
+fragment ODI_CHARACTER : ALPHA | '_' | DIGIT; //TODO; add Unicode characters from the categories L, Nl, Nd, Mn, Mc, Pc, or Cf
+
+//helper for date/time values
+fragment ONE_TO_NINE : '1'..'9';
+fragment ZERO_TO_FIFTYNINE : ('0'..'5') DIGIT;
+fragment FRACTIONALSECONDS : DIGIT+;
+fragment SECOND : ZERO_TO_FIFTYNINE;
+fragment MINUTE : ZERO_TO_FIFTYNINE;
+fragment HOUR : ('0' | '1') DIGIT | '2' ( '0'..'3');
+fragment DAY : '0' '1'..'9' | ('1'|'2') DIGIT | '3' ('0'|'1');
+fragment MONTH : '0' ONE_TO_NINE | '1' ( '0' | '1' | '2' );
+fragment YEAR : ('-')? ( '0' DIGIT DIGIT DIGIT | ONE_TO_NINE DIGIT DIGIT DIGIT );
+
+//tags start with $
+BATCH : '$batch';
+ENTITY : '$entity';
+METADATA : '$metadata';
+
+ALL : '$all';
+CROSSJOIN : '$crossjoin';
+
+VALUE : '$value';
+REF : '$ref';
+COUNT : '$count';
+
+//inlined query parameters ( e.g. $skip)
+TOP_I : '$top' -> type(TOP);
+SKIP_I : '$skip' -> type(SKIP);
+FILTER_I : '$filter' -> type(FILTER);
+ORDERBY_I: '$orderby' -> type(ORDERBY);
+SELECT_I: '$select' -> type(SELECT);
+EXPAND_I: '$expand' -> type(EXPAND);
+LEVELS_I: '$levels' -> type(LEVELS);
+MAX: 'max';
+
+ROOT : '$root/';
+
+
+
+//rest
+NULLVALUE : 'null';
+
+TRUE : 'true';
+FALSE : 'false';
+BOOLEAN : T R U E | F A L S E;
+PLUS : '+';
+SIGN : PLUS | '%2B' |'-';
+INT : SIGN? DIGITS;
+DECIMAL : INT '.' DIGITS (('e'|'E') SIGN? DIGITS)?;
+NANINFINITY : 'NaN' | '-INF' | 'INF';
+//primary types
+BINARY : B I N A R Y SQUOTE (HEXDIG HEXDIG)* SQUOTE;
+DATE : YEAR '-' MONTH '-' DAY;
+DATETIMEOFFSET : YEAR '-' MONTH '-' DAY T HOUR ':' MINUTE ( ':' SECOND ( '.' FRACTIONALSECONDS )? )? ( Z | SIGN HOUR ':' MINUTE );
+fragment DUSECONDFRAG : DIGITS ('.' DIGITS)? 'S';
+fragment DUTIMEFRAG : 'T' (
+ ( DIGITS 'H' (DIGITS 'M')? DUSECONDFRAG?)
+ | (DIGITS 'M' DUSECONDFRAG?)
+ | DUSECONDFRAG
+ );
+fragment DUDAYTIMEFRAG : DIGITS 'D' DUTIMEFRAG? | DUTIMEFRAG;
+DURATION : D U R A T I O N SQUOTE '-'? 'P' DUDAYTIMEFRAG SQUOTE;
+TIMEOFDAY : HOUR ':' MINUTE ( ':' SECOND ( '.' FRACTIONALSECONDS )? )?;
+fragment GUIDVALUE : HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG'-'
+ HEXDIG HEXDIG HEXDIG HEXDIG '-'
+ HEXDIG HEXDIG HEXDIG HEXDIG '-'
+ HEXDIG HEXDIG HEXDIG HEXDIG '-'
+ HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG HEXDIG;
+GUID : GUIDVALUE;
+
+//expression tokens
+ASC : 'asc';
+DESC : 'desc';
+MUL : 'mul';
+DIV : 'div';
+MOD : 'mod';
+HAS : 'has';
+
+ADD : 'add';
+SUB : 'sub';
+
+ANY_LAMDA : 'any';
+ALL_LAMDA : 'all';
+
+GT : 'gt';
+GE : 'ge';
+LT : 'lt';
+LE : 'le';
+ISOF : 'isof';
+
+EQ_ALPHA : 'eq';
+NE : 'ne';
+
+AND : 'and';
+OR : 'or';
+
+
+NOT : 'not';
+MINUS :'-';
+
+IT : '$it';
+ITSLASH : '$it/';
+LEVELS : '$levels';
+
+CONTAINS_WORD : 'contains(';
+STARTSWITH_WORD : 'startswith(';
+ENDSWITH_WORD : 'endswith(';
+LENGTH_WORD : 'length(';
+INDEXOF_WORD : 'indexof(';
+SUBSTRING_WORD : 'substring(';
+TOLOWER_WORD : 'tolower(';
+TOUPPER_WORD : 'toupper(';
+TRIM_WORD : 'trim(';
+CONCAT_WORD : 'concat(';
+YEAR_WORD : 'year(';
+MONTH_WORD : 'month(';
+DAY_WORD : 'day(';
+HOUR_WORD : 'hour(';
+MINUTE_WORD : 'minute(';
+SECOND_WORD : 'second(';
+FRACTIONALSECONDS_WORD : 'fractionalseconds(';
+TOTALSECONDS_WORD : 'totalseconds(';
+DATE_WORD : 'date(';
+TIME_WORD : 'time(';
+TOTALOFFSETMINUTES_WORD : 'totaloffsetminutes(';
+
+MINDATETIME_WORD : 'mindatetime(';
+MAXDATETIME_WORD : 'maxdatetime(';
+NOW_WORD : 'now(';
+
+ROUND_WORD : 'round(';
+FLOOR_WORD : 'floor(';
+CEILING_WORD : 'ceiling(';
+
+GEO_DISTANCE_WORD : 'geo.distance(';
+GEO_LENGTH_WORD : 'geo.length(';
+GEO_INTERSECTS_WORD : 'geo.intersects(';
+ISOF_WORD : 'isof(';
+CAST_WORD : 'cast(';
+
+COLLECTION_REF : 'Collection($ref)';
+COLLECTION_ENTITY_TYPE : 'Collection(Edm.EntityType)';
+COLLECTION_COMPLEX_TYPE : 'Collection(Edm.ComplexType)';
+COLLECTION : 'Collection(' -> type(COLLECTION);
+
+//used in fragment only
+DELETED_ENTITY : '$deletedEntity';
+LINK : '$link';
+DELETED_LINK : '$deletedLink';
+DELTA : '$delta';
+
+//ODI
+ODATAIDENTIFIER : ODI_LEADINGCHARACTER (ODI_CHARACTER)*;
+
+//;==============================================================================
+// Mode "QUERY": Processes everything between the first '?' and the '#' char
+// On '?' the next mode "FRAGMENT" is used
+// The percent encoding rules a defined in RFC3986 ABNF rule "query" apply
+mode MODE_QUERY;
+//;==============================================================================
+
+FRAGMENT_q : '#' -> type(FRAGMENT);
+FILTER : '$filter' -> pushMode(DEFAULT_MODE);
+ORDERBY : '$orderby' -> pushMode(DEFAULT_MODE);
+EXPAND : '$expand' -> pushMode(DEFAULT_MODE);
+SELECT : '$select' -> pushMode(DEFAULT_MODE);
+SKIP : '$skip' -> pushMode(DEFAULT_MODE);
+SKIPTOKEN : '$skiptoken' -> pushMode(MODE_SYSTEM_QUERY_REST);
+TOP : '$top' -> pushMode(DEFAULT_MODE);
+LEVELS_q : '$levels' -> type(LEVELS), pushMode(DEFAULT_MODE);
+FORMAT : '$format' -> pushMode(MODE_SYSTEM_QUERY_PCHAR);
+COUNT_q : '$count' -> type(COUNT), pushMode(DEFAULT_MODE);
+REF_q : '$ref' -> type(REF);
+VALUE_q : '$value' -> type(VALUE);
+ID : '$id' -> pushMode(MODE_SYSTEM_QUERY_REST);
+SEARCH : '$search' -> pushMode(MODE_SYSTEM_QUERY_SEARCH);
+
+EQ_q : '=' -> type(EQ);
+AMP_q : '&' -> type(AMP);
+
+AT_Q : '@' -> pushMode(DEFAULT_MODE);
+
+CUSTOMNAME : ~[&=@$] ~[&=]* -> pushMode(MODE_SYSTEM_QUERY_REST);
+
+//;==============================================================================
+mode MODE_SYSTEM_QUERY_PCHAR;
+//;==============================================================================
+
+AMP_sqp : '&' -> type(AMP), popMode;
+
+fragment ALPHA_sqp : 'a'..'z'|'A'..'Z';
+fragment A_TO_F_sqp : 'a'..'f'|'A'..'F';
+fragment DIGIT_sqp : '0'..'9';
+fragment HEXDIG_sqp : DIGIT_sqp | A_TO_F_sqp;
+fragment PCT_ENCODED_sqp : '%' HEXDIG_sqp HEXDIG_sqp;
+fragment SUB_DELIMS_sqp : '$' | /*'&' |*/ '\'' | EQ_sqp | OTHER_DELIMS_sqp;
+fragment OTHER_DELIMS_sqp : '!' | '(' | ')' | '*' | '+' | ',' | ';';
+fragment UNRESERVED_sqp : ALPHA_sqp | DIGIT_sqp | '-' |'.' | '_' | '~';
+fragment PCHAR : UNRESERVED_sqp | PCT_ENCODED_sqp | SUB_DELIMS_sqp | ':' | '@';
+fragment PCHARSTART : UNRESERVED_sqp | PCT_ENCODED_sqp | '$' | /*'&' |*/ '\'' | OTHER_DELIMS_sqp | ':' | '@';
+
+
+ATOM : [Aa][Tt][Oo][Mm];
+JSON : [Jj][Ss][Oo][Nn];
+XML : [Xx][Mm][Ll];
+
+PCHARS : PCHARSTART PCHAR*;
+
+
+SLASH_sqp : '/' -> type(SLASH);
+EQ_sqp : '=' -> type(EQ);
+FRAGMENT_sqp : '#' -> type(FRAGMENT), pushMode(MODE_FRAGMENT);
+
+//;==============================================================================
+mode MODE_FRAGMENT;
+// Read the remaining characters of a URI queryparameter up to an & or #
+// character.
+//;==============================================================================
+
+REST_F : ~('\r'|'\n')* -> type(REST), popMode;
+
+//;==============================================================================
+mode MODE_SYSTEM_QUERY_REST;
+// Read the remaining characters of a URI queryparameter up to an & or #
+// character.
+//;==============================================================================
+
+AMP_sqr : '&' -> type(AMP), popMode;
+FRAGMENT_sqr : '#' -> type(FRAGMENT), popMode;
+
+EQ_sqr : '=' -> type(EQ);
+REST : ~[&#=] ~[&#]*;
+
+//;==============================================================================
+mode MODE_SYSTEM_QUERY_SEARCH;
+//;==============================================================================
+
+NOT_sqc : 'NOT' -> type(NOT);
+AND_sqc : 'AND' -> type(AND);
+OR_sqc : 'OR' -> type(OR);
+EQ_sqc : '=' -> type(EQ);
+
+fragment WS_sqc : ( ' ' | '\u0009' | '%20' | '%09' );
+WSP_sqc : WS_sqc+ -> type(WSP);
+
+QUOTATION_MARK_sqc : '\u0022' | '%22';
+
+SEARCHWORD : ('a'..'z'|'A'..'Z')+;
+SEARCHPHRASE : QUOTATION_MARK_sqc ~["]* QUOTATION_MARK_sqc -> popMode;
+
+
+//;==============================================================================
+mode MODE_STRING;
+// Read the remaining characters up to an ' character.
+// An "'" character inside a string are expressed as double ''
+//;==============================================================================
+
+STRING_s : ('\'\'' | ~[\u0027] )* '\'' -> type(STRING), popMode;
+
+//;==============================================================================
+mode MODE_JSON_STRING;
+// Read the remaining characters up to an " character.
+// An "'" character inside a string are expressed excaped \"
+//;==============================================================================
+
+STRING_IN_JSON : ('\\"' | ~[\u0022] )* ('"' | '%22') -> popMode;
+
+//;==============================================================================
+mode MODE_ODATA_GEO;
+//;==============================================================================
+
+fragment C_ : 'c'|'C';
+fragment D_ : 'd'|'D';
+fragment E_ : 'e'|'E';
+fragment G_ : 'g'|'G';
+fragment H_ : 'h'|'H';
+fragment I_ : 'i'|'I';
+fragment L_ : 'l'|'L';
+fragment M_ : 'm'|'M';
+fragment N_ : 'n'|'N';
+fragment O_ : 'o'|'O';
+fragment P_ : 'p'|'P';
+fragment R_ : 'r'|'R';
+fragment S_ : 's'|'S';
+fragment T_ : 't'|'T';
+fragment U_ : 'u'|'U';
+fragment Y_ : 'y'|'Y';
+
+fragment SP_g : ' ';//'\u0020'; // a simple space
+fragment WS_g : ( ' ' | '%20' | '%09' );
+
+OPEN_g : ('(' | '%28') -> type(OPEN);
+CLOSE_g : (')' | '%29') -> type(CLOSE);
+COMMA_g : (',' | '%2C') -> type(COMMA);
+WSP_g : WS_g+ -> type(WSP);
+POINT_g : '.' -> type(POINT);
+AT_g : '@' -> type(AT);
+SEMI_g : (';' | '%3B') -> type(SEMI);
+EQ_g : '=' -> type(EQ);
+
+fragment DIGIT_g : '0'..'9';
+fragment DIGITS_g : DIGIT_g+;
+SIGN_g : ('+' | '%2B' |'-') -> type(SIGN);
+INT_g : SIGN_g? DIGITS_g -> type(INT);
+DECIMAL_g : 'SS' INT_g '.' DIGITS_g (('e'|'E') SIGN_g? DIGITS_g)? -> type(DECIMAL);
+COLLECTION_g : C_ O_ L_ L_ E_ C_ T_ I_ O_ N_ -> type(COLLECTION);
+LINESTRING : L_ I_ N_ E_ S_ T_ R_ I_ N_ G_ ;
+MULTILINESTRING : M_ U_ L_ T_ I_ L_ I_ N_ E_ S_ T_ R_ I_ N_ G_;
+MULTIPOINT : M_ U_ L_ T_ I_ P_ O_ I_ N_ T_ ;
+MULTIPOLYGON : M_ U_ L_ T_ I_ P_ O_ L_ Y_ G_ O_ N_;
+GEO_POINT : P_ O_ I_ N_ T_;
+POLYGON : P_ O_ L_ Y_ G_ O_ N_ ;
+
+SRID : S_ R_ I_ D_;
+
+SQUOTE : '\'' -> popMode;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4 b/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4
new file mode 100644
index 0000000..3c36782
--- /dev/null
+++ b/lib/server-core/src/main/antlr4/org/apache/olingo/server/core/uri/antlr/UriParser.g4
@@ -0,0 +1,439 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+
+grammar UriParser;
+
+//------------------------------------------------------------------------------
+// This grammer refers to the "odata-abnf-construction-rules.txt" Revision 517.
+// URL: https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/ABNF/odata-abnf-construction-rules.txt?rev=517
+
+// While contructing this grammer we tried to keep it close to the ABNF. However this is not really possible
+// in order to support
+// - percent decoding
+// - operator precedence
+// - have context free grammar ( without out java snipples to add context)
+// - generate the parser in diffend target languages
+// Currently not supported
+// - $search
+// - geometry data
+// - json data in url
+//------------------------------------------------------------------------------
+
+
+options {
+ language = Java;
+ tokenVocab = UriLexer;
+}
+
+//;------------------------------------------------------------------------------
+//; 0. URI
+//;------------------------------------------------------------------------------
+
+batchEOF : BATCH EOF;
+
+entityEOF : vNS=namespace vODI=odataIdentifier;
+
+metadataEOF : METADATA EOF;
+
+//;------------------------------------------------------------------------------
+//; 1. Resource Path
+//;------------------------------------------------------------------------------
+
+//resourcePathEOF : vlPS=pathSegments EOF;
+
+crossjoinEOF : CROSSJOIN OPEN WSP? vlODI+=odataIdentifier WSP? ( COMMA WSP? vlODI+=odataIdentifier WSP?)* CLOSE EOF;
+
+allEOF : ALL;
+
+pathSegmentEOF : (pathSegment | constSegment) EOF;
+
+pathSegments : vlPS+=pathSegment (SLASH vlPS+=pathSegment)* (SLASH vCS=constSegment)?;
+
+pathSegment : vNS=namespace? vODI=odataIdentifier vlNVO+=nameValueOptList*;
+
+nameValueOptList : OPEN (vVO=commonExpr | vNVL=nameValueList)? CLOSE;
+nameValueList : WSP* vlNVP+=nameValuePair WSP* ( COMMA WSP* vlNVP+=nameValuePair WSP*)* ;
+nameValuePair : vODI=odataIdentifier EQ (AT vALI=odataIdentifier | vCOM=commonExpr /*TODO | val2=enumX*/);
+
+constSegment : (vV=value | vC=count | vR=ref | vAll=allExpr | vAny=anyExpr);
+
+count : COUNT;
+ref : REF;
+value : VALUE;
+
+//;------------------------------------------------------------------------------
+//; 2. Query Options
+//;------------------------------------------------------------------------------
+
+queryOptions : vlQO+=queryOption ( AMP vlQO+=queryOption )*;//TODO can this be removed
+
+queryOption : systemQueryOption;
+
+systemQueryOption : expand
+ | filter
+ | inlinecount
+ | orderBy
+ | search
+ | select
+ | skip
+ | skiptoken
+ | top
+ ;
+
+skiptoken : SKIPTOKEN EQ REST;
+expand : EXPAND EQ expandItems;
+
+expandItemsEOF : expandItems EOF;
+expandItems : vlEI+=expandItem ( COMMA vlEI+=expandItem )*;
+
+
+expandItem : vS=STAR ( SLASH vR=ref | OPEN LEVELS EQ ( vL=INT | vM=MAX) CLOSE )?
+ | vEP=expandPath vEPE=expandPathExtension?;
+
+
+expandPath : vlPS+=pathSegment (SLASH vlPS+=pathSegment)*;
+
+expandPathExtension : OPEN vlEO+=expandOption ( SEMI vlEO+=expandOption )* CLOSE
+ | SLASH vR=ref ( OPEN vlEOR+=expandRefOption ( SEMI vlEOR+=expandRefOption )* CLOSE )?
+ | SLASH vC=count ( OPEN vlEOC+=expandCountOption ( SEMI vlEOC+=expandCountOption )* CLOSE )?
+ ;
+
+expandCountOption : filter
+ | search
+ ;
+
+expandRefOption : expandCountOption
+ | orderBy
+ | skip
+ | top
+ | inlinecount
+ ;
+
+expandOption : expandRefOption
+ | select
+ | expand
+ | levels;
+
+levels : LEVELS EQ ( INT | MAX );
+
+filter : FILTER EQ commonExpr;
+
+filterExpressionEOF : commonExpr EOF;
+
+orderBy : ORDERBY EQ orderList;
+
+orderByEOF : orderList EOF;
+
+orderList : vlOI+=orderByItem ( WSP* COMMA WSP* vlOI+=orderByItem )*;
+
+orderByItem : vC=commonExpr ( WSP ( vA=ASC | vD=DESC ) )?;
+
+skip : SKIP EQ INT;
+top : TOP EQ INT;
+//format : FORMAT EQ ( ATOM | JSON | XML | PCHARS ( SLASH PCHARS)?);
+
+inlinecount : COUNT EQ booleanNonCase;
+
+search : SEARCH searchSpecialToken;
+searchInline : SEARCH_INLINE searchSpecialToken;
+
+searchSpecialToken : EQ WSP? searchExpr;
+
+searchExpr : (NOT WSP) searchExpr
+ | searchExpr searchExpr
+ | searchExpr WSP searchExpr
+ | searchExpr ( WSP AND WSP) searchExpr
+ | searchExpr ( WSP OR WSP) searchExpr
+ | searchPhrase
+ | searchWord
+ ;
+
+searchPhrase : SEARCHPHRASE;
+searchWord : SEARCHWORD;
+
+select : SELECT EQ vlSI+=selectItem ( COMMA vlSI+=selectItem )*;
+selectEOF : vlSI+=selectItem ( COMMA vlSI+=selectItem )*;
+
+selectItem : vlSS+=selectSegment ( SLASH vlSS+=selectSegment ) *;
+selectSegment : vNS=namespace? ( vODI=odataIdentifier | vS=STAR );
+
+aliasAndValue : vODI=ODATAIDENTIFIER EQ vV=parameterValue;
+
+parameterValue : commonExpr //TODO json not supported arrayOrObject
+ ;
+
+//;------------------------------------------------------------------------------
+//; 3. Context URL Fragments
+//;------------------------------------------------------------------------------
+
+contextFragment : REST; // the context fragment is only required on the client side
+
+//;------------------------------------------------------------------------------
+//; 4. Expressions
+//;------------------------------------------------------------------------------
+
+commonExpr : OPEN commonExpr CLOSE #altPharenthesis
+ | vE1=commonExpr (WSP HAS WSP) vE2=commonExpr #altHas
+ | methodCallExpr #altMethod
+ | ( unary WSP ) commonExpr #altUnary
+ | anyExpr #altAny
+ | allExpr #altAll
+ | memberExpr #altMember
+ | vE1=commonExpr (WSP vO=MUL WSP | WSP vO=DIV WSP | WSP vO=MOD WSP ) vE2=commonExpr #altMult
+ | vE1=commonExpr (WSP vO=ADD WSP | WSP vO=SUB WSP) vE2=commonExpr #altAdd
+ | vE1=commonExpr (WSP vO=GT WSP | WSP vO=GE WSP | WSP vO=LT WSP
+ | WSP vO=LE WSP ) vE2=commonExpr #altComparism
+ | vE1=commonExpr (WSP vO=EQ_ALPHA WSP | WSP vO=NE WSP) vE2=commonExpr #altEquality
+ | vE1=commonExpr (WSP AND WSP) vE2=commonExpr #altAnd
+ | vE1=commonExpr (WSP OR WSP) vE2=commonExpr #altOr
+ | rootExpr #altRoot // $...
+ | AT odataIdentifier #altAlias // @...
+ | primitiveLiteral #altLiteral // ...
+ ;
+
+unary : (MINUS| NOT) ;
+
+rootExpr : ROOT vPs=pathSegments;
+
+memberExpr : vIt=IT ( SLASH (vANY=anyExpr | vALL=allExpr))?
+ | vIts=ITSLASH? vPs=pathSegments ( SLASH (vANY=anyExpr | vALL=allExpr))?;
+
+anyExpr : ANY_LAMDA OPEN WSP? ( vLV=odataIdentifier WSP? COLON WSP? vLE=commonExpr WSP? )? CLOSE;
+allExpr : ALL_LAMDA OPEN WSP? vLV=odataIdentifier WSP? COLON WSP? vLE=commonExpr WSP? CLOSE;
+
+methodCallExpr : indexOfMethodCallExpr
+ | toLowerMethodCallExpr
+ | toUpperMethodCallExpr
+ | trimMethodCallExpr
+ | substringMethodCallExpr
+ | concatMethodCallExpr
+ | lengthMethodCallExpr
+ | yearMethodCallExpr
+ | monthMethodCallExpr
+ | dayMethodCallExpr
+ | hourMethodCallExpr
+ | minuteMethodCallExpr
+ | secondMethodCallExpr
+ | fractionalsecondsMethodCallExpr
+ | totalsecondsMethodCallExpr
+ | dateMethodCallExpr
+ | timeMethodCallExpr
+ | roundMethodCallExpr
+ | floorMethodCallExpr
+ | ceilingMethodCallExpr
+ | geoDistanceMethodCallExpr
+ | geoLengthMethodCallExpr
+ | totalOffsetMinutesMethodCallExpr
+ | minDateTimeMethodCallExpr
+ | maxDateTimeMethodCallExpr
+ | nowMethodCallExpr
+ //from boolean
+ | isofExpr
+ | castExpr
+ | endsWithMethodCallExpr
+ | startsWithMethodCallExpr
+ | containsMethodCallExpr
+ | geoIntersectsMethodCallExpr
+ ;
+
+
+containsMethodCallExpr : CONTAINS_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
+startsWithMethodCallExpr : STARTSWITH_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
+endsWithMethodCallExpr : ENDSWITH_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
+lengthMethodCallExpr : LENGTH_WORD WSP? vE1=commonExpr WSP? CLOSE;
+indexOfMethodCallExpr : INDEXOF_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
+substringMethodCallExpr : SUBSTRING_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? ( COMMA WSP? vE3=commonExpr WSP? )? CLOSE;
+toLowerMethodCallExpr : TOLOWER_WORD WSP? vE1=commonExpr WSP? CLOSE;
+toUpperMethodCallExpr : TOUPPER_WORD WSP? vE1=commonExpr WSP? CLOSE;
+trimMethodCallExpr : TRIM_WORD WSP? vE1=commonExpr WSP? CLOSE;
+concatMethodCallExpr : CONCAT_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
+
+yearMethodCallExpr : YEAR_WORD WSP? vE1=commonExpr WSP? CLOSE;
+monthMethodCallExpr : MONTH_WORD WSP? vE1=commonExpr WSP? CLOSE;
+dayMethodCallExpr : DAY_WORD WSP? vE1=commonExpr WSP? CLOSE;
+hourMethodCallExpr : HOUR_WORD WSP? vE1=commonExpr WSP? CLOSE;
+minuteMethodCallExpr : MINUTE_WORD WSP? vE1=commonExpr WSP? CLOSE;
+secondMethodCallExpr : SECOND_WORD WSP? vE1=commonExpr WSP? CLOSE;
+fractionalsecondsMethodCallExpr : FRACTIONALSECONDS_WORD WSP? vE1=commonExpr WSP? CLOSE;
+totalsecondsMethodCallExpr : TOTALSECONDS_WORD WSP? vE1=commonExpr WSP? CLOSE;
+dateMethodCallExpr : DATE_WORD WSP? vE1=commonExpr WSP? CLOSE;
+timeMethodCallExpr : TIME_WORD WSP? vE1=commonExpr WSP? CLOSE;
+totalOffsetMinutesMethodCallExpr : TOTALOFFSETMINUTES_WORD WSP? vE1=commonExpr WSP? CLOSE;
+
+minDateTimeMethodCallExpr : MINDATETIME_WORD WSP? CLOSE;
+maxDateTimeMethodCallExpr : MAXDATETIME_WORD WSP? CLOSE;
+nowMethodCallExpr : NOW_WORD WSP? CLOSE;
+
+roundMethodCallExpr : ROUND_WORD WSP? vE1=commonExpr WSP? CLOSE;
+floorMethodCallExpr : FLOOR_WORD WSP? vE1=commonExpr WSP? CLOSE;
+ceilingMethodCallExpr : CEILING_WORD WSP? vE1=commonExpr WSP? CLOSE;
+
+geoDistanceMethodCallExpr : GEO_DISTANCE_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
+geoLengthMethodCallExpr : GEO_LENGTH_WORD WSP? vE1=commonExpr WSP? CLOSE;
+geoIntersectsMethodCallExpr : GEO_INTERSECTS_WORD WSP? vE1=commonExpr WSP? COMMA WSP? vE2=commonExpr WSP? CLOSE;
+
+isofExpr : ISOF_WORD WSP? ( vE1=commonExpr WSP? COMMA WSP? )? vNS=namespace vODI=odataIdentifier WSP? CLOSE;
+castExpr : CAST_WORD WSP? ( vE1=commonExpr WSP? COMMA WSP? )? vNS=namespace vODI=odataIdentifier WSP? CLOSE;
+
+//;------------------------------------------------------------------------------
+//; 5. JSON format for function parameters
+//;------------------------------------------------------------------------------
+//; Note: the query part of a URI needs to be partially percent-decoded before
+//; applying these rules, see comment at the top of this file
+//;------------------------------------------------------------------------------
+
+arrayOrObject : json_array
+ | json_object;
+
+json_array : BEGIN_ARRAY json_value ( WSP? COMMA WSP? json_value)* END_ARRAY;
+
+json_value : jsonPrimitiv
+ | rootExpr
+ | json_object
+ | json_array;
+
+json_object : BEGIN_OBJECT
+ STRING_IN_JSON
+ WSP? COLON WSP?
+ json_value
+ END_OBJECT;
+
+
+//; JSON syntax: adapted to URI restrictions from [RFC4627]
+jsonPrimitiv : STRING_IN_JSON
+ | number_in_json
+ | TRUE
+ | FALSE
+ | 'null'
+ ;
+
+number_in_json : INT | DECIMAL;
+
+//;------------------------------------------------------------------------------
+//; 6. Names and identifiers
+//;------------------------------------------------------------------------------
+
+qualifiedtypename : namespace odataIdentifier
+ | 'collection' OPEN ( namespace odataIdentifier ) CLOSE
+ ;
+
+namespace : (odataIdentifier POINT)+;
+
+odataIdentifier : ODATAIDENTIFIER;
+
+//;------------------------------------------------------------------------------
+//; 7. Literal Data Values
+//;------------------------------------------------------------------------------
+
+
+primitiveLiteral : nullrule
+ | booleanNonCase
+ | DECIMAL //includes double and single literals
+ | naninfinity
+ | INT //includes int16/int32 and int64 literals
+ | BINARY
+ | DATE
+ | DATETIMEOFFSET
+ | DURATION
+ | GUID
+ | string
+ | TIMEOFDAY
+ | enumLit
+ | geographyCollection
+ | geographyLineString
+ | geographyMultilineString
+ | geographyMultipoint
+ | geographyMultipolygon
+ | geographyPoint
+ | geographyPolygon
+ | geometryCollection
+ | geometryLineString
+ | geometryMultilineString
+ | geometryMultipoint
+ | geometryMultipolygon
+ | geometryPoint
+ | geometryPolygon
+ ;
+
+naninfinity : NANINFINITY;
+
+nullrule : NULLVALUE;
+booleanNonCase : BOOLEAN | TRUE | FALSE;
+string : STRING;
+
+enumLit : vNS=namespace vODI=odataIdentifier vValues=STRING;
+enumValues : vlODI+=odataIdentifier ( COMMA vlODI+=odataIdentifier )*;
+
+geographyCollection : GEOGRAPHY fullCollectionLiteral SQUOTE;
+fullCollectionLiteral : sridLiteral collectionLiteral;
+
+collectionLiteral : (COLLECTION ) OPEN geoLiteral ( COMMA geoLiteral )* CLOSE;
+
+geoLiteral : collectionLiteral
+ | lineStringLiteral
+ | multipointLiteral
+ | multilineStringLiteral
+ | multipolygonLiteral
+ | pointLiteral
+ | polygonLiteral;
+
+geographyLineString : GEOGRAPHY fullLineStringLiteral SQUOTE;
+fullLineStringLiteral : sridLiteral lineStringLiteral;
+lineStringLiteral : LINESTRING lineStringData;
+lineStringData : OPEN positionLiteral ( COMMA positionLiteral )* CLOSE;
+
+geographyMultilineString : GEOGRAPHY fullMultilineStringLiteral SQUOTE;
+fullMultilineStringLiteral : sridLiteral multilineStringLiteral;
+multilineStringLiteral : MULTILINESTRING OPEN ( lineStringData ( COMMA lineStringData )* )? CLOSE;
+
+geographyMultipoint : GEOGRAPHY fullMultipointLiteral SQUOTE;
+fullMultipointLiteral : sridLiteral multipointLiteral;
+multipointLiteral : MULTIPOINT OPEN ( pointData ( COMMA pointData )* )? CLOSE ;
+
+geographyMultipolygon : GEOGRAPHY fullmultipolygonLiteral SQUOTE;
+fullmultipolygonLiteral : sridLiteral multipolygonLiteral;
+multipolygonLiteral : MULTIPOLYGON OPEN ( polygonData ( COMMA polygonData )* )? CLOSE;
+
+geographyPoint : GEOGRAPHY fullpointLiteral SQUOTE;
+fullpointLiteral : sridLiteral pointLiteral;
+
+pointLiteral : GEO_POINT pointData;
+pointData : OPEN positionLiteral CLOSE;
+
+positionLiteral : (DECIMAL | INT ) WSP (DECIMAL | INT ); //; longitude, then latitude
+
+
+geographyPolygon : GEOGRAPHY fullPolygonLiteral SQUOTE;
+fullPolygonLiteral : sridLiteral polygonLiteral;
+polygonLiteral : POLYGON polygonData;
+polygonData : OPEN ringLiteral ( COMMA ringLiteral )* CLOSE;
+ringLiteral : OPEN positionLiteral ( COMMA positionLiteral )* CLOSE;
+
+
+geometryCollection : GEOMETRY fullCollectionLiteral SQUOTE;
+geometryLineString : GEOMETRY fullLineStringLiteral SQUOTE;
+geometryMultilineString : GEOMETRY fullMultilineStringLiteral SQUOTE;
+geometryMultipoint : GEOMETRY fullMultipointLiteral SQUOTE;
+geometryMultipolygon : GEOMETRY fullmultipolygonLiteral SQUOTE;
+geometryPoint : GEOMETRY fullpointLiteral SQUOTE;
+geometryPolygon : GEOMETRY fullPolygonLiteral SQUOTE;
+
+sridLiteral : SRID EQ INT SEMI;
+
+
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmActionImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmActionImpl.java b/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmActionImpl.java
deleted file mode 100644
index 6f5d6fd..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmActionImpl.java
+++ /dev/null
@@ -1,36 +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.server.core.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmTypeKind;
-import org.apache.olingo.odata4.server.api.edm.provider.Action;
-
-public class EdmActionImpl extends EdmOperationImpl implements EdmAction {
-
- public static EdmActionImpl getInstance(final Edm edm, final FullQualifiedName name, final Action action) {
- return EdmOperationImpl.getInstance(new EdmActionImpl(edm, name, action));
- }
-
- private EdmActionImpl(final Edm edm, final FullQualifiedName name, final Action action) {
- super(edm, name, action, EdmTypeKind.ACTION);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmActionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmActionImportImpl.java b/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmActionImportImpl.java
deleted file mode 100644
index 691842d..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmActionImportImpl.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.server.core.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.server.api.edm.provider.ActionImport;
-
-public class EdmActionImportImpl extends EdmOperationImportImpl implements EdmActionImport {
-
- private final ActionImport actionImport;
-
- public EdmActionImportImpl(final Edm edm, final EdmEntityContainer container, final String name,
- final ActionImport actionImport) {
-
- super(edm, container, name, actionImport);
- this.actionImport = actionImport;
- }
-
- @Override
- public EdmAction getAction() {
- return edm.getAction(actionImport.getAction(), null, null);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmBindingTargetImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmBindingTargetImpl.java b/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmBindingTargetImpl.java
deleted file mode 100644
index be8b35b..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmBindingTargetImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.server.core.edm.provider;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmBindingTarget;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmBindingTarget;
-import org.apache.olingo.odata4.server.api.edm.provider.BindingTarget;
-import org.apache.olingo.odata4.server.api.edm.provider.NavigationPropertyBinding;
-import org.apache.olingo.odata4.commons.api.edm.Target;
-
-public abstract class EdmBindingTargetImpl extends AbstractEdmBindingTarget {
-
- private final BindingTarget target;
-
- public EdmBindingTargetImpl(final Edm edm, final EdmEntityContainer container, final BindingTarget target) {
- super(edm, container, target.getName(), target.getType());
- this.target = target;
- }
-
- @Override
- public EdmBindingTarget getRelatedBindingTarget(final String path) {
- EdmBindingTarget bindingTarget = null;
-
- final List<NavigationPropertyBinding> navigationPropertyBindings = target.getNavigationPropertyBindings();
- if (navigationPropertyBindings != null) {
- boolean found = false;
- for (final Iterator<NavigationPropertyBinding> itor = navigationPropertyBindings.iterator();
- itor.hasNext() && !found;) {
-
- final NavigationPropertyBinding binding = itor.next();
- if (binding.getPath().equals(path)) {
- final Target providerTarget = binding.getTarget();
- final EdmEntityContainer entityContainer = edm.getEntityContainer(providerTarget.getEntityContainer());
- if (entityContainer == null) {
- throw new EdmException("Cant find entity container with name: " + providerTarget.getEntityContainer());
- }
- final String targetName = providerTarget.getTargetName();
- bindingTarget = entityContainer.getEntitySet(targetName);
- if (bindingTarget == null) {
- bindingTarget = entityContainer.getSingleton(targetName);
- if (bindingTarget == null) {
- throw new EdmException("Cant find target with name: " + targetName);
- }
-
- found = true;
- } else {
- found = true;
- }
- }
- }
- }
-
- return bindingTarget;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmComplexTypeImpl.java b/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmComplexTypeImpl.java
deleted file mode 100644
index e409d09..0000000
--- a/lib/server-core/src/main/java/org/apache/olingo/odata4/server/core/edm/provider/EdmComplexTypeImpl.java
+++ /dev/null
@@ -1,58 +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.server.core.edm.provider;
-
-import java.util.Map;
-import org.apache.olingo.odata4.commons.api.edm.Edm;
-import org.apache.olingo.odata4.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.core.edm.AbstractEdmComplexType;
-import org.apache.olingo.odata4.commons.core.edm.EdmStructuredTypeHelper;
-import org.apache.olingo.odata4.server.api.edm.provider.ComplexType;
-
-public class EdmComplexTypeImpl extends AbstractEdmComplexType {
-
- private final EdmStructuredTypeHelper helper;
-
- public static EdmComplexTypeImpl getInstance(
- final Edm edm, final FullQualifiedName name, final ComplexType complexType) {
-
- final EdmComplexTypeImpl instance = new EdmComplexTypeImpl(edm, name, complexType);
- instance.baseType = instance.buildBaseType(complexType.getBaseType());
-
- return instance;
- }
-
- private EdmComplexTypeImpl(final Edm edm, final FullQualifiedName name, final ComplexType complexType) {
- super(edm, name, complexType.getBaseType());
- this.helper = new EdmStructuredTypeHelperImpl(edm, complexType);
- }
-
- @Override
- protected Map<String, EdmProperty> getProperties() {
- return helper.getProperties();
- }
-
- @Override
- protected Map<String, EdmNavigationProperty> getNavigationProperties() {
- return helper.getNavigationProperties();
- }
-
-}
[19/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/demo-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/demo-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/demo-metadata.xml
deleted file mode 100644
index 9b21e2f..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/demo-metadata.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
- <edmx:DataServices>
- <Schema Namespace="ODataDemo" xmlns="http://docs.oasis-open.org/odata/ns/edm">
- <EntityType Name="Product">
- <Key>
- <PropertyRef Name="ID" />
- </Key>
- <Property Name="ID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
- <Property Name="Description" Type="Edm.String" />
- <Property Name="ReleaseDate" Type="Edm.DateTimeOffset" Nullable="false" />
- <Property Name="DiscontinuedDate" Type="Edm.DateTimeOffset" />
- <Property Name="Rating" Type="Edm.Int16" Nullable="false" />
- <Property Name="Price" Type="Edm.Double" Nullable="false" />
- <NavigationProperty Name="Categories" Type="Collection(ODataDemo.Category)" Partner="Products" />
- <NavigationProperty Name="Supplier" Type="ODataDemo.Supplier" Partner="Products" />
- <NavigationProperty Name="ProductDetail" Type="ODataDemo.ProductDetail" Partner="Product" />
- </EntityType>
- <EntityType Name="FeaturedProduct" BaseType="ODataDemo.Product">
- <NavigationProperty Name="Advertisement" Type="ODataDemo.Advertisement" Partner="FeaturedProduct" />
- </EntityType>
- <EntityType Name="ProductDetail">
- <Key>
- <PropertyRef Name="ProductID" />
- </Key>
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Details" Type="Edm.String" />
- <NavigationProperty Name="Product" Type="ODataDemo.Product" Partner="ProductDetail" />
- </EntityType>
- <EntityType Name="Category" OpenType="true">
- <Key>
- <PropertyRef Name="ID" />
- </Key>
- <Property Name="ID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
- <NavigationProperty Name="Products" Type="Collection(ODataDemo.Product)" Partner="Categories" />
- </EntityType>
- <EntityType Name="Supplier">
- <Key>
- <PropertyRef Name="ID" />
- </Key>
- <Property Name="ID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
- <Property Name="Address" Type="ODataDemo.Address" />
- <Property Name="Location" Type="Edm.GeographyPoint" SRID="Variable" />
- <Property Name="Concurrency" Type="Edm.Int32" ConcurrencyMode="Fixed" Nullable="false" />
- <NavigationProperty Name="Products" Type="Collection(ODataDemo.Product)" Partner="Supplier" />
- </EntityType>
- <ComplexType Name="Address">
- <Property Name="Street" Type="Edm.String" />
- <Property Name="City" Type="Edm.String" />
- <Property Name="State" Type="Edm.String" />
- <Property Name="ZipCode" Type="Edm.String" />
- <Property Name="Country" Type="Edm.String" />
- </ComplexType>
- <EntityType Name="Person">
- <Key>
- <PropertyRef Name="ID" />
- </Key>
- <Property Name="ID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
- <NavigationProperty Name="PersonDetail" Type="ODataDemo.PersonDetail" Partner="Person" />
- </EntityType>
- <EntityType Name="Customer" BaseType="ODataDemo.Person">
- <Property Name="TotalExpense" Type="Edm.Decimal" Nullable="false" />
- </EntityType>
- <EntityType Name="Employee" BaseType="ODataDemo.Person">
- <Property Name="EmployeeID" Type="Edm.Int64" Nullable="false" />
- <Property Name="HireDate" Type="Edm.DateTimeOffset" Nullable="false" />
- <Property Name="Salary" Type="Edm.Single" Nullable="false" />
- </EntityType>
- <EntityType Name="PersonDetail">
- <Key>
- <PropertyRef Name="PersonID" />
- </Key>
- <Property Name="PersonID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Age" Type="Edm.Byte" Nullable="false" />
- <Property Name="Gender" Type="Edm.Boolean" Nullable="false" />
- <Property Name="Phone" Type="Edm.String" />
- <Property Name="Address" Type="ODataDemo.Address" />
- <Property Name="Photo" Type="Edm.Stream" Nullable="false" />
- <NavigationProperty Name="Person" Type="ODataDemo.Person" Partner="PersonDetail" />
- </EntityType>
- <EntityType Name="Advertisement" HasStream="true">
- <Key>
- <PropertyRef Name="ID" />
- </Key>
- <Property Name="ID" Type="Edm.Guid" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
- <Property Name="AirDate" Type="Edm.DateTimeOffset" Nullable="false" />
- <NavigationProperty Name="FeaturedProduct" Type="ODataDemo.FeaturedProduct" Partner="Advertisement" />
- </EntityType>
- <EntityContainer Name="DemoService">
- <EntitySet Name="Products" EntityType="ODataDemo.Product">
- <NavigationPropertyBinding Path="ODataDemo.FeaturedProduct/Advertisement" Target="Advertisements" />
- <NavigationPropertyBinding Path="Categories" Target="Categories" />
- <NavigationPropertyBinding Path="Supplier" Target="Suppliers" />
- <NavigationPropertyBinding Path="ProductDetail" Target="ProductDetails" />
- </EntitySet>
- <EntitySet Name="ProductDetails" EntityType="ODataDemo.ProductDetail">
- <NavigationPropertyBinding Path="Product" Target="Products" />
- </EntitySet>
- <EntitySet Name="Categories" EntityType="ODataDemo.Category">
- <NavigationPropertyBinding Path="Products" Target="Products" />
- </EntitySet>
- <EntitySet Name="Suppliers" EntityType="ODataDemo.Supplier">
- <NavigationPropertyBinding Path="Products" Target="Products" />
- </EntitySet>
- <EntitySet Name="Persons" EntityType="ODataDemo.Person">
- <NavigationPropertyBinding Path="PersonDetail" Target="PersonDetails" />
- </EntitySet>
- <EntitySet Name="PersonDetails" EntityType="ODataDemo.PersonDetail">
- <NavigationPropertyBinding Path="Person" Target="Persons" />
- </EntitySet>
- <EntitySet Name="Advertisements" EntityType="ODataDemo.Advertisement">
- <NavigationPropertyBinding Path="FeaturedProduct" Target="Products" />
- </EntitySet>
- </EntityContainer>
- <Annotations Target="ODataDemo.DemoService">
- <Annotation Term="Org.OData.Display.V1.Description" String="This is a sample OData service with vocabularies" />
- </Annotations>
- <Annotations Target="ODataDemo.Product">
- <Annotation Term="Org.OData.Display.V1.Description" String="All Products available in the online store" />
- </Annotations>
- <Annotations Target="ODataDemo.Product/Name">
- <Annotation Term="Org.OData.Display.V1.DisplayName" String="Product Name" />
- </Annotations>
- <Annotations Target="ODataDemo.DemoService/Suppliers">
- <Annotation Term="Org.OData.Publication.V1.PublisherName" String="Microsoft Corp." />
- <Annotation Term="Org.OData.Publication.V1.PublisherId" String="MSFT" />
- <Annotation Term="Org.OData.Publication.V1.Keywords" String="Inventory, Supplier, Advertisers, Sales, Finance" />
- <Annotation Term="Org.OData.Publication.V1.AttributionUrl" String="http://www.odata.org/" />
- <Annotation Term="Org.OData.Publication.V1.AttributionDescription" String="All rights reserved" />
- <Annotation Term="Org.OData.Publication.V1.DocumentationUrl " String="http://www.odata.org/" />
- <Annotation Term="Org.OData.Publication.V1.TermsOfUseUrl" String="All rights reserved" />
- <Annotation Term="Org.OData.Publication.V1.PrivacyPolicyUrl" String="http://www.odata.org/" />
- <Annotation Term="Org.OData.Publication.V1.LastModified" String="4/2/2013" />
- <Annotation Term="Org.OData.Publication.V1.ImageUrl " String="http://www.odata.org/" />
- </Annotations>
- </Schema>
- </edmx:DataServices>
-</edmx:Edmx>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc1-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc1-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc1-metadata.xml
deleted file mode 100644
index ed46844..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc1-metadata.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
- <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs01/vocabularies/Org.OData.Core.V1.xml">
- <edmx:Include Namespace="Org.OData.Core.V1" Alias="Core"/>
- </edmx:Reference>
- <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs01/vocabularies/Org.OData.Measures.V1.xml">
- <edmx:Include Alias="UoM" Namespace="Org.OData.Measures.V1"/>
- </edmx:Reference>
- <edmx:DataServices>
- <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="ODataDemo">
- <TypeDefinition Name="Length" UnderlyingType="Edm.Int32">
- <Annotation Term="Org.OData.Measures.V1.Unit" String="Centimeters"/>
- </TypeDefinition>
- <TypeDefinition Name="Weight" UnderlyingType="Edm.Int32">
- <Annotation Term="Org.OData.Measures.V1.Unit" String="Kilograms"/>
- </TypeDefinition>
- <ComplexType Name="Size">
- <Property Name="Height" Type="Self.Length" />
- <Property Name="Weight" Type="Self.Weight" />
- </ComplexType>
- <EntityType Name="Product" HasStream="true">
- <Key>
- <PropertyRef Name="ID"/>
- </Key>
- <Property Name="ID" Type="Edm.Int32" Nullable="false"/>
- <Property Name="Description" Type="Edm.String" >
- <Annotation Term="Core.IsLanguageDependent"/>
- </Property>
- <Property Name="ReleaseDate" Type="Edm.Date"/>
- <Property Name="DiscontinuedDate" Type="Edm.Date"/>
- <Property Name="Rating" Type="Edm.Int32"/>
- <Property Name="Price" Type="Edm.Decimal">
- <Annotation Term="UoM.ISOCurrency" Path="Currency"/>
- </Property>
- <Property Name="Currency" Type="Edm.String" MaxLength="3"/>
- <NavigationProperty Name="Category" Type="ODataDemo.Category" Nullable="false" Partner="Products"/>
- <NavigationProperty Name="Supplier" Type="ODataDemo.Supplier" Partner="Products"/>
- </EntityType>
- <EntityType Name="Category">
- <Key>
- <PropertyRef Name="ID"/>
- </Key>
- <Property Name="ID" Type="Edm.Int32" Nullable="false"/>
- <Property Name="Name" Type="Edm.String">
- <Annotation Term="Core.IsLanguageDependent"/>
- </Property>
- <NavigationProperty Name="Products" Partner="Category" Type="Collection(ODataDemo.Product)">
- <OnDelete Action="Cascade"/>
- </NavigationProperty>
- </EntityType>
- <EntityType Name="Supplier">
- <Key>
- <PropertyRef Name="ID"/>
- </Key>
- <Property Name="ID" Type="Edm.String" Nullable="false"/>
- <Property Name="Name" Type="Edm.String"/>
- <Property Name="Address" Type="ODataDemo.Address" Nullable="false"/>
- <Property Name="Concurrency" Type="Edm.Int32" Nullable="false"/>
- <NavigationProperty Name="Products" Partner="Supplier"/> Type="Collection(ODataDemo.Product)"/>
- </EntityType>
- <EntityType Name="Country">
- <Key>
- <PropertyRef Name="Code"/>
- </Key>
- <Property Name="Code" Type="Edm.String" MaxLength="2" Nullable="false"/>
- <Property Name="Name" Type="Edm.String"/>
- </EntityType>
- <ComplexType Name="Address">
- <Property Name="Street" Type="Edm.String"/>
- <Property Name="City" Type="Edm.String"/>
- <Property Name="State" Type="Edm.String"/>
- <Property Name="ZipCode" Type="Edm.String"/>
- <Property Name="CountryName" Type="Edm.String"/>
- <NavigationProperty Name="Country" Type="ODataDemo.Country">
- <ReferentialConstraint Property="CountryName" ReferencedProperty="Name"/>
- </NavigationProperty>
- </ComplexType>
- <Function Name="ProductsByRating">
- <Parameter Name="Rating" Type="Edm.Int32"/>
- <ReturnType Type="Collection(ODataDemo.Product)"/>
- </Function>
- <EntityContainer Name="DemoService">
- <EntitySet Name="Products" EntityType="ODataDemo.Product">
- <NavigationPropertyBinding Path="Category" Target="Categories"/>
- </EntitySet>
- <EntitySet Name="Categories" EntityType="ODataDemo.Category">
- <NavigationPropertyBinding Path="Products" Target="Products"/>
- </EntitySet>
- <EntitySet Name="Suppliers" EntityType="ODataDemo.Supplier">
- <NavigationPropertyBinding Path="Products" Target="Products"/>
- <NavigationPropertyBinding Path="Address/Country" Target="Countries"/>
- <Annotation Term="Core.OptimisticConcurrencyControl">
- <Collection>
- <PropertyPath>Concurrency</PropertyPath>
- </Collection>
- </Annotation>
- </EntitySet>
- <Singleton Name="Contoso" Type="Self.Supplier">
- <NavigationPropertyBinding Path="Products" Target="Products"/>
- </Singleton>
- <EntitySet Name="Countries" EntityType="ODataDemo.Country"/>
- <FunctionImport Name="ProductsByRating" EntitySet="Products" Function="ODataDemo.ProductsByRating"/>
- </EntityContainer>
- </Schema>
- </edmx:DataServices>
-</edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc2-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc2-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc2-metadata.xml
deleted file mode 100644
index 60387f2..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc2-metadata.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
- <edmx:Reference Uri="http://host/service/$metadata">
- <edmx:Include Namespace="ODataDemo"/>
- </edmx:Reference>
- <edmx:Reference Uri="http://somewhere/Vocabulary/V1">
- <edmx:Include Alias="Vocabulary1" Namespace="Some.Vocabulary.V1"/>
- </edmx:Reference>
- <edmx:DataServices>
- <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Annotations">
- <Annotations Target="ODataDemo.Supplier">
- <Annotation Term="Vocabulary1.EMail">
- <Null/>
- </Annotation>
- <Annotation Term="Vocabulary1.AccountID" Path="ID"/>
- <Annotation Term="Vocabulary1.Title" String="Supplier Info"/>
- <Annotation Term="Vocabulary1.DisplayName">
- <Apply Function="odata.concat">
- <Path>Name</Path>
- <String> in </String>
- <Path>Address/CountryName</Path>
- </Apply>
- </Annotation>
- </Annotations>
- <Annotations Target="ODataDemo.Product">
- <Annotation Term="Vocabulary1.Tags">
- <Collection>
- <String>MasterData</String>
- </Collection>
- </Annotation>
- </Annotations>
- </Schema>
- </edmx:DataServices>
-</edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc3-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc3-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc3-metadata.xml
deleted file mode 100644
index 2a00bd8..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/fromdoc3-metadata.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
- <edmx:Reference Uri="http://host/service/$metadata">
- <edmx:Include Namespace="ODataDemo"/>
- </edmx:Reference>
- <edmx:Reference Uri="http://somewhere/Vocabulary/V1">
- <edmx:Include Alias="Vocabulary1" Namespace="Some.Vocabulary.V1"/>
- </edmx:Reference>
- <edmx:DataServices>
- <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Annotations">
- <Annotations Target="Test">
- <Annotation Term="org.example.display.EndTime" TimeOfDay="21:45:00"/>,
- <Annotation Term="org.example.display.EndTime">
- <TimeOfDay>21:45:00</TimeOfDay>
- </Annotation>,
- <Annotation Term='Test' Path="IsMale"/>,
- <Annotation Term='Test'>
- <Not>
- <Path>IsMale</Path>
- </Not>
- </Annotation>,
- <Annotation Term='Test'>
- <And>
- <Path>IsMale</Path>
- <Path>IsMarried</Path>
- </And>
- </Annotation>,
- <Annotation Term="UI.ReferenceFacet" AnnotationPath="Product/Supplier/@UI.LineItem"/>,
- <Annotation Term="UI.ReferenceFacet">
- <AnnotationPath>Product/Supplier/@UI.LineItem</AnnotationPath>
- </Annotation>,
- <Annotation Term="Vocabulary1.DisplayName">
- <Apply Function="odata.concat">
- <Path>Name</Path>
- <String> in </String>
- <Path>Address/CountryName</Path>
- </Apply>
- </Annotation>,
- <Annotation Term="org.example.display.Threshold">
- <Cast Type="Edm.Decimal">
- <Path>Average</Path>
- </Cast>
- </Annotation>,
- <Annotation Term="Vocabulary1.Tags">
- <Collection>
- <String>MasterData</String>
- </Collection>
- </Annotation>,
- <Annotation Term="org.example.person.Gender">
- <If>
- <Bool>true</Bool>
- <String>Female</String>
- <String>Male</String>
- </If>
- </Annotation>,
- <Annotation Term="org.example.person.Gender">
- <If>
- <Path>IsFemale</Path>
- <String>Female</String>
- <String>Male</String>
- </If>
- </Annotation>,
- <Annotation Term="Self.IsPreferredCustomer">
- <IsOf Type="Self.PreferredCustomer">
- <Path>Customer</Path>
- </IsOf>
- </Annotation>,
- <Annotation Term="org.example.display.DisplayName">
- <LabeledElement Name="CustomerFirstName" Path="FirstName" />
- </Annotation>,
- <Annotation Term="org.example.display.DisplayName">
- <LabeledElement Name="CustomerFirstName">
- <Path>FirstName</Path>
- </LabeledElement>
- </Annotation>,
- <Annotation Term="org.example.person.Employee">
- <Record>
- <PropertyValue Property="GivenName" Path="FirstName" />
- <PropertyValue Property="Surname" Path="LastName" />
- <PropertyValue Property="Manager" Path="DirectSupervisor" />
- <PropertyValue Property="CostCenter">
- <UrlRef>
- <Apply Function="odata.fillUriTemplate">
- <String>http://host/anotherservice/CostCenters('{ccid}')</String>
- <LabeledElement Name="ccid" Path="CostCenterID" />
- </Apply>
- </UrlRef>
- </PropertyValue>
- </Record>
- </Annotation>,
- <Annotation Term="Vocab.Supplier">
- <UrlRef>
- <Apply Function="odata.fillUriTemplate">
- <String>http://host/service/Suppliers({suppID})</String>
- <LabeledElement Name="suppID">
- <Apply Function="odata.uriEncode">
- <Path>SupplierId</Path>
- </Apply>
- </LabeledElement>
- </Apply>
- </UrlRef>
- </Annotation>,
- <Annotation Term="Core.LongDescription">
- <UrlRef>
- <String>http://host/wiki/HowToUse</String>
- </UrlRef>
- </Annotation>
- </Annotations>
- </Schema>
- </edmx:DataServices>
-</edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/metadata.xml
deleted file mode 100644
index 3f992ac..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/metadata.xml
+++ /dev/null
@@ -1,232 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
- <edmx:DataServices m:DataServiceVersion="4.0" m:MaxDataServiceVersion="4.0" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata">
- <Schema Namespace="Microsoft.Exchange.Services.OData.Model" xmlns="http://docs.oasis-open.org/odata/ns/edm">
- <EnumType Name="BodyType">
- <Member Name="Text" Value="0" />
- <Member Name="HTML" Value="1" />
- </EnumType>
- <EnumType Name="Importance">
- <Member Name="Normal" Value="0" />
- <Member Name="Low" Value="1" />
- <Member Name="High" Value="2" />
- </EnumType>
- <EnumType Name="AttendeeType">
- <Member Name="Required" Value="1" />
- <Member Name="Optional" Value="2" />
- <Member Name="Resource" Value="3" />
- </EnumType>
- <EnumType Name="ResponseType">
- <Member Name="None" Value="0" />
- <Member Name="Organizer" Value="1" />
- <Member Name="TentativelyAccepted" Value="2" />
- <Member Name="Accepted" Value="3" />
- <Member Name="Declined" Value="4" />
- <Member Name="NotResponded" Value="5" />
- </EnumType>
- <EnumType Name="EventType">
- <Member Name="SingleInstance" Value="0" />
- <Member Name="Occurrence" Value="1" />
- <Member Name="Exception" Value="2" />
- <Member Name="SeriesMaster" Value="3" />
- </EnumType>
- <EnumType Name="FreeBusyStatus">
- <Member Name="Free" Value="0" />
- <Member Name="Tentative" Value="1" />
- <Member Name="Busy" Value="2" />
- <Member Name="Oof" Value="3" />
- <Member Name="WorkingElsewhere" Value="4" />
- <Member Name="Unknown" Value="-1" />
- </EnumType>
- <ComplexType Name="Recipient">
- <Property Name="Name" Type="Edm.String" />
- <Property Name="Address" Type="Edm.String" />
- </ComplexType>
- <ComplexType Name="Attendee" BaseType="Microsoft.Exchange.Services.OData.Model.Recipient">
- <Property Name="Status" Type="Microsoft.Exchange.Services.OData.Model.ResponseStatus" />
- <Property Name="Type" Type="Microsoft.Exchange.Services.OData.Model.AttendeeType" />
- </ComplexType>
- <ComplexType Name="ItemBody">
- <Property Name="ContentType" Type="Microsoft.Exchange.Services.OData.Model.BodyType" />
- <Property Name="Content" Type="Edm.String" />
- </ComplexType>
- <ComplexType Name="Location">
- <Property Name="DisplayName" Type="Edm.String" />
- </ComplexType>
- <ComplexType Name="ResponseStatus" BaseType="Microsoft.Exchange.Services.OData.Model.Recipient">
- <Property Name="Response" Type="Microsoft.Exchange.Services.OData.Model.ResponseType" />
- <Property Name="Time" Type="Edm.DateTimeOffset" />
- </ComplexType>
- <EntityType Name="Entity" Abstract="true">
- <Key>
- <PropertyRef Name="Id" />
- </Key>
- <Property Name="Id" Type="Edm.String" Nullable="false" />
- </EntityType>
- <EntityType Name="User" BaseType="Microsoft.Exchange.Services.OData.Model.Entity">
- <Property Name="DisplayName" Type="Edm.String" />
- <Property Name="Alias" Type="Edm.String" />
- <Property Name="MailboxGuid" Type="Edm.Guid" />
- <NavigationProperty Name="Folders" Type="Collection(Microsoft.Exchange.Services.OData.Model.Folder)" />
- <NavigationProperty Name="Messages" Type="Collection(Microsoft.Exchange.Services.OData.Model.EmailMessage)" />
- <NavigationProperty Name="RootFolder" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
- <NavigationProperty Name="Inbox" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
- <NavigationProperty Name="Drafts" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
- <NavigationProperty Name="SentItems" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
- <NavigationProperty Name="DeletedItems" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
- <NavigationProperty Name="Calendars" Type="Collection(Microsoft.Exchange.Services.OData.Model.Calendar)" />
- <NavigationProperty Name="CalendarGroups" Type="Collection(Microsoft.Exchange.Services.OData.Model.CalendarGroup)" />
- <NavigationProperty Name="Events" Type="Collection(Microsoft.Exchange.Services.OData.Model.Event)" />
- </EntityType>
- <EntityType Name="Folder" BaseType="Microsoft.Exchange.Services.OData.Model.Entity">
- <Property Name="ParentFolderId" Type="Edm.String" />
- <Property Name="DisplayName" Type="Edm.String" />
- <Property Name="ClassName" Type="Edm.String" />
- <Property Name="TotalCount" Type="Edm.Int32" />
- <Property Name="ChildFolderCount" Type="Edm.Int32" />
- <Property Name="UnreadItemCount" Type="Edm.Int32" />
- <NavigationProperty Name="ChildFolders" Type="Collection(Microsoft.Exchange.Services.OData.Model.Folder)" />
- <NavigationProperty Name="Messages" Type="Collection(Microsoft.Exchange.Services.OData.Model.EmailMessage)" />
- </EntityType>
- <Action Name="Copy" IsBound="true" EntitySetPath="bindingParameter" ReturnType="Microsoft.Exchange.Services.OData.Model.Folder">
- <Parameter Name="bindingParameter" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
- <Parameter Name="DestinationId" Type="Edm.String" />
- </Action>
- <Action Name="Move" IsBound="true" EntitySetPath="bindingParameter" ReturnType="Microsoft.Exchange.Services.OData.Model.Folder">
- <Parameter Name="bindingParameter" Type="Microsoft.Exchange.Services.OData.Model.Folder" />
- <Parameter Name="DestinationId" Type="Edm.String" />
- </Action>
- <EntityType Name="Item" BaseType="Microsoft.Exchange.Services.OData.Model.Entity" Abstract="true">
- <Property Name="ChangeKey" Type="Edm.String" />
- <Property Name="ClassName" Type="Edm.String" />
- <Property Name="Subject" Type="Edm.String" />
- <Property Name="Body" Type="Microsoft.Exchange.Services.OData.Model.ItemBody" />
- <Property Name="BodyPreview" Type="Edm.String" />
- <Property Name="Importance" Type="Microsoft.Exchange.Services.OData.Model.Importance" />
- <Property Name="Categories" Type="Collection(Edm.String)" />
- <Property Name="HasAttachments" Type="Edm.Boolean" />
- <Property Name="DateTimeCreated" Type="Edm.DateTimeOffset" />
- <Property Name="LastModifiedTime" Type="Edm.DateTimeOffset" />
- <NavigationProperty Name="Attachments" Type="Collection(Microsoft.Exchange.Services.OData.Model.Attachment)" />
- </EntityType>
- <EntityType Name="EmailMessage" BaseType="Microsoft.Exchange.Services.OData.Model.Item">
- <Property Name="ParentFolderId" Type="Edm.String" />
- <Property Name="From" Type="Microsoft.Exchange.Services.OData.Model.Recipient" />
- <Property Name="Sender" Type="Microsoft.Exchange.Services.OData.Model.Recipient" />
- <Property Name="ToRecipients" Type="Collection(Microsoft.Exchange.Services.OData.Model.Recipient)" />
- <Property Name="CcRecipients" Type="Collection(Microsoft.Exchange.Services.OData.Model.Recipient)" />
- <Property Name="BccRecipients" Type="Collection(Microsoft.Exchange.Services.OData.Model.Recipient)" />
- <Property Name="ReplyTo" Type="Collection(Microsoft.Exchange.Services.OData.Model.Recipient)" />
- <Property Name="ConversationIndex" Type="Edm.String" />
- <Property Name="UniqueBody" Type="Microsoft.Exchange.Services.OData.Model.ItemBody" />
- <Property Name="DateTimeReceived" Type="Edm.DateTimeOffset" />
- <Property Name="DateTimeSent" Type="Edm.DateTimeOffset" />
- <Property Name="IsDeliveryReceiptRequested" Type="Edm.Boolean" />
- <Property Name="IsReadReceiptRequested" Type="Edm.Boolean" />
- <Property Name="IsDraft" Type="Edm.Boolean" />
- <Property Name="IsRead" Type="Edm.Boolean" />
- </EntityType>
- <Action Name="Copy" IsBound="true" EntitySetPath="bindingParameter" ReturnType="Microsoft.Exchange.Services.OData.Model.EmailMessage">
- <Parameter Name="bindingParameter" Type="Microsoft.Exchange.Services.OData.Model.EmailMessage" />
- <Parameter Name="DestinationId" Type="Edm.String" />
- </Action>
- <Action Name="Move" IsBound="true" EntitySetPath="bindingParameter" ReturnType="Microsoft.Exchange.Services.OData.Model.EmailMessage">
- <Parameter Name="bindingParameter" Type="Microsoft.Exchange.Services.OData.Model.EmailMessage" />
- <Parameter Name="DestinationId" Type="Edm.String" />
- </Action>
- <EntityType Name="Attachment" BaseType="Microsoft.Exchange.Services.OData.Model.Entity" Abstract="true">
- <Property Name="Name" Type="Edm.String" />
- <Property Name="ContentType" Type="Edm.String" />
- <Property Name="IsInline" Type="Edm.Boolean" Nullable="false" />
- <Property Name="LastModifiedTime" Type="Edm.DateTimeOffset" />
- </EntityType>
- <EntityType Name="FileAttachment" BaseType="Microsoft.Exchange.Services.OData.Model.Attachment">
- <Property Name="ContentId" Type="Edm.String" />
- <Property Name="ContentLocation" Type="Edm.String" />
- <Property Name="Size" Type="Edm.Int32" Nullable="false" />
- <Property Name="IsContactPhoto" Type="Edm.Boolean" Nullable="false" />
- <Property Name="ContentBytes" Type="Edm.Binary" MaxLength="Max" FixedLength="false" />
- </EntityType>
- <EntityType Name="ItemAttachment" BaseType="Microsoft.Exchange.Services.OData.Model.Attachment">
- <NavigationProperty Name="Item" Type="Microsoft.Exchange.Services.OData.Model.Item" />
- </EntityType>
- <EntityType Name="Calendar" BaseType="Microsoft.Exchange.Services.OData.Model.Entity">
- <Property Name="Name" Type="Edm.String" />
- <Property Name="ChangeKey" Type="Edm.String" />
- <NavigationProperty Name="Events" Type="Collection(Microsoft.Exchange.Services.OData.Model.Event)" />
- </EntityType>
- <EntityType Name="CalendarGroup" BaseType="Microsoft.Exchange.Services.OData.Model.Entity">
- <Property Name="Name" Type="Edm.String" />
- <Property Name="ChangeKey" Type="Edm.String" />
- <Property Name="ClassId" Type="Edm.Guid" />
- </EntityType>
- <EntityType Name="Event" BaseType="Microsoft.Exchange.Services.OData.Model.Item">
- <Property Name="Start" Type="Edm.DateTimeOffset" />
- <Property Name="End" Type="Edm.DateTimeOffset" />
- <Property Name="Location" Type="Microsoft.Exchange.Services.OData.Model.Location" />
- <Property Name="ShowAs" Type="Microsoft.Exchange.Services.OData.Model.FreeBusyStatus" />
- <Property Name="IsAllDay" Type="Edm.Boolean" />
- <Property Name="IsCancelled" Type="Edm.Boolean" />
- <Property Name="IsOrganizer" Type="Edm.Boolean" />
- <Property Name="ResponseRequested" Type="Edm.Boolean" />
- <Property Name="Type" Type="Microsoft.Exchange.Services.OData.Model.EventType" />
- <Property Name="SeriesId" Type="Edm.String" />
- <Property Name="Attendees" Type="Collection(Microsoft.Exchange.Services.OData.Model.Attendee)" />
- <NavigationProperty Name="Calendar" Type="Microsoft.Exchange.Services.OData.Model.Calendar" />
- </EntityType>
- <EntityContainer Name="EntityContainer" m:IsDefaultEntityContainer="true">
- <EntitySet Name="Users" EntityType="Microsoft.Exchange.Services.OData.Model.User">
- <NavigationPropertyBinding Path="Folders" Target="Folders" />
- <NavigationPropertyBinding Path="Messages" Target="Messages" />
- <NavigationPropertyBinding Path="RootFolder" Target="Folders" />
- <NavigationPropertyBinding Path="Inbox" Target="Folders" />
- <NavigationPropertyBinding Path="Drafts" Target="Folders" />
- <NavigationPropertyBinding Path="SentItems" Target="Folders" />
- <NavigationPropertyBinding Path="DeletedItems" Target="Folders" />
- <NavigationPropertyBinding Path="Calendars" Target="Calendars" />
- <NavigationPropertyBinding Path="CalendarGroups" Target="CalendarGroups" />
- <NavigationPropertyBinding Path="Events" Target="Events" />
- </EntitySet>
- <EntitySet Name="Folders" EntityType="Microsoft.Exchange.Services.OData.Model.Folder">
- <NavigationPropertyBinding Path="ChildFolders" Target="Folders" />
- <NavigationPropertyBinding Path="Messages" Target="Messages" />
- </EntitySet>
- <EntitySet Name="Items" EntityType="Microsoft.Exchange.Services.OData.Model.Item" />
- <EntitySet Name="Messages" EntityType="Microsoft.Exchange.Services.OData.Model.EmailMessage">
- <NavigationPropertyBinding Path="Attachments" Target="Attachments" />
- </EntitySet>
- <EntitySet Name="Attachments" EntityType="Microsoft.Exchange.Services.OData.Model.Attachment">
- <NavigationPropertyBinding Path="Microsoft.Exchange.Services.OData.Model.ItemAttachment/Item" Target="Items" />
- </EntitySet>
- <EntitySet Name="Calendars" EntityType="Microsoft.Exchange.Services.OData.Model.Calendar">
- <NavigationPropertyBinding Path="Events" Target="Events" />
- </EntitySet>
- <EntitySet Name="CalendarGroups" EntityType="Microsoft.Exchange.Services.OData.Model.CalendarGroup" />
- <EntitySet Name="Events" EntityType="Microsoft.Exchange.Services.OData.Model.Event">
- <NavigationPropertyBinding Path="Attachments" Target="Attachments" />
- <NavigationPropertyBinding Path="Calendar" Target="Calendars" />
- </EntitySet>
- </EntityContainer>
- </Schema>
- </edmx:DataServices>
-</edmx:Edmx>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/northwind-metadata.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/northwind-metadata.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/northwind-metadata.xml
deleted file mode 100644
index f65815d..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/northwind-metadata.xml
+++ /dev/null
@@ -1,471 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
- <edmx:DataServices>
- <Schema Namespace="NorthwindModel" xmlns="http://docs.oasis-open.org/odata/ns/edm">
- <EntityType Name="Category">
- <Key>
- <PropertyRef Name="CategoryID" />
- </Key>
- <Property Name="CategoryID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
- <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
- <Property Name="Description" Type="Edm.String" MaxLength="max" />
- <Property Name="Picture" Type="Edm.Binary" MaxLength="max" />
- <NavigationProperty Name="Products" Type="Collection(NorthwindModel.Product)" Partner="Category" />
- </EntityType>
- <EntityType Name="CustomerDemographic">
- <Key>
- <PropertyRef Name="CustomerTypeID" />
- </Key>
- <Property Name="CustomerTypeID" Type="Edm.String" Nullable="false" MaxLength="10" />
- <Property Name="CustomerDesc" Type="Edm.String" MaxLength="max" />
- <NavigationProperty Name="Customers" Type="Collection(NorthwindModel.Customer)" Partner="CustomerDemographics" />
- </EntityType>
- <EntityType Name="Customer">
- <Key>
- <PropertyRef Name="CustomerID" />
- </Key>
- <Property Name="CustomerID" Type="Edm.String" Nullable="false" MaxLength="5" />
- <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="ContactName" Type="Edm.String" MaxLength="30" />
- <Property Name="ContactTitle" Type="Edm.String" MaxLength="30" />
- <Property Name="Address" Type="Edm.String" MaxLength="60" />
- <Property Name="City" Type="Edm.String" MaxLength="15" />
- <Property Name="Region" Type="Edm.String" MaxLength="15" />
- <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
- <Property Name="Country" Type="Edm.String" MaxLength="15" />
- <Property Name="Phone" Type="Edm.String" MaxLength="24" />
- <Property Name="Fax" Type="Edm.String" MaxLength="24" />
- <NavigationProperty Name="Orders" Type="Collection(NorthwindModel.Order)" Partner="Customer" />
- <NavigationProperty Name="CustomerDemographics" Type="Collection(NorthwindModel.CustomerDemographic)" Partner="Customers" />
- </EntityType>
- <EntityType Name="Employee">
- <Key>
- <PropertyRef Name="EmployeeID" />
- </Key>
- <Property Name="EmployeeID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
- <Property Name="LastName" Type="Edm.String" Nullable="false" MaxLength="20" />
- <Property Name="FirstName" Type="Edm.String" Nullable="false" MaxLength="10" />
- <Property Name="Title" Type="Edm.String" MaxLength="30" />
- <Property Name="TitleOfCourtesy" Type="Edm.String" MaxLength="25" />
- <Property Name="BirthDate" Type="Edm.DateTimeOffset" />
- <Property Name="HireDate" Type="Edm.DateTimeOffset" />
- <Property Name="Address" Type="Edm.String" MaxLength="60" />
- <Property Name="City" Type="Edm.String" MaxLength="15" />
- <Property Name="Region" Type="Edm.String" MaxLength="15" />
- <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
- <Property Name="Country" Type="Edm.String" MaxLength="15" />
- <Property Name="HomePhone" Type="Edm.String" MaxLength="24" />
- <Property Name="Extension" Type="Edm.String" MaxLength="4" />
- <Property Name="Photo" Type="Edm.Binary" MaxLength="max" />
- <Property Name="Notes" Type="Edm.String" MaxLength="max" />
- <Property Name="ReportsTo" Type="Edm.Int32" />
- <Property Name="PhotoPath" Type="Edm.String" MaxLength="255" />
- <NavigationProperty Name="Employees1" Type="Collection(NorthwindModel.Employee)" Partner="Employee1" />
- <NavigationProperty Name="Employee1" Type="NorthwindModel.Employee" Partner="Employees1">
- <ReferentialConstraint Property="ReportsTo" ReferencedProperty="EmployeeID" />
- </NavigationProperty>
- <NavigationProperty Name="Orders" Type="Collection(NorthwindModel.Order)" Partner="Employee" />
- <NavigationProperty Name="Territories" Type="Collection(NorthwindModel.Territory)" Partner="Employees" />
- </EntityType>
- <EntityType Name="Order_Detail">
- <Key>
- <PropertyRef Name="OrderID" />
- <PropertyRef Name="ProductID" />
- </Key>
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
- <Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" />
- <Property Name="Quantity" Type="Edm.Int16" Nullable="false" />
- <Property Name="Discount" Type="Edm.Single" Nullable="false" />
- <NavigationProperty Name="Order" Type="NorthwindModel.Order" Nullable="false" Partner="Order_Details">
- <ReferentialConstraint Property="OrderID" ReferencedProperty="OrderID" />
- </NavigationProperty>
- <NavigationProperty Name="Product" Type="NorthwindModel.Product" Nullable="false" Partner="Order_Details">
- <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID" />
- </NavigationProperty>
- </EntityType>
- <EntityType Name="Order">
- <Key>
- <PropertyRef Name="OrderID" />
- </Key>
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
- <Property Name="CustomerID" Type="Edm.String" MaxLength="5" />
- <Property Name="EmployeeID" Type="Edm.Int32" />
- <Property Name="OrderDate" Type="Edm.DateTimeOffset" />
- <Property Name="RequiredDate" Type="Edm.DateTimeOffset" />
- <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
- <Property Name="ShipVia" Type="Edm.Int32" />
- <Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" />
- <Property Name="ShipName" Type="Edm.String" MaxLength="40" />
- <Property Name="ShipAddress" Type="Edm.String" MaxLength="60" />
- <Property Name="ShipCity" Type="Edm.String" MaxLength="15" />
- <Property Name="ShipRegion" Type="Edm.String" MaxLength="15" />
- <Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" />
- <Property Name="ShipCountry" Type="Edm.String" MaxLength="15" />
- <NavigationProperty Name="Customer" Type="NorthwindModel.Customer" Partner="Orders">
- <ReferentialConstraint Property="CustomerID" ReferencedProperty="CustomerID" />
- </NavigationProperty>
- <NavigationProperty Name="Employee" Type="NorthwindModel.Employee" Partner="Orders">
- <ReferentialConstraint Property="EmployeeID" ReferencedProperty="EmployeeID" />
- </NavigationProperty>
- <NavigationProperty Name="Order_Details" Type="Collection(NorthwindModel.Order_Detail)" Partner="Order" />
- <NavigationProperty Name="Shipper" Type="NorthwindModel.Shipper" Partner="Orders">
- <ReferentialConstraint Property="ShipVia" ReferencedProperty="ShipperID" />
- </NavigationProperty>
- </EntityType>
- <EntityType Name="Product">
- <Key>
- <PropertyRef Name="ProductID" />
- </Key>
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
- <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="SupplierID" Type="Edm.Int32" />
- <Property Name="CategoryID" Type="Edm.Int32" />
- <Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" />
- <Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
- <Property Name="UnitsInStock" Type="Edm.Int16" />
- <Property Name="UnitsOnOrder" Type="Edm.Int16" />
- <Property Name="ReorderLevel" Type="Edm.Int16" />
- <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" />
- <NavigationProperty Name="Category" Type="NorthwindModel.Category" Partner="Products">
- <ReferentialConstraint Property="CategoryID" ReferencedProperty="CategoryID" />
- </NavigationProperty>
- <NavigationProperty Name="Order_Details" Type="Collection(NorthwindModel.Order_Detail)" Partner="Product" />
- <NavigationProperty Name="Supplier" Type="NorthwindModel.Supplier" Partner="Products">
- <ReferentialConstraint Property="SupplierID" ReferencedProperty="SupplierID" />
- </NavigationProperty>
- </EntityType>
- <EntityType Name="Region">
- <Key>
- <PropertyRef Name="RegionID" />
- </Key>
- <Property Name="RegionID" Type="Edm.Int32" Nullable="false" />
- <Property Name="RegionDescription" Type="Edm.String" Nullable="false" MaxLength="50" />
- <NavigationProperty Name="Territories" Type="Collection(NorthwindModel.Territory)" Partner="Region" />
- </EntityType>
- <EntityType Name="Shipper">
- <Key>
- <PropertyRef Name="ShipperID" />
- </Key>
- <Property Name="ShipperID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
- <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="Phone" Type="Edm.String" MaxLength="24" />
- <NavigationProperty Name="Orders" Type="Collection(NorthwindModel.Order)" Partner="Shipper" />
- </EntityType>
- <EntityType Name="Supplier">
- <Key>
- <PropertyRef Name="SupplierID" />
- </Key>
- <Property Name="SupplierID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
- <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="ContactName" Type="Edm.String" MaxLength="30" />
- <Property Name="ContactTitle" Type="Edm.String" MaxLength="30" />
- <Property Name="Address" Type="Edm.String" MaxLength="60" />
- <Property Name="City" Type="Edm.String" MaxLength="15" />
- <Property Name="Region" Type="Edm.String" MaxLength="15" />
- <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
- <Property Name="Country" Type="Edm.String" MaxLength="15" />
- <Property Name="Phone" Type="Edm.String" MaxLength="24" />
- <Property Name="Fax" Type="Edm.String" MaxLength="24" />
- <Property Name="HomePage" Type="Edm.String" MaxLength="max" />
- <NavigationProperty Name="Products" Type="Collection(NorthwindModel.Product)" Partner="Supplier" />
- </EntityType>
- <EntityType Name="Territory">
- <Key>
- <PropertyRef Name="TerritoryID" />
- </Key>
- <Property Name="TerritoryID" Type="Edm.String" Nullable="false" MaxLength="20" />
- <Property Name="TerritoryDescription" Type="Edm.String" Nullable="false" MaxLength="50" />
- <Property Name="RegionID" Type="Edm.Int32" Nullable="false" />
- <NavigationProperty Name="Region" Type="NorthwindModel.Region" Nullable="false" Partner="Territories">
- <ReferentialConstraint Property="RegionID" ReferencedProperty="RegionID" />
- </NavigationProperty>
- <NavigationProperty Name="Employees" Type="Collection(NorthwindModel.Employee)" Partner="Territories" />
- </EntityType>
- <EntityType Name="Alphabetical_list_of_product">
- <Key>
- <PropertyRef Name="CategoryName" />
- <PropertyRef Name="Discontinued" />
- <PropertyRef Name="ProductID" />
- <PropertyRef Name="ProductName" />
- </Key>
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="SupplierID" Type="Edm.Int32" />
- <Property Name="CategoryID" Type="Edm.Int32" />
- <Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" />
- <Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
- <Property Name="UnitsInStock" Type="Edm.Int16" />
- <Property Name="UnitsOnOrder" Type="Edm.Int16" />
- <Property Name="ReorderLevel" Type="Edm.Int16" />
- <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" />
- <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
- </EntityType>
- <EntityType Name="Category_Sales_for_1997">
- <Key>
- <PropertyRef Name="CategoryName" />
- </Key>
- <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
- <Property Name="CategorySales" Type="Edm.Decimal" Precision="19" Scale="4" />
- </EntityType>
- <EntityType Name="Current_Product_List">
- <Key>
- <PropertyRef Name="ProductID" />
- <PropertyRef Name="ProductName" />
- </Key>
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" p5:StoreGeneratedPattern="Identity" xmlns:p5="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />
- <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
- </EntityType>
- <EntityType Name="Customer_and_Suppliers_by_City">
- <Key>
- <PropertyRef Name="CompanyName" />
- <PropertyRef Name="Relationship" />
- </Key>
- <Property Name="City" Type="Edm.String" MaxLength="15" />
- <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="ContactName" Type="Edm.String" MaxLength="30" />
- <Property Name="Relationship" Type="Edm.String" Nullable="false" MaxLength="9" Unicode="false" />
- </EntityType>
- <EntityType Name="Invoice">
- <Key>
- <PropertyRef Name="CustomerName" />
- <PropertyRef Name="Discount" />
- <PropertyRef Name="OrderID" />
- <PropertyRef Name="ProductID" />
- <PropertyRef Name="ProductName" />
- <PropertyRef Name="Quantity" />
- <PropertyRef Name="Salesperson" />
- <PropertyRef Name="ShipperName" />
- <PropertyRef Name="UnitPrice" />
- </Key>
- <Property Name="ShipName" Type="Edm.String" MaxLength="40" />
- <Property Name="ShipAddress" Type="Edm.String" MaxLength="60" />
- <Property Name="ShipCity" Type="Edm.String" MaxLength="15" />
- <Property Name="ShipRegion" Type="Edm.String" MaxLength="15" />
- <Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" />
- <Property Name="ShipCountry" Type="Edm.String" MaxLength="15" />
- <Property Name="CustomerID" Type="Edm.String" MaxLength="5" />
- <Property Name="CustomerName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="Address" Type="Edm.String" MaxLength="60" />
- <Property Name="City" Type="Edm.String" MaxLength="15" />
- <Property Name="Region" Type="Edm.String" MaxLength="15" />
- <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
- <Property Name="Country" Type="Edm.String" MaxLength="15" />
- <Property Name="Salesperson" Type="Edm.String" Nullable="false" MaxLength="31" />
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="OrderDate" Type="Edm.DateTimeOffset" />
- <Property Name="RequiredDate" Type="Edm.DateTimeOffset" />
- <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
- <Property Name="ShipperName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" />
- <Property Name="Quantity" Type="Edm.Int16" Nullable="false" />
- <Property Name="Discount" Type="Edm.Single" Nullable="false" />
- <Property Name="ExtendedPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
- <Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" />
- </EntityType>
- <EntityType Name="Order_Details_Extended">
- <Key>
- <PropertyRef Name="Discount" />
- <PropertyRef Name="OrderID" />
- <PropertyRef Name="ProductID" />
- <PropertyRef Name="ProductName" />
- <PropertyRef Name="Quantity" />
- <PropertyRef Name="UnitPrice" />
- </Key>
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" />
- <Property Name="Quantity" Type="Edm.Int16" Nullable="false" />
- <Property Name="Discount" Type="Edm.Single" Nullable="false" />
- <Property Name="ExtendedPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
- </EntityType>
- <EntityType Name="Order_Subtotal">
- <Key>
- <PropertyRef Name="OrderID" />
- </Key>
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" />
- </EntityType>
- <EntityType Name="Orders_Qry">
- <Key>
- <PropertyRef Name="CompanyName" />
- <PropertyRef Name="OrderID" />
- </Key>
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="CustomerID" Type="Edm.String" MaxLength="5" />
- <Property Name="EmployeeID" Type="Edm.Int32" />
- <Property Name="OrderDate" Type="Edm.DateTimeOffset" />
- <Property Name="RequiredDate" Type="Edm.DateTimeOffset" />
- <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
- <Property Name="ShipVia" Type="Edm.Int32" />
- <Property Name="Freight" Type="Edm.Decimal" Precision="19" Scale="4" />
- <Property Name="ShipName" Type="Edm.String" MaxLength="40" />
- <Property Name="ShipAddress" Type="Edm.String" MaxLength="60" />
- <Property Name="ShipCity" Type="Edm.String" MaxLength="15" />
- <Property Name="ShipRegion" Type="Edm.String" MaxLength="15" />
- <Property Name="ShipPostalCode" Type="Edm.String" MaxLength="10" />
- <Property Name="ShipCountry" Type="Edm.String" MaxLength="15" />
- <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="Address" Type="Edm.String" MaxLength="60" />
- <Property Name="City" Type="Edm.String" MaxLength="15" />
- <Property Name="Region" Type="Edm.String" MaxLength="15" />
- <Property Name="PostalCode" Type="Edm.String" MaxLength="10" />
- <Property Name="Country" Type="Edm.String" MaxLength="15" />
- </EntityType>
- <EntityType Name="Product_Sales_for_1997">
- <Key>
- <PropertyRef Name="CategoryName" />
- <PropertyRef Name="ProductName" />
- </Key>
- <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
- <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="ProductSales" Type="Edm.Decimal" Precision="19" Scale="4" />
- </EntityType>
- <EntityType Name="Products_Above_Average_Price">
- <Key>
- <PropertyRef Name="ProductName" />
- </Key>
- <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="UnitPrice" Type="Edm.Decimal" Precision="19" Scale="4" />
- </EntityType>
- <EntityType Name="Products_by_Category">
- <Key>
- <PropertyRef Name="CategoryName" />
- <PropertyRef Name="Discontinued" />
- <PropertyRef Name="ProductName" />
- </Key>
- <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
- <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="QuantityPerUnit" Type="Edm.String" MaxLength="20" />
- <Property Name="UnitsInStock" Type="Edm.Int16" />
- <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" />
- </EntityType>
- <EntityType Name="Sales_by_Category">
- <Key>
- <PropertyRef Name="CategoryID" />
- <PropertyRef Name="CategoryName" />
- <PropertyRef Name="ProductName" />
- </Key>
- <Property Name="CategoryID" Type="Edm.Int32" Nullable="false" />
- <Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" />
- <Property Name="ProductName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="ProductSales" Type="Edm.Decimal" Precision="19" Scale="4" />
- </EntityType>
- <EntityType Name="Sales_Totals_by_Amount">
- <Key>
- <PropertyRef Name="CompanyName" />
- <PropertyRef Name="OrderID" />
- </Key>
- <Property Name="SaleAmount" Type="Edm.Decimal" Precision="19" Scale="4" />
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="CompanyName" Type="Edm.String" Nullable="false" MaxLength="40" />
- <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
- </EntityType>
- <EntityType Name="Summary_of_Sales_by_Quarter">
- <Key>
- <PropertyRef Name="OrderID" />
- </Key>
- <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" />
- </EntityType>
- <EntityType Name="Summary_of_Sales_by_Year">
- <Key>
- <PropertyRef Name="OrderID" />
- </Key>
- <Property Name="ShippedDate" Type="Edm.DateTimeOffset" />
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Subtotal" Type="Edm.Decimal" Precision="19" Scale="4" />
- </EntityType>
- <Annotations Target="ODataWebExperimental.Northwind.Model.NorthwindEntities">
- <Annotation Term="Com.Microsoft.OData.Service.Conventions.V1.UrlConventions" String="KeyAsSegment" />
- </Annotations>
- </Schema>
- <Schema Namespace="ODataWebExperimental.Northwind.Model" xmlns="http://docs.oasis-open.org/odata/ns/edm">
- <EntityContainer Name="NorthwindEntities" p4:LazyLoadingEnabled="true" xmlns:p4="http://schemas.microsoft.com/ado/2009/02/edm/annotation">
- <EntitySet Name="Categories" EntityType="NorthwindModel.Category">
- <NavigationPropertyBinding Path="Products" Target="Products" />
- </EntitySet>
- <EntitySet Name="CustomerDemographics" EntityType="NorthwindModel.CustomerDemographic">
- <NavigationPropertyBinding Path="Customers" Target="Customers" />
- </EntitySet>
- <EntitySet Name="Customers" EntityType="NorthwindModel.Customer">
- <NavigationPropertyBinding Path="CustomerDemographics" Target="CustomerDemographics" />
- <NavigationPropertyBinding Path="Orders" Target="Orders" />
- </EntitySet>
- <EntitySet Name="Employees" EntityType="NorthwindModel.Employee">
- <NavigationPropertyBinding Path="Employees1" Target="Employees" />
- <NavigationPropertyBinding Path="Employee1" Target="Employees" />
- <NavigationPropertyBinding Path="Orders" Target="Orders" />
- <NavigationPropertyBinding Path="Territories" Target="Territories" />
- </EntitySet>
- <EntitySet Name="Order_Details" EntityType="NorthwindModel.Order_Detail">
- <NavigationPropertyBinding Path="Order" Target="Orders" />
- <NavigationPropertyBinding Path="Product" Target="Products" />
- </EntitySet>
- <EntitySet Name="Orders" EntityType="NorthwindModel.Order">
- <NavigationPropertyBinding Path="Customer" Target="Customers" />
- <NavigationPropertyBinding Path="Employee" Target="Employees" />
- <NavigationPropertyBinding Path="Order_Details" Target="Order_Details" />
- <NavigationPropertyBinding Path="Shipper" Target="Shippers" />
- </EntitySet>
- <EntitySet Name="Products" EntityType="NorthwindModel.Product">
- <NavigationPropertyBinding Path="Category" Target="Categories" />
- <NavigationPropertyBinding Path="Order_Details" Target="Order_Details" />
- <NavigationPropertyBinding Path="Supplier" Target="Suppliers" />
- </EntitySet>
- <EntitySet Name="Regions" EntityType="NorthwindModel.Region">
- <NavigationPropertyBinding Path="Territories" Target="Territories" />
- </EntitySet>
- <EntitySet Name="Shippers" EntityType="NorthwindModel.Shipper">
- <NavigationPropertyBinding Path="Orders" Target="Orders" />
- </EntitySet>
- <EntitySet Name="Suppliers" EntityType="NorthwindModel.Supplier">
- <NavigationPropertyBinding Path="Products" Target="Products" />
- </EntitySet>
- <EntitySet Name="Territories" EntityType="NorthwindModel.Territory">
- <NavigationPropertyBinding Path="Employees" Target="Employees" />
- <NavigationPropertyBinding Path="Region" Target="Regions" />
- </EntitySet>
- <EntitySet Name="Alphabetical_list_of_products" EntityType="NorthwindModel.Alphabetical_list_of_product" />
- <EntitySet Name="Category_Sales_for_1997" EntityType="NorthwindModel.Category_Sales_for_1997" />
- <EntitySet Name="Current_Product_Lists" EntityType="NorthwindModel.Current_Product_List" />
- <EntitySet Name="Customer_and_Suppliers_by_Cities" EntityType="NorthwindModel.Customer_and_Suppliers_by_City" />
- <EntitySet Name="Invoices" EntityType="NorthwindModel.Invoice" />
- <EntitySet Name="Order_Details_Extendeds" EntityType="NorthwindModel.Order_Details_Extended" />
- <EntitySet Name="Order_Subtotals" EntityType="NorthwindModel.Order_Subtotal" />
- <EntitySet Name="Orders_Qries" EntityType="NorthwindModel.Orders_Qry" />
- <EntitySet Name="Product_Sales_for_1997" EntityType="NorthwindModel.Product_Sales_for_1997" />
- <EntitySet Name="Products_Above_Average_Prices" EntityType="NorthwindModel.Products_Above_Average_Price" />
- <EntitySet Name="Products_by_Categories" EntityType="NorthwindModel.Products_by_Category" />
- <EntitySet Name="Sales_by_Categories" EntityType="NorthwindModel.Sales_by_Category" />
- <EntitySet Name="Sales_Totals_by_Amounts" EntityType="NorthwindModel.Sales_Totals_by_Amount" />
- <EntitySet Name="Summary_of_Sales_by_Quarters" EntityType="NorthwindModel.Summary_of_Sales_by_Quarter" />
- <EntitySet Name="Summary_of_Sales_by_Years" EntityType="NorthwindModel.Summary_of_Sales_by_Year" />
- </EntityContainer>
- </Schema>
- </edmx:DataServices>
-</edmx:Edmx>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/serviceDocument.json
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/serviceDocument.json b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/serviceDocument.json
deleted file mode 100644
index 2e7f066..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/serviceDocument.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "@odata.context": "http://host/service/$metadata",
- "value": [
- {
- "name": "Orders",
- "kind": "EntitySet",
- "url": "Orders"
- },
- {
- "name": "OrderItems",
- "title": "Order Details",
- "url": "OrderItems"
- },
- {
- "name": "TopProducts",
- "title": "Best-Selling Products",
- "kind": "FunctionImport",
- "url": "TopProducts"
- },
- {
- "name": "Contoso",
- "title": "Contoso Ltd.",
- "kind": "Singleton",
- "url": "Contoso"
- },
- {
- "name": "Human Resources",
- "kind": "ServiceDocument",
- "url": "http://host/HR/"
- }
- ]
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/serviceDocument.xml
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/serviceDocument.xml b/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/serviceDocument.xml
deleted file mode 100644
index faddf9c..0000000
--- a/lib/client-core/src/test/resources/org/apache/olingo/odata4/client/core/v4/serviceDocument.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
- 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.
-
--->
-<app:service xmlns:app="http://www.w3.org/2007/app"
- xmlns:atom="http://www.w3.org/2005/Atom"
- xmlns:metadata="http://docs.oasis-open.org/odata/ns/metadata"
- xml:base="http://host/service/"
- metadata:context="$metadata"
- metadata:metadata-etag="W/"MjAxMy0wNS0xM1QxNDo1NFo="">
- <app:workspace>
- <atom:title type="text">Data</atom:title>
- <app:collection href="Orders">
- <atom:title type="text">Orders</atom:title>
- </app:collection>
- <app:collection href="OrderItems">
- <atom:title type="text">Order Details</atom:title>
- </app:collection>
- <metadata:function-import href="TopProducts">
- <atom:title>Best-Selling Products</atom:title>
- </metadata:function-import>
- <metadata:singleton href="Contoso">
- <atom:title>Contoso Ltd.</atom:title>
- </metadata:singleton>
- <metadata:service-document href="http://host/HR/">
- <atom:title>Human Resources</atom:title>
- </metadata:service-document>
- </app:workspace>
-</app:service>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataApplicationException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataApplicationException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataApplicationException.java
new file mode 100644
index 0000000..eacac21
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataApplicationException.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.commons.api;
+
+public class ODataApplicationException extends Exception {
+
+ private static final long serialVersionUID = 5358683245923127425L;
+
+ public ODataApplicationException(final String msg) {
+ super(msg);
+ }
+
+ public ODataApplicationException(final String msg, final Throwable cause) {
+ super(msg, cause);
+ }
+
+ public ODataApplicationException(final Throwable cause) {
+ super(cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataException.java
new file mode 100644
index 0000000..334b83f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataException.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.commons.api;
+
+public class ODataException extends Exception {
+
+ private static final long serialVersionUID = 3057981437954048107L;
+
+ public ODataException(final String msg) {
+ super(msg);
+ }
+
+ public ODataException(final String msg, final Throwable cause) {
+ super(msg, cause);
+ }
+
+ public ODataException(final Throwable cause) {
+ super(cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataNotImplementedException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataNotImplementedException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataNotImplementedException.java
new file mode 100644
index 0000000..8cb8096
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/ODataNotImplementedException.java
@@ -0,0 +1,33 @@
+/*
+ * 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.commons.api;
+
+public class ODataNotImplementedException extends ODataException {
+
+ private static final long serialVersionUID = 3921772210762644762L;
+
+ public ODataNotImplementedException(final String msg) {
+ super(msg);
+ }
+
+ public ODataNotImplementedException() {
+ super("Not implemented");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Edm.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Edm.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Edm.java
new file mode 100644
index 0000000..d9ee17b
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Edm.java
@@ -0,0 +1,111 @@
+/*
+ * 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.commons.api.edm;
+
+import java.util.List;
+
+/**
+ * Entity Data Model (EDM)
+ * <br/>
+ * Interface representing a Entity Data Model as described in the Conceptual Schema Definition.
+ */
+public interface Edm {
+
+ /**
+ * Get entity container by full qualified name.
+ * <br/>
+ * See {@link EdmEntityContainer} for more information.
+ *
+ * @param name
+ * @return {@link EdmEntityContainer}
+ */
+ EdmEntityContainer getEntityContainer(FullQualifiedName name);
+
+ /**
+ * Get enum type by full qualified name.
+ * <br/>
+ * See {@link EdmEnumType} for more information
+ *
+ * @param name
+ * @return {@link EdmEnumType}
+ */
+ EdmEnumType getEnumType(FullQualifiedName name);
+
+ /**
+ * Get a type definition by full qualified name.
+ * <br/>
+ * See {@link EdmTypeDefinition} for more information
+ *
+ * @param name
+ * @return {@link EdmTypeDefinition}
+ */
+ EdmTypeDefinition getTypeDefinition(FullQualifiedName name);
+
+ /**
+ * Get entity type by full qualified name.
+ * <br/>
+ * See {@link EdmEntityType} for more information.
+ *
+ * @param name
+ * @return {@link EdmEntityType}
+ */
+ EdmEntityType getEntityType(FullQualifiedName name);
+
+ /**
+ * Get complex type by full qualified name..
+ * <br/>
+ * See {@link EdmComplexType} for more information.
+ *
+ * @param name
+ * @return {@link EdmComplexType}
+ */
+ EdmComplexType getComplexType(FullQualifiedName name);
+
+ /**
+ * Get Action by full qualified name and binding parameter type.
+ *
+ * @param actionName must not be null
+ * @param bindingParameterTypeName may be null if it is an unbound action
+ * @param isBindingParameterCollection may be null if it is an unbound action
+ * @return {@link EdmAction}
+ */
+ EdmAction getAction(FullQualifiedName actionName, FullQualifiedName bindingParameterTypeName,
+ Boolean isBindingParameterCollection);
+
+ /**
+ * Get Function by full qualified name and binding parameter type and binding parameter names.
+ *
+ * @param functionName
+ * @param bindingParameterTypeName may be null if it is an unbound function
+ * @param isBindingParameterCollection may be null if it is an unbound function
+ * @param parameterNames may be null if it is an unbound function
+ * @return {@link EdmFunction}
+ */
+ EdmFunction getFunction(FullQualifiedName functionName, FullQualifiedName bindingParameterTypeName,
+ Boolean isBindingParameterCollection, List<String> parameterNames);
+
+ /**
+ * Get service metadata.
+ * <br/>
+ * See {@link EdmServiceMetadata} for more information.
+ *
+ * @return {@link EdmServiceMetadata}
+ */
+ EdmServiceMetadata getServiceMetadata();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAction.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAction.java
new file mode 100644
index 0000000..b267cc0
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAction.java
@@ -0,0 +1,26 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * A CSDL action.
+ */
+public interface EdmAction extends EdmOperation {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmActionImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmActionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmActionImport.java
new file mode 100644
index 0000000..428fbdf
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmActionImport.java
@@ -0,0 +1,27 @@
+/*
+ * 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.commons.api.edm;
+
+/**
+ * An EdmActionImport.
+ */
+public interface EdmActionImport extends EdmOperationImport {
+
+ EdmAction getAction();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmActionImportInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmActionImportInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmActionImportInfo.java
new file mode 100644
index 0000000..1af5ce6
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmActionImportInfo.java
@@ -0,0 +1,40 @@
+/*
+ * 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.commons.api.edm;
+
+import java.net.URI;
+
+/**
+ * Objects of this class contain information about one action import inside the EntityDataModel.
+ */
+public interface EdmActionImportInfo extends EdmOperationImportInfo {
+
+ /**
+ * @return the action import name
+ */
+ String getActionImportName();
+
+ /**
+ * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
+ * toASCIIString() method can be used.
+ *
+ * @return the uri to this function import
+ */
+ URI getActionImportUri();
+}
[47/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Term.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Term.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Term.java
new file mode 100644
index 0000000..59cdd29
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/Term.java
@@ -0,0 +1,44 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface Term extends Named {
+
+ List<CSDLElement> getAppliesTo();
+
+ String getBaseTerm();
+
+ String getDefaultValue();
+
+ Integer getMaxLength();
+
+ Integer getPrecision();
+
+ Integer getScale();
+
+ String getSrid();
+
+ String getType();
+
+ boolean isNullable();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/TypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/TypeDefinition.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/TypeDefinition.java
new file mode 100644
index 0000000..568c737
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/TypeDefinition.java
@@ -0,0 +1,40 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Named;
+
+public interface TypeDefinition extends Named {
+
+ List<Annotation> getAnnotations();
+
+ Integer getMaxLength();
+
+ Integer getPrecision();
+
+ Integer getScale();
+
+ String getSrid();
+
+ String getUnderlyingType();
+
+ boolean isUnicode();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/XMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/XMLMetadata.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/XMLMetadata.java
new file mode 100644
index 0000000..f3b619e
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/XMLMetadata.java
@@ -0,0 +1,36 @@
+/*
+ * 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.api.edm.xml.v4;
+
+import java.util.List;
+
+public interface XMLMetadata extends org.apache.olingo.client.api.edm.xml.XMLMetadata {
+
+ @Override
+ List<Schema> getSchemas();
+
+ @Override
+ Schema getSchema(int index);
+
+ @Override
+ Schema getSchema(String key);
+
+ List<Reference> getReferences();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ConstExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ConstExprConstruct.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ConstExprConstruct.java
new file mode 100644
index 0000000..e51b9e3
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ConstExprConstruct.java
@@ -0,0 +1,56 @@
+/*
+ * 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.api.edm.xml.v4.annotation;
+
+public interface ConstExprConstruct extends ExprConstruct {
+
+ public enum Type {
+
+ Binary,
+ Bool,
+ Date,
+ DateTimeOffset,
+ Decimal,
+ Duration,
+ EnumMember,
+ Float,
+ Guid,
+ Int,
+ String,
+ TimeOfDay;
+
+ public static Type fromString(final String value) {
+ Type result = null;
+ try {
+ result = valueOf(value);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ return result;
+ }
+ }
+
+ Type getType();
+
+ void setType(Type type);
+
+ String getValue();
+
+ void setValue(String value);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/DynExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/DynExprConstruct.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/DynExprConstruct.java
new file mode 100644
index 0000000..5baffa6
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/DynExprConstruct.java
@@ -0,0 +1,23 @@
+/*
+ * 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.api.edm.xml.v4.annotation;
+
+public interface DynExprConstruct extends ExprConstruct {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ExprConstruct.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ExprConstruct.java
new file mode 100644
index 0000000..4de83a7
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/edm/xml/v4/annotation/ExprConstruct.java
@@ -0,0 +1,23 @@
+/*
+ * 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.api.edm.xml.v4.annotation;
+
+public interface ExprConstruct {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataFormat.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataFormat.java
new file mode 100644
index 0000000..b7928e9
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataFormat.java
@@ -0,0 +1,97 @@
+/*
+ * 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.api.format;
+
+import org.apache.http.entity.ContentType;
+
+/**
+ * Available formats to be used in various contexts.
+ */
+public enum ODataFormat {
+
+ /**
+ * JSON format with no metadata.
+ */
+ JSON_NO_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=nometadata"),
+ /**
+ * JSON format with minimal metadata (default).
+ */
+ JSON(ContentType.APPLICATION_JSON.getMimeType() + ";odata=minimalmetadata"),
+ /**
+ * JSON format with no metadata.
+ */
+ JSON_FULL_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=fullmetadata"),
+ /**
+ * XML format.
+ */
+ XML(ContentType.APPLICATION_XML.getMimeType());
+
+ private final String format;
+
+ ODataFormat(final String format) {
+ this.format = format;
+ }
+
+ /**
+ * Gets format as a string.
+ *
+ * @return format as a string.
+ */
+ @Override
+ public String toString() {
+ return format;
+ }
+
+ /**
+ * Gets OData format from its string representation.
+ *
+ * @param format string representation of the format.
+ * @return OData format.
+ */
+ public static ODataFormat fromString(final String format) {
+ ODataFormat result = null;
+
+ final StringBuffer _format = new StringBuffer();
+
+ final String[] parts = format.split(";");
+ _format.append(parts[0]);
+ if (ContentType.APPLICATION_JSON.getMimeType().equals(parts[0])) {
+ if (parts.length > 1) {
+ _format.append(';').append(parts[1]);
+ } else {
+ result = ODataFormat.JSON;
+ }
+ }
+
+ if (result == null) {
+ final String candidate = _format.toString();
+ for (ODataFormat value : values()) {
+ if (candidate.equals(value.toString())) {
+ result = value;
+ }
+ }
+ }
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unsupported format: " + format);
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataMediaFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataMediaFormat.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataMediaFormat.java
new file mode 100644
index 0000000..353edc4
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataMediaFormat.java
@@ -0,0 +1,71 @@
+/*
+ * 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.api.format;
+
+import org.apache.http.entity.ContentType;
+
+/**
+ * Available formats for media.
+ */
+public enum ODataMediaFormat {
+
+ CHARSET_PARAMETER("charset"),
+ MEDIA_TYPE_WILDCARD("*"),
+ WILDCARD("*/*"),
+ APPLICATION_XML(ContentType.APPLICATION_XML.getMimeType()),
+ APPLICATION_ATOM_XML(ContentType.APPLICATION_ATOM_XML.getMimeType()),
+ APPLICATION_XHTML_XML(ContentType.APPLICATION_XHTML_XML.getMimeType()),
+ APPLICATION_SVG_XML(ContentType.APPLICATION_SVG_XML.getMimeType()),
+ APPLICATION_JSON(ContentType.APPLICATION_JSON.getMimeType()),
+ APPLICATION_FORM_URLENCODED(ContentType.APPLICATION_FORM_URLENCODED.getMimeType()),
+ MULTIPART_FORM_DATA(ContentType.MULTIPART_FORM_DATA.getMimeType()),
+ APPLICATION_OCTET_STREAM(ContentType.APPLICATION_OCTET_STREAM.getMimeType()),
+ TEXT_PLAIN(ContentType.TEXT_PLAIN.getMimeType()),
+ TEXT_XML(ContentType.TEXT_XML.getMimeType()),
+ TEXT_HTML(ContentType.TEXT_HTML.getMimeType());
+
+ private final String format;
+
+ private ODataMediaFormat(final String format) {
+ this.format = format;
+ }
+
+ @Override
+ public String toString() {
+ return format;
+ }
+
+ public static ODataMediaFormat fromFormat(final String format) {
+ final String _format = format.split(";")[0];
+
+ ODataMediaFormat result = null;
+
+ for (ODataMediaFormat value : values()) {
+ if (_format.equals(value.toString())) {
+ result = value;
+ }
+ }
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unsupported format: " + format);
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataPubFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataPubFormat.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataPubFormat.java
new file mode 100644
index 0000000..2a89fd7
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataPubFormat.java
@@ -0,0 +1,97 @@
+/*
+ * 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.api.format;
+
+import org.apache.http.entity.ContentType;
+
+/**
+ * Available formats for AtomPub exchange.
+ */
+public enum ODataPubFormat {
+
+ /**
+ * JSON format with no metadata.
+ */
+ JSON_NO_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=nometadata"),
+ /**
+ * JSON format with minimal metadata (default).
+ */
+ JSON(ContentType.APPLICATION_JSON.getMimeType() + ";odata=minimalmetadata"),
+ /**
+ * JSON format with no metadata.
+ */
+ JSON_FULL_METADATA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=fullmetadata"),
+ /**
+ * Atom format.
+ */
+ ATOM(ContentType.APPLICATION_ATOM_XML.getMimeType());
+
+ private final String format;
+
+ ODataPubFormat(final String format) {
+ this.format = format;
+ }
+
+ /**
+ * Gets format as a string.
+ *
+ * @return format as a string.
+ */
+ @Override
+ public String toString() {
+ return format;
+ }
+
+ /**
+ * Gets OData format from its string representation.
+ *
+ * @param format string representation of the format.
+ * @return OData format.
+ */
+ public static ODataPubFormat fromString(final String format) {
+ ODataPubFormat result = null;
+
+ final StringBuffer _format = new StringBuffer();
+
+ final String[] parts = format.split(";");
+ _format.append(parts[0]);
+ if (ContentType.APPLICATION_JSON.getMimeType().equals(parts[0])) {
+ if (parts.length > 1 && parts[1].startsWith("odata=")) {
+ _format.append(';').append(parts[1]);
+ } else {
+ result = ODataPubFormat.JSON;
+ }
+ }
+
+ if (result == null) {
+ final String candidate = _format.toString();
+ for (ODataPubFormat value : values()) {
+ if (candidate.equals(value.toString())) {
+ result = value;
+ }
+ }
+ }
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unsupported format: " + format);
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataValueFormat.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataValueFormat.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataValueFormat.java
new file mode 100644
index 0000000..b04ce7d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/format/ODataValueFormat.java
@@ -0,0 +1,76 @@
+/*
+ * 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.api.format;
+
+import org.apache.http.entity.ContentType;
+
+/**
+ * Available formats for property values.
+ */
+public enum ODataValueFormat {
+
+ /**
+ * Application octet stream.
+ */
+ STREAM(ContentType.APPLICATION_OCTET_STREAM.getMimeType()),
+ /**
+ * Plain text format.
+ */
+ TEXT(ContentType.TEXT_PLAIN.getMimeType());
+
+ private final String format;
+
+ ODataValueFormat(final String format) {
+ this.format = format;
+ }
+
+ /**
+ * Gets format as a string.
+ *
+ * @return format as a string.
+ */
+ @Override
+ public String toString() {
+ return format;
+ }
+
+ /**
+ * Gets format from its string representation.
+ *
+ * @param format string representation of the format.
+ * @return OData format.
+ */
+ public static ODataValueFormat fromString(final String format) {
+ final String _format = format.split(";")[0];
+
+ ODataValueFormat result = null;
+
+ for (ODataValueFormat value : values()) {
+ if (_format.equals(value.toString())) {
+ result = value;
+ }
+ }
+
+ if (result == null) {
+ throw new IllegalArgumentException("Unsupported format: " + format);
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java
new file mode 100644
index 0000000..12e432b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientException.java
@@ -0,0 +1,68 @@
+/*
+ * 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.api.http;
+
+/**
+ * A client-side processing runtime exception.
+ *
+ * The exception is thrown during HTTP request invocation processing, to signal a failure to process the HTTP request or
+ * response. The exception message or nested {@link Throwable} cause SHOULD contain additional information about the
+ * reason of the processing failure.
+ */
+public class HttpClientException extends RuntimeException {
+
+ private static final long serialVersionUID = -4232431597816056514L;
+
+ /**
+ * Constructs a new client-side runtime exception with the specified cause and a detail message of
+ * {@code (cause==null ? null : cause.toString())} (which typically contains the class and detail message of
+ * {@code cause}). This constructor is useful for runtime exceptions that are little more than wrappers for other
+ * throwables.
+ *
+ * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null}
+ * value is permitted, and indicates that the cause is nonexistent or unknown.)
+ */
+ public HttpClientException(final Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new client-side runtime exception with the specified detail message and cause.
+ * <br/>
+ * Note that the detail message associated with {@code cause} is <i>not</i>
+ * automatically incorporated in this runtime exception's detail message.
+ *
+ * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null}
+ * value is permitted, and indicates that the cause is nonexistent or unknown.)
+ */
+ public HttpClientException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new client-side runtime exception with the specified detail message. The cause is not initialized, and
+ * may subsequently be initialized by a call to {@link #initCause}.
+ *
+ * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method).
+ */
+ public HttpClientException(final String message) {
+ super(message);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientFactory.java
new file mode 100644
index 0000000..367ef01
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpClientFactory.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.http;
+
+import java.net.URI;
+import org.apache.http.client.HttpClient;
+
+/**
+ * Interface used by ODataRequest implementations to instantiate HttpClient.
+ */
+public interface HttpClientFactory {
+
+ HttpClient createHttpClient(HttpMethod method, URI uri);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpMethod.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpMethod.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpMethod.java
new file mode 100644
index 0000000..df3f06a
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpMethod.java
@@ -0,0 +1,33 @@
+/*
+ * 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.api.http;
+
+/**
+ * Supported HTTP methods.
+ */
+public enum HttpMethod {
+
+ GET,
+ POST,
+ PUT,
+ PATCH,
+ MERGE,
+ DELETE;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpUriRequestFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpUriRequestFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpUriRequestFactory.java
new file mode 100644
index 0000000..1687045
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/HttpUriRequestFactory.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.http;
+
+import java.net.URI;
+import org.apache.http.client.methods.HttpUriRequest;
+
+/**
+ * Interface used by ODataRequest implementations to create the HttpUriRequest.
+ */
+public interface HttpUriRequestFactory {
+
+ HttpUriRequest createHttpUriRequest(HttpMethod method, URI uri);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/http/NoContentException.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/http/NoContentException.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/NoContentException.java
new file mode 100644
index 0000000..4daf92d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/http/NoContentException.java
@@ -0,0 +1,36 @@
+/*
+ * 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.api.http;
+
+import org.apache.http.HttpStatus;
+
+/**
+ * Exception to be thrown when trying to read content with HTTP status 204.
+ */
+public class NoContentException extends HttpClientException {
+
+ private static final long serialVersionUID = 7947066635285809192L;
+
+ /**
+ * Constructs a new client-side runtime exception, with fixed message.
+ */
+ public NoContentException() {
+ super("No content found when HTTP status is " + HttpStatus.SC_NO_CONTENT);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataBinder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataBinder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataBinder.java
new file mode 100644
index 0000000..94044f9
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataBinder.java
@@ -0,0 +1,122 @@
+/*
+ * 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.api.op;
+
+import java.io.Serializable;
+
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+
+public interface ODataBinder extends Serializable {
+
+ /**
+ * Gets <tt>ODataServiceDocument</tt> from the given service document resource.
+ *
+ * @param resource service document resource.
+ * @return <tt>ODataServiceDocument</tt> object.
+ */
+ ODataServiceDocument getODataServiceDocument(ServiceDocument resource);
+
+ /**
+ * Gets a <tt>FeedResource</tt> from the given OData entity set.
+ *
+ * @param <T> feed resource type.
+ * @param feed OData entity set.
+ * @param reference reference class.
+ * @return <tt>FeedResource</tt> object.
+ */
+// <T extends Feed> T getFeed(ODataEntitySet feed, Class<T> reference);
+ /**
+ * Gets an <tt>EntryResource</tt> from the given OData entity.
+ *
+ * @param <T> entry resource type.
+ * @param entity OData entity.
+ * @param reference reference class.
+ * @return <tt>EntryResource</tt> object.
+ */
+// <T extends Entry> T getEntry(ODataEntity entity, Class<T> reference);
+ /**
+ * Gets an <tt>EntryResource</tt> from the given OData entity.
+ *
+ * @param <T> entry resource type.
+ * @param entity OData entity.
+ * @param reference reference class.
+ * @param setType whether to explicitly output type information.
+ * @return <tt>EntryResource</tt> object.
+ */
+// <T extends Entry> T getEntry(ODataEntity entity, Class<T> reference, boolean setType);
+ /**
+ * Gets the given OData property as DOM element.
+ *
+ * @param prop OData property.
+ * @return <tt>Element</tt> object.
+ */
+// Element toDOMElement(ODataProperty prop);
+// ODataLinkCollection getLinkCollection(LinkCollection linkCollection);
+ /**
+ * Gets <tt>ODataEntitySet</tt> from the given feed resource.
+ *
+ * @param resource feed resource.
+ * @return <tt>ODataEntitySet</tt> object.
+ */
+// ODataEntitySet getODataEntitySet(Feed resource);
+ /**
+ * Gets <tt>ODataEntitySet</tt> from the given feed resource.
+ *
+ * @param resource feed resource.
+ * @param defaultBaseURI default base URI.
+ * @return <tt>ODataEntitySet</tt> object.
+ */
+// ODataEntitySet getODataEntitySet(Feed resource, URI defaultBaseURI);
+ /**
+ * Gets <tt>ODataEntity</tt> from the given entry resource.
+ *
+ * @param resource entry resource.
+ * @return <tt>ODataEntity</tt> object.
+ */
+// ODataEntity getODataEntity(Entry resource);
+ /**
+ * Gets <tt>ODataEntity</tt> from the given entry resource.
+ *
+ * @param resource entry resource.
+ * @param defaultBaseURI default base URI.
+ * @return <tt>ODataEntity</tt> object.
+ */
+// ODataEntity getODataEntity(Entry resource, URI defaultBaseURI);
+ /**
+ * Gets a <tt>LinkResource</tt> from the given OData link.
+ *
+ * @param <T> link resource type.
+ * @param link OData link.
+ * @param reference reference class.
+ * @return <tt>LinkResource</tt> object.
+ */
+// @SuppressWarnings("unchecked")
+// <T extends Link> T getLinkResource(ODataLink link, Class<T> reference);
+
+ /**
+ * Gets an <tt>ODataProperty</tt> from the given DOM element.
+ *
+ * @param property content.
+ * @return <tt>ODataProperty</tt> object.
+ */
+// ODataProperty getProperty(Element property);
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataDeserializer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataDeserializer.java
new file mode 100644
index 0000000..81e2b6b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataDeserializer.java
@@ -0,0 +1,94 @@
+/*
+ * 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.api.op;
+
+import java.io.InputStream;
+import java.io.Serializable;
+
+import org.apache.olingo.client.api.data.ServiceDocument;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.w3c.dom.Element;
+
+/**
+ * Utility class for serialization.
+ */
+public interface ODataDeserializer extends Serializable {
+
+ XMLMetadata toMetadata(InputStream input);
+
+ /**
+ * Gets the ServiceDocumentResource object represented by the given InputStream.
+ *
+ * @param input stream to be de-serialized.
+ * @param format OData service document format.
+ * @return ServiceDocumentResource object.
+ */
+ ServiceDocument toServiceDocument(InputStream input, ODataFormat format);
+
+ /**
+ * Gets a feed object from the given InputStream.
+ *
+ * @param <T> reference class type
+ * @param input stream to be de-serialized.
+ * @param reference reference class (AtomFeed.class, JSONFeed.class).
+ * @return FeedResource instance.
+ */
+// <T extends Feed> T toFeed(InputStream input, Class<T> reference);
+ /**
+ * Gets an entry object from the given InputStream.
+ *
+ * @param <T> reference class type
+ * @param input stream to be de-serialized.
+ * @param reference reference class (AtomEntry.class, JSONV3Entry.class).
+ * @return EntryResource instance.
+ */
+// <T extends Entry> T toEntry(InputStream input, Class<T> reference);
+ /**
+ * Gets a DOM representation of the given InputStream.
+ *
+ * @param input stream to be de-serialized.
+ * @param format OData format.
+ * @return DOM.
+ */
+// Element toPropertyDOM(InputStream input, ODataFormat format);
+ /**
+ * Gets a list of links from the given InputStream.
+ *
+ * @param input stream to be de-serialized.
+ * @param format OData format.
+ * @return de-serialized links.
+ */
+// LinkCollection toLinkCollection(InputStream input, ODataFormat format);
+ /**
+ * Gets the ODataError object represented by the given InputStream.
+ *
+ * @param input stream to be parsed and de-serialized.
+ * @param isXML 'TRUE' if the error is represented by XML; 'FALSE' otherwise.
+ * @return
+ */
+// ODataError toODataError(InputStream input, boolean isXML);
+ /**
+ * Parses the given input into a DOM tree.
+ *
+ * @param input stream to be parsed and de-serialized.
+ * @return DOM tree
+ */
+ Element toDOM(InputStream input);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataReader.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataReader.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataReader.java
new file mode 100644
index 0000000..d8ef18d
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataReader.java
@@ -0,0 +1,104 @@
+/*
+ * 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.api.op;
+
+import java.io.InputStream;
+import java.io.Serializable;
+
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.commons.api.edm.Edm;
+
+/**
+ * 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.
+ */
+ Edm 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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataSerializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataSerializer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataSerializer.java
new file mode 100644
index 0000000..94c168f
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataSerializer.java
@@ -0,0 +1,118 @@
+/**
+ * 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.api.op;
+
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.io.Writer;
+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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV3Deserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV3Deserializer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV3Deserializer.java
new file mode 100644
index 0000000..aeb84a1
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV3Deserializer.java
@@ -0,0 +1,23 @@
+/*
+ * 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.api.op;
+
+public interface ODataV3Deserializer extends ODataDeserializer {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV4Deserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV4Deserializer.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV4Deserializer.java
new file mode 100644
index 0000000..c782cd5
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/op/ODataV4Deserializer.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.op;
+
+import java.io.InputStream;
+
+import org.apache.olingo.client.api.edm.xml.v4.XMLMetadata;
+
+public interface ODataV4Deserializer extends ODataDeserializer {
+
+ @Override
+ XMLMetadata toMetadata(InputStream input);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/QueryOption.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/QueryOption.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/QueryOption.java
new file mode 100644
index 0000000..c871f9b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/QueryOption.java
@@ -0,0 +1,95 @@
+/*
+ * 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.api.uri;
+
+/**
+ * Query options.
+ */
+public enum QueryOption {
+
+ /**
+ * The entity-id specified by $id may be expressed absolute or relative to the request URL.
+ */
+ ID,
+ /**
+ * The $count system query option allows clients to request a count of the matching resources included with the
+ * resources in the response. The $count query option has a Boolean value of true or false.
+ */
+ COUNT,
+ /**
+ * This option indicates entities associated with the EntityType instance or EntitySet, identified by the resource
+ * path section of the URI, and MUST be represented inline in the data service's response.
+ */
+ EXPAND,
+ /**
+ * This option specifies the media type acceptable in a response. If present, this value SHOULD take precedence over
+ * value(s) specified in an Accept request header.
+ */
+ FORMAT,
+ /**
+ * This option is used to specify that a subset of the properties of the entities identified by the path of the
+ * request URI and $expand query option SHOULD be returned in the response from the data service.
+ */
+ SELECT,
+ /**
+ * This option specifies the sort properties and sort direction (ascending or descending) that the data service MUST
+ * use to order the entities in the EntitySet, identified by the resource path section of the URI.
+ */
+ ORDERBY,
+ /**
+ * This option specifies a positive integer N that is the maximum number of entities in the EntitySet, identified by
+ * the resource path section of the URI, that the data service MUST return.
+ */
+ TOP,
+ /**
+ * This option specifies a positive integer N that represents the number of entities, counted from the first entity in
+ * the EntitySet and ordered as specified by the $orderby option, that the data service should skip when returning the
+ * entities in the EntitySet, which is identified by the resource path section of the URI. The data service SHOULD
+ * return all subsequent entities, starting from the one in position N+1.
+ */
+ SKIP,
+ /**
+ * This query option applies only to the OData 2.0 protocol to the AtomPub protocol. The value of a $skiptoken query
+ * option is an opaque token which identifies an index into the collection of entities identified by the URI
+ * containing the $skiptoken parameter.
+ */
+ SKIPTOKEN,
+ /**
+ * This option specifies a predicate used to filter the elements from the EntitySet identified by the resource path
+ * section of the URI.
+ */
+ FILTER,
+ /**
+ * For a value of "allpages", this option indicates that the response to the request MUST include the count of the
+ * number of entities in the EntitySet, identified by the resource path section of the URI after all $filter system
+ * query options have been applied. For a value of "none", this option indicates that the response to the request MUST
+ * NOT include the count value.
+ */
+ INLINECOUNT,
+ /**
+ * Search expressions are used within the $search system query option to request entities matching the specified
+ * expression.
+ */
+ SEARCH;
+
+ @Override
+ public String toString() {
+ return name().toLowerCase();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
new file mode 100644
index 0000000..a3e5a15
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/SegmentType.java
@@ -0,0 +1,66 @@
+/*
+ * 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.api.uri;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * URI Segment types.
+ */
+public enum SegmentType {
+
+ ENTITY("$entity"),
+ ENTITYSET,
+ SINGLETON,
+ KEY,
+ KEY_AS_SEGMENT,
+ PROPERTY,
+ NAVIGATION,
+ DERIVED_ENTITY_TYPE,
+ VALUE("$value"),
+ BOUND_OPERATION,
+ UNBOUND_OPERATION,
+ METADATA("$metadata"),
+ BATCH("$batch"),
+ LINKS("$links"),
+ REF("$ref"),
+ CROSS_JOIN("$crossjoin"),
+ ALL("$all"),
+ /**
+ * For query options like as $count that needs to stay in their own segment, right after service root.
+ *
+ * @see QueryOption#COUNT
+ */
+ ROOT_QUERY_OPTION,
+ SERVICEROOT;
+
+ private final String value;
+
+ private SegmentType() {
+ this.value = StringUtils.EMPTY;
+ }
+
+ private SegmentType(final String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/URIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/URIBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/URIBuilder.java
new file mode 100644
index 0000000..cfb041b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/URIBuilder.java
@@ -0,0 +1,225 @@
+/*
+ * 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.api.uri;
+
+import org.apache.olingo.client.api.uri.filter.URIFilter;
+
+import java.net.URI;
+import java.util.Map;
+
+/**
+ * OData URI builder.
+ */
+public interface URIBuilder<UB extends URIBuilder<?>> {
+
+ /**
+ * Adds the specified query option to the URI.
+ *
+ * @param option query option.
+ * @param value query option value.
+ * @return current URIBuilder instance
+ */
+ UB addQueryOption(QueryOption option, String value);
+
+ /**
+ * Adds the specified (custom) query option to the URI.
+ *
+ * @param option query option.
+ * @param value query option value.
+ * @return current URIBuilder instance
+ */
+ UB addQueryOption(String option, String value);
+
+ /**
+ * Appends EntitySet segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendEntitySetSegment(String segmentValue);
+
+ /**
+ * Appends key segment to the URI.
+ *
+ * @param val segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendKeySegment(Object val);
+
+ /**
+ * Appends key segment to the URI, for multiple keys.
+ *
+ * @param segmentValues segment values.
+ * @return current URIBuilder instance
+ */
+ UB appendKeySegment(Map<String, Object> segmentValues);
+
+ /**
+ * Appends property segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendPropertySegment(String segmentValue);
+
+ /**
+ * Appends navigation segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendNavigationSegment(String segmentValue);
+
+ /**
+ * Appends derived entity type segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ UB appendDerivedEntityTypeSegment(String segmentValue);
+
+ /**
+ * Appends value segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ UB appendValueSegment();
+
+ /**
+ * Appends operation (action or function) segment to the URI.
+ *
+ * @param operation Operation (action or function) name
+ * @param arguments Operation arguments
+ * @return current URIBuilder instance
+ */
+ UB appendOperationCallSegment(String operation, Map<String, Object> arguments);
+
+ /**
+ * Appends metadata segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ UB appendMetadataSegment();
+
+ /**
+ * Appends batch segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ UB appendBatchSegment();
+
+ /**
+ * Adds count query option.
+ *
+ * @return current URIBuilder instance
+ */
+ UB count();
+
+ /**
+ * Adds expand query option.
+ *
+ * @param expandItems items to be expanded in-line
+ * @return current URIBuilder instance
+ * @see QueryOption#EXPAND
+ */
+ UB expand(String... expandItems);
+
+ /**
+ * Adds format query option.
+ *
+ * @param format media type acceptable in a response.
+ * @return current URIBuilder instance
+ * @see QueryOption#FORMAT
+ */
+ UB format(String format);
+
+ /**
+ * Adds filter for filter query option.
+ *
+ * @param filter filter instance (to be obtained via <tt>ODataFilterFactory</tt>): note that <tt>build()</tt> method
+ * will be immediately invoked.
+ * @return current URIBuilder instance
+ * @see QueryOption#FILTER
+ * @see URIFilter
+ * @see org.apache.olingo.client.api.uri.filter.FilterFactory
+ */
+ UB filter(URIFilter filter);
+
+ /**
+ * Adds filter query option.
+ *
+ * @param filter filter string.
+ * @return current URIBuilder instance
+ * @see QueryOption#FILTER
+ */
+ UB filter(String filter);
+
+ /**
+ * Adds select query option.
+ *
+ * @param selectItems select items
+ * @return current URIBuilder instance
+ * @see QueryOption#SELECT
+ */
+ UB select(String... selectItems);
+
+ /**
+ * Adds orderby query option.
+ *
+ * @param order order string.
+ * @return current URIBuilder instance
+ * @see QueryOption#ORDERBY
+ */
+ UB orderBy(String order);
+
+ /**
+ * Adds top query option.
+ *
+ * @param top maximum number of entities to be returned.
+ * @return current URIBuilder instance
+ * @see QueryOption#TOP
+ */
+ UB top(int top);
+
+ /**
+ * Adds skip query option.
+ *
+ * @param skip number of entities to be skipped into the response.
+ * @return current URIBuilder instance
+ * @see QueryOption#SKIP
+ */
+ UB skip(int skip);
+
+ /**
+ * Adds skiptoken query option.
+ *
+ * @param skipToken opaque token.
+ * @return current URIBuilder instance
+ * @see QueryOption#SKIPTOKEN
+ */
+ UB skipToken(String skipToken);
+
+ /**
+ * Build OData URI.
+ *
+ * @return OData URI.
+ */
+ URI build();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V3URIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V3URIBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V3URIBuilder.java
new file mode 100644
index 0000000..7d4059b
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V3URIBuilder.java
@@ -0,0 +1,47 @@
+/*
+ * 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.api.uri;
+
+public interface V3URIBuilder extends URIBuilder<V3URIBuilder> {
+
+ public enum InlineCount {
+
+ allpages,
+ none
+
+ }
+
+ /**
+ * Appends links segment to the URI.
+ *
+ * @param segmentValue segment value
+ * @return current URIBuilder instance
+ */
+ V3URIBuilder appendLinksSegment(String segmentValue);
+
+ /**
+ * Adds inlinecount query option.
+ *
+ * @param inlineCount value
+ * @return current URIBuilder instance
+ * @see QueryOption#INLINECOUNT
+ */
+ V3URIBuilder inlineCount(InlineCount inlineCount);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V4URIBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V4URIBuilder.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V4URIBuilder.java
new file mode 100644
index 0000000..d98beb3
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/V4URIBuilder.java
@@ -0,0 +1,87 @@
+/*
+ * 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.api.uri;
+
+public interface V4URIBuilder extends URIBuilder<V4URIBuilder> {
+
+ /**
+ * Appends Singleton segment to the URI.
+ *
+ * @param segmentValue segment value.
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendSingletonSegment(String segmentValue);
+
+ /**
+ * Appends entity-id segment to the URI.
+ *
+ * @param segmentValue segment value
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendEntityIdSegment(String segmentValue);
+
+ /**
+ * Appends ref segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendRefSegment();
+
+ /**
+ * Appends cross join segment to the URI.
+ *
+ * @param segmentValues segment values.
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendCrossjoinSegment(String... segmentValues);
+
+ /**
+ * Appends all segment to the URI.
+ *
+ * @return current URIBuilder instance
+ */
+ V4URIBuilder appendAllSegment();
+
+ /**
+ * Adds id query option.
+ *
+ * @param idValue opaque token.
+ * @return current URIBuilder instance
+ * @see QueryOption#ID
+ */
+ V4URIBuilder id(String idValue);
+
+ /**
+ * Appends count query option.
+ *
+ * @param value true or false
+ * @return current URIBuilder instance
+ * @see QueryOption#COUNT
+ */
+ V4URIBuilder count(boolean value);
+
+ /**
+ * Appends search query option.
+ *
+ * @param expression search expression
+ * @return current URIBuilder instance
+ * @see QueryOption#SEARCH
+ */
+ V4URIBuilder search(String expression);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArg.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArg.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArg.java
new file mode 100644
index 0000000..10ab250
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArg.java
@@ -0,0 +1,30 @@
+/*
+ * 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.api.uri.filter;
+
+/**
+ * Interface for any available filter argument.
+ */
+public interface FilterArg {
+
+ /**
+ * @return String representation of this filter argument.
+ */
+ String build();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArgFactory.java
new file mode 100644
index 0000000..f9fad74
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterArgFactory.java
@@ -0,0 +1,83 @@
+/*
+ * 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.api.uri.filter;
+
+public interface FilterArgFactory {
+
+ FilterArg _null();
+
+ FilterArg add(FilterArg first, FilterArg second);
+
+ FilterArg ceiling(FilterArg param);
+
+ FilterArg concat(FilterArg first, FilterArg second);
+
+ FilterArg day(FilterArg param);
+
+ FilterArg div(FilterArg first, FilterArg second);
+
+ FilterArg endswith(FilterArg first, FilterArg second);
+
+ FilterArg floor(FilterArg param);
+
+ FilterArg hour(FilterArg param);
+
+ FilterArg indexof(FilterArg first, FilterArg second);
+
+ FilterArg isof(FilterArg type);
+
+ FilterArg isof(FilterArg expression, FilterArg type);
+
+ FilterArg length(FilterArg param);
+
+ FilterArg literal(Object value);
+
+ FilterArg minute(FilterArg param);
+
+ FilterArg mod(FilterArg first, FilterArg second);
+
+ FilterArg month(FilterArg param);
+
+ FilterArg mul(FilterArg first, FilterArg second);
+
+ FilterArg property(String propertyPath);
+
+ FilterArg replace(FilterArg first, FilterArg second, FilterArg third);
+
+ FilterArg round(FilterArg param);
+
+ FilterArg second(FilterArg param);
+
+ FilterArg startswith(FilterArg first, FilterArg second);
+
+ FilterArg sub(FilterArg first, FilterArg second);
+
+ FilterArg substring(FilterArg arg, FilterArg pos);
+
+ FilterArg substring(FilterArg arg, FilterArg pos, FilterArg length);
+
+ FilterArg tolower(FilterArg param);
+
+ FilterArg toupper(FilterArg param);
+
+ FilterArg trim(FilterArg param);
+
+ FilterArg year(FilterArg param);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterFactory.java
new file mode 100644
index 0000000..0782daa
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/FilterFactory.java
@@ -0,0 +1,61 @@
+/*
+ * 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.api.uri.filter;
+
+import java.io.Serializable;
+
+/**
+ * OData filter factory.
+ */
+public interface FilterFactory extends Serializable {
+
+ FilterArgFactory getArgFactory();
+
+ URIFilter match(FilterArg arg);
+
+ URIFilter eq(String key, Object value);
+
+ URIFilter eq(FilterArg left, FilterArg right);
+
+ URIFilter ne(String key, Object value);
+
+ URIFilter ne(FilterArg left, FilterArg right);
+
+ URIFilter gt(String key, Object value);
+
+ URIFilter gt(FilterArg left, FilterArg right);
+
+ URIFilter ge(String key, Object value);
+
+ URIFilter ge(FilterArg left, FilterArg right);
+
+ URIFilter lt(String key, Object value);
+
+ URIFilter lt(FilterArg left, FilterArg right);
+
+ URIFilter le(String key, Object value);
+
+ URIFilter le(FilterArg left, FilterArg right);
+
+ URIFilter and(URIFilter left, URIFilter right);
+
+ URIFilter or(URIFilter left, URIFilter right);
+
+ URIFilter not(URIFilter filter);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/URIFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/URIFilter.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/URIFilter.java
new file mode 100644
index 0000000..0e0737f
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/URIFilter.java
@@ -0,0 +1,32 @@
+/*
+ * 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.api.uri.filter;
+
+/**
+ * Interface for any available filter; obtain instances via <tt>FilterFactory</tt>.
+ *
+ * @see FilterFactory
+ */
+public interface URIFilter {
+
+ /**
+ * @return String representation of this filter.
+ */
+ String build();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterArgFactory.java
new file mode 100644
index 0000000..04554f5
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterArgFactory.java
@@ -0,0 +1,25 @@
+/*
+ * 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.api.uri.filter;
+
+public interface V3FilterArgFactory extends FilterArgFactory {
+
+ FilterArg substringof(FilterArg first, FilterArg second);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterFactory.java
new file mode 100644
index 0000000..7571c98
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V3FilterFactory.java
@@ -0,0 +1,26 @@
+/*
+ * 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.api.uri.filter;
+
+public interface V3FilterFactory extends FilterFactory {
+
+ @Override
+ V3FilterArgFactory getArgFactory();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterArgFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterArgFactory.java
new file mode 100644
index 0000000..b7bca85
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterArgFactory.java
@@ -0,0 +1,55 @@
+/*
+ * 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.api.uri.filter;
+
+public interface V4FilterArgFactory extends FilterArgFactory {
+
+ FilterArg contains(FilterArg first, FilterArg second);
+
+ FilterArg fractionalseconds(FilterArg param);
+
+ FilterArg date(FilterArg param);
+
+ FilterArg time(FilterArg param);
+
+ FilterArg totaloffsetminutes(FilterArg param);
+
+ FilterArg now();
+
+ FilterArg mindatetime();
+
+ FilterArg maxdatetime();
+
+ FilterArg totalseconds(FilterArg param);
+
+ FilterArg cast(FilterArg type);
+
+ FilterArg cast(FilterArg expression, FilterArg type);
+
+ FilterArg geoDistance(FilterArg first, FilterArg second);
+
+ FilterArg geoIntersects(FilterArg first, FilterArg second);
+
+ FilterArg geoLength(FilterArg first, FilterArg second);
+
+ FilterArg any(FilterArg collection, URIFilter expression);
+
+ FilterArg all(FilterArg collection, URIFilter expression);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterFactory.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterFactory.java
new file mode 100644
index 0000000..3050de2
--- /dev/null
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/uri/filter/V4FilterFactory.java
@@ -0,0 +1,32 @@
+/*
+ * 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.api.uri.filter;
+
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+
+public interface V4FilterFactory extends FilterFactory {
+
+ @Override
+ V4FilterArgFactory getArgFactory();
+
+ URIFilter has(String key, EdmEnumType enumType, String memberName);
+
+ URIFilter has(FilterArg left, EdmEnumType enumType, String memberName);
+
+}
[30/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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/edm/xml/AbstractNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractNavigationProperty.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractNavigationProperty.java
deleted file mode 100644
index ebeb62f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractNavigationProperty.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonNavigationProperty;
-
-public class AbstractNavigationProperty extends AbstractEdmItem implements CommonNavigationProperty {
-
- private static final long serialVersionUID = 3112463683071069594L;
-
- @JsonProperty(value = "Name", required = true)
- private String name;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-}
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/edm/xml/AbstractParameter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractParameter.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractParameter.java
deleted file mode 100644
index 5b737d8..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractParameter.java
+++ /dev/null
@@ -1,94 +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.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonParameter;
-
-@JsonDeserialize(using = ParameterDeserializer.class)
-public abstract class AbstractParameter extends AbstractEdmItem implements CommonParameter {
-
- private static final long serialVersionUID = -4305016554930334342L;
-
- private String name;
-
- private String type;
-
- private boolean nullable = true;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- @Override
- public boolean isNullable() {
- return nullable;
- }
-
- public void setNullable(final boolean nullable) {
- this.nullable = nullable;
- }
-
- @Override
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public void setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- }
-
- @Override
- public Integer getPrecision() {
- return precision;
- }
-
- public void setPrecision(final Integer precision) {
- this.precision = precision;
- }
-
- @Override
- public Integer getScale() {
- return scale;
- }
-
- public void setScale(final Integer scale) {
- this.scale = scale;
- }
-}
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/edm/xml/AbstractProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractProperty.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractProperty.java
deleted file mode 100644
index 78cdc4b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractProperty.java
+++ /dev/null
@@ -1,173 +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.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.CommonProperty;
-import org.apache.olingo.odata4.commons.api.edm.constants.ConcurrencyMode;
-import org.apache.olingo.odata4.commons.api.edm.constants.StoreGeneratedPattern;
-
-@JsonDeserialize(using = PropertyDeserializer.class)
-public abstract class AbstractProperty extends AbstractEdmItem implements CommonProperty {
-
- private static final long serialVersionUID = -6004492361142315153L;
-
- private String name;
-
- private String type;
-
- private boolean nullable = true;
-
- private String defaultValue;
-
- private Integer maxLength;
-
- private boolean fixedLength;
-
- private Integer precision;
-
- private Integer scale;
-
- private boolean unicode = true;
-
- private String collation;
-
- private String srid;
-
- private ConcurrencyMode concurrencyMode;
-
- private StoreGeneratedPattern storeGeneratedPattern = StoreGeneratedPattern.None;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- @Override
- public boolean isNullable() {
- return nullable;
- }
-
- public void setNullable(final boolean nullable) {
- this.nullable = nullable;
- }
-
- @Override
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public void setDefaultValue(final String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- @Override
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public void setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- }
-
- @Override
- public boolean isFixedLength() {
- return fixedLength;
- }
-
- public void setFixedLength(final boolean fixedLength) {
- this.fixedLength = fixedLength;
- }
-
- @Override
- public Integer getPrecision() {
- return precision;
- }
-
- public void setPrecision(final Integer precision) {
- this.precision = precision;
- }
-
- @Override
- public Integer getScale() {
- return scale;
- }
-
- public void setScale(final Integer scale) {
- this.scale = scale;
- }
-
- @Override
- public boolean isUnicode() {
- return unicode;
- }
-
- public void setUnicode(final boolean unicode) {
- this.unicode = unicode;
- }
-
- @Override
- public String getCollation() {
- return collation;
- }
-
- public void setCollation(final String collation) {
- this.collation = collation;
- }
-
- @Override
- public String getSrid() {
- return srid;
- }
-
- public void setSrid(final String srid) {
- this.srid = srid;
- }
-
- @Override
- public ConcurrencyMode getConcurrencyMode() {
- return concurrencyMode;
- }
-
- public void setConcurrencyMode(final ConcurrencyMode concurrencyMode) {
- this.concurrencyMode = concurrencyMode;
- }
-
- @Override
- public StoreGeneratedPattern getStoreGeneratedPattern() {
- return storeGeneratedPattern;
- }
-
- public void setStoreGeneratedPattern(final StoreGeneratedPattern storeGeneratedPattern) {
- this.storeGeneratedPattern = storeGeneratedPattern;
- }
-}
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/edm/xml/AbstractSchema.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractSchema.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractSchema.java
deleted file mode 100644
index 568c85f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractSchema.java
+++ /dev/null
@@ -1,69 +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.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.ComplexType;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityType;
-import org.apache.olingo.odata4.client.api.edm.xml.EnumType;
-import org.apache.olingo.odata4.client.api.edm.xml.Schema;
-import org.apache.olingo.odata4.client.core.op.impl.SchemaDeserializer;
-
-@JsonDeserialize(using = SchemaDeserializer.class)
-public abstract class AbstractSchema extends AbstractEdmItem implements Schema {
-
- private static final long serialVersionUID = -1356392748971378455L;
-
- private String namespace;
-
- private String alias;
-
- @Override
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(final String namespace) {
- this.namespace = namespace;
- }
-
- @Override
- public String getAlias() {
- return alias;
- }
-
- public void setAlias(final String alias) {
- this.alias = alias;
- }
-
- @Override
- public EnumType getEnumType(final String name) {
- return getOneByName(name, getEnumTypes());
- }
-
- @Override
- public ComplexType getComplexType(final String name) {
- return getOneByName(name, getComplexTypes());
- }
-
- @Override
- public EntityType getEntityType(final String name) {
- return getOneByName(name, getEntityTypes());
- }
-}
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/edm/xml/AbstractXMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractXMLMetadata.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractXMLMetadata.java
deleted file mode 100644
index e052948..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractXMLMetadata.java
+++ /dev/null
@@ -1,95 +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.edm.xml;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata;
-import org.apache.olingo.odata4.client.api.edm.xml.Edmx;
-import org.apache.olingo.odata4.client.api.edm.xml.Schema;
-
-/**
- * Entry point for access information about EDM metadata.
- */
-public abstract class AbstractXMLMetadata extends AbstractEdmItem implements XMLMetadata {
-
- private static final long serialVersionUID = -1214173426671503187L;
-
- protected final Edmx edmx;
-
- protected final Map<String, Schema> schemaByNsOrAlias;
-
- public AbstractXMLMetadata(final Edmx edmx) {
- this.edmx = edmx;
-
- this.schemaByNsOrAlias = new HashMap<String, Schema>();
- for (Schema schema : edmx.getDataServices().getSchemas()) {
- this.schemaByNsOrAlias.put(schema.getNamespace(), schema);
- if (StringUtils.isNotBlank(schema.getAlias())) {
- this.schemaByNsOrAlias.put(schema.getAlias(), schema);
- }
- }
- }
-
- /**
- * Checks whether the given key is a valid namespace or alias in the EdM metadata document.
- *
- * @param key namespace or alias
- * @return true if key is valid namespace or alias
- */
- @Override
- public boolean isNsOrAlias(final String key) {
- return this.schemaByNsOrAlias.keySet().contains(key);
- }
-
- /**
- * Returns the Schema at the specified position in the EdM metadata document.
- *
- * @param index index of the Schema to return
- * @return the Schema at the specified position in the EdM metadata document
- */
- @Override
- public Schema getSchema(final int index) {
- return this.edmx.getDataServices().getSchemas().get(index);
- }
-
- /**
- * Returns the Schema with the specified key (namespace or alias) in the EdM metadata document.
- *
- * @param key namespace or alias
- * @return the Schema with the specified key in the EdM metadata document
- */
- @Override
- public Schema getSchema(final String key) {
- return this.schemaByNsOrAlias.get(key);
- }
-
- /**
- * Returns all Schema objects defined in the EdM metadata document.
- *
- * @return all Schema objects defined in the EdM metadata document
- */
- @Override
- public List<? extends Schema> getSchemas() {
- return this.edmx.getDataServices().getSchemas();
- }
-
-}
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/edm/xml/DataServicesDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/DataServicesDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/DataServicesDeserializer.java
deleted file mode 100644
index f1c045f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/DataServicesDeserializer.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml;
-
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-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 java.io.IOException;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public class DataServicesDeserializer extends AbstractEdmDeserializer<AbstractDataServices> {
-
- @Override
- protected AbstractDataServices doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractDataServices dataServices = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.DataServicesImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.DataServicesImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("DataServiceVersion".equals(jp.getCurrentName())) {
- dataServices.setDataServiceVersion(jp.nextTextValue());
- } else if ("MaxDataServiceVersion".equals(jp.getCurrentName())) {
- dataServices.setMaxDataServiceVersion(jp.nextTextValue());
- } else if ("Schema".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (dataServices instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.DataServicesImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.DataServicesImpl) dataServices).
- getSchemas().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.SchemaImpl.class));
-
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.DataServicesImpl) dataServices).
- getSchemas().add(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.SchemaImpl.class));
- }
- }
- }
- }
-
- return dataServices;
- }
-}
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/edm/xml/EdmxDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/EdmxDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/EdmxDeserializer.java
deleted file mode 100644
index 8aa791d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/EdmxDeserializer.java
+++ /dev/null
@@ -1,67 +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.edm.xml;
-
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.ReferenceImpl;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-@SuppressWarnings("rawtypes")
-public class EdmxDeserializer extends AbstractEdmDeserializer<AbstractEdmx> {
-
- @Override
- protected AbstractEdmx doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractEdmx edmx = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.EdmxImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.EdmxImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Version".equals(jp.getCurrentName())) {
- edmx.setVersion(jp.nextTextValue());
- } else if ("DataServices".equals(jp.getCurrentName())) {
- jp.nextToken();
- if (edmx instanceof org.apache.olingo.odata4.client.core.edm.xml.v3.EdmxImpl) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.EdmxImpl) edmx).
- setDataServices(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v3.DataServicesImpl.class));
- } else {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EdmxImpl) edmx).
- setDataServices(jp.readValueAs(
- org.apache.olingo.odata4.client.core.edm.xml.v4.DataServicesImpl.class));
- }
- } else if ("Reference".equals(jp.getCurrentName())) {
- jp.nextToken();
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.EdmxImpl) edmx).getReferences().
- add(jp.readValueAs( ReferenceImpl.class));
- }
- }
- }
-
- return edmx;
- }
-}
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/edm/xml/EntityKeyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/EntityKeyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/EntityKeyImpl.java
deleted file mode 100644
index 91f4068..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/EntityKeyImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.EntityKey;
-import org.apache.olingo.odata4.client.api.edm.xml.PropertyRef;
-import org.apache.olingo.odata4.client.core.op.impl.EntityKeyDeserializer;
-
-@JsonDeserialize(using = EntityKeyDeserializer.class)
-public class EntityKeyImpl extends AbstractEdmItem implements EntityKey {
-
- private static final long serialVersionUID = 2586047015894794685L;
-
- private final List<PropertyRef> propertyRefs = new ArrayList<PropertyRef>();
-
- @Override
- public List<PropertyRef> getPropertyRefs() {
- return propertyRefs;
- }
-}
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/edm/xml/OnDeleteImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/OnDeleteImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/OnDeleteImpl.java
deleted file mode 100644
index abe7e25..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/OnDeleteImpl.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.edm.xml;
-
-import org.apache.olingo.odata4.client.api.edm.xml.OnDeleteAction;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.OnDelete;
-
-public class OnDeleteImpl extends AbstractEdmItem implements OnDelete {
-
- private static final long serialVersionUID = -5321523424474336347L;
-
- @JsonProperty(value = "Action", required = true)
- private OnDeleteAction action = OnDeleteAction.None;
-
- @Override
- public OnDeleteAction getAction() {
- return action;
- }
-
- public void setAction(final OnDeleteAction action) {
- this.action = action;
- }
-
-}
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/edm/xml/ParameterDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/ParameterDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/ParameterDeserializer.java
deleted file mode 100644
index e8bd47a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/ParameterDeserializer.java
+++ /dev/null
@@ -1,69 +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.edm.xml;
-
-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 java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ParameterMode;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-
-public class ParameterDeserializer extends AbstractEdmDeserializer<AbstractParameter> {
-
- @Override
- protected AbstractParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractParameter parameter = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.ParameterImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.ParameterImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- parameter.setName(jp.nextTextValue());
- } else if ("Type".equals(jp.getCurrentName())) {
- parameter.setType(jp.nextTextValue());
- } else if ("Nullable".equals(jp.getCurrentName())) {
- parameter.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- final String maxLenght = jp.nextTextValue();
- parameter.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
- } else if ("Precision".equals(jp.getCurrentName())) {
- parameter.setPrecision(Integer.valueOf(jp.nextTextValue()));
- } else if ("Scale".equals(jp.getCurrentName())) {
- parameter.setScale(Integer.valueOf(jp.nextTextValue()));
- } else if ("Mode".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.ParameterImpl) parameter).
- setMode(ParameterMode.valueOf(jp.nextTextValue()));
- } else if ("SRID".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.ParameterImpl) parameter).setSrid(jp.nextTextValue());
- }
- }
- }
-
- return parameter;
- }
-
-}
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/edm/xml/PropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyDeserializer.java
deleted file mode 100644
index f45b510..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyDeserializer.java
+++ /dev/null
@@ -1,102 +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.edm.xml;
-
-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 java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.commons.api.edm.constants.ConcurrencyMode;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmContentKind;
-import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.olingo.odata4.commons.api.edm.constants.StoreGeneratedPattern;
-
-public class PropertyDeserializer extends AbstractEdmDeserializer<AbstractProperty> {
-
- @Override
- protected AbstractProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AbstractProperty property = ODataServiceVersion.V30 == client.getServiceVersion()
- ? new org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl()
- : new org.apache.olingo.odata4.client.core.edm.xml.v4.PropertyImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- property.setName(jp.nextTextValue());
- } else if ("Type".equals(jp.getCurrentName())) {
- property.setType(jp.nextTextValue());
- } else if ("Nullable".equals(jp.getCurrentName())) {
- property.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("DefaultValue".equals(jp.getCurrentName())) {
- property.setDefaultValue(jp.nextTextValue());
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- final String maxLenght = jp.nextTextValue();
- property.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
- } else if ("FixedLength".equals(jp.getCurrentName())) {
- property.setFixedLength(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Precision".equals(jp.getCurrentName())) {
- property.setPrecision(Integer.valueOf(jp.nextTextValue()));
- } else if ("Scale".equals(jp.getCurrentName())) {
- property.setScale(Integer.valueOf(jp.nextTextValue()));
- } else if ("Unicode".equals(jp.getCurrentName())) {
- property.setUnicode(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Collation".equals(jp.getCurrentName())) {
- property.setCollation(jp.nextTextValue());
- } else if ("SRID".equals(jp.getCurrentName())) {
- property.setSrid(jp.nextTextValue());
- } else if ("ConcurrencyMode".equals(jp.getCurrentName())) {
- property.setConcurrencyMode(ConcurrencyMode.valueOf(jp.nextTextValue()));
- } else if ("StoreGeneratedPattern".equals(jp.getCurrentName())) {
- property.setStoreGeneratedPattern(StoreGeneratedPattern.valueOf(jp.nextTextValue()));
- } else if ("FC_SourcePath".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
- setFcSourcePath(jp.nextTextValue());
- } else if ("FC_TargetPath".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
- setFcTargetPath(jp.nextTextValue());
- } else if ("FC_ContentKind".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
- setFcContentKind(EdmContentKind.valueOf(jp.nextTextValue()));
- } else if ("FC_NsPrefix".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
- setFcNSPrefix(jp.nextTextValue());
- } else if ("FC_NsUri".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
- setFcNSURI(jp.nextTextValue());
- } else if ("FC_KeepInContent".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
- setFcKeepInContent(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- ((org.apache.olingo.odata4.client.core.edm.xml.v4.PropertyImpl) property).
- setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return property;
- }
-
-}
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/edm/xml/PropertyRefImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyRefImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyRefImpl.java
deleted file mode 100644
index d5f96d7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyRefImpl.java
+++ /dev/null
@@ -1,52 +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.edm.xml;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.PropertyRef;
-
-public class PropertyRefImpl extends AbstractEdmItem implements PropertyRef {
-
- private static final long serialVersionUID = 6738212067449628983L;
-
- @JsonProperty(value = "Name", required = true)
- private String name;
-
- @JsonProperty(value = "Alias")
- private String alias;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getAlias() {
- return alias;
- }
-
- public void setAlias(final String alias) {
- this.alias = alias;
- }
-
-}
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/edm/xml/v3/AnnotationsDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AnnotationsDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AnnotationsDeserializer.java
deleted file mode 100644
index d3c4e18..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AnnotationsDeserializer.java
+++ /dev/null
@@ -1,55 +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.edm.xml.v3;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class AnnotationsDeserializer extends AbstractEdmDeserializer<AnnotationsImpl> {
-
- @Override
- protected AnnotationsImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AnnotationsImpl annotations = new AnnotationsImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Target".equals(jp.getCurrentName())) {
- annotations.setTarget(jp.nextTextValue());
- } else if ("Qualifier".equals(jp.getCurrentName())) {
- annotations.setQualifier(jp.nextTextValue());
- } else if ("typeAnnotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- annotations.getTypeAnnotations().add(jp.readValueAs( TypeAnnotationImpl.class));
- } else if ("ValueAnnotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- annotations.getValueAnnotations().add(jp.readValueAs( ValueAnnotationImpl.class));
- }
- }
- }
-
- return annotations;
- }
-}
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/edm/xml/v3/AnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AnnotationsImpl.java
deleted file mode 100644
index cee352e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AnnotationsImpl.java
+++ /dev/null
@@ -1,48 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Annotations;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.TypeAnnotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ValueAnnotation;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractAnnotations;
-
-@JsonDeserialize(using = AnnotationsDeserializer.class)
-public class AnnotationsImpl extends AbstractAnnotations implements Annotations {
-
- private static final long serialVersionUID = 3877353656301805410L;
-
- private final List<TypeAnnotation> typeAnnotations = new ArrayList<TypeAnnotation>();
-
- private final List<ValueAnnotation> valueAnnotations = new ArrayList<ValueAnnotation>();
-
- @Override
- public List<TypeAnnotation> getTypeAnnotations() {
- return typeAnnotations;
- }
-
- @Override
- public List<ValueAnnotation> getValueAnnotations() {
- return valueAnnotations;
- }
-
-}
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/edm/xml/v3/AssociationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationDeserializer.java
deleted file mode 100644
index 0de5a19..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationDeserializer.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.edm.xml.v3;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class AssociationDeserializer extends AbstractEdmDeserializer<AssociationImpl> {
-
- @Override
- protected AssociationImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AssociationImpl association = new AssociationImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- association.setName(jp.nextTextValue());
- } else if ("ReferentialConstraint".equals(jp.getCurrentName())) {
- jp.nextToken();
- association.setReferentialConstraint(jp.readValueAs( ReferentialConstraintImpl.class));
- } else if ("End".equals(jp.getCurrentName())) {
- jp.nextToken();
- association.getEnds().add(jp.readValueAs( AssociationEndImpl.class));
- }
- }
- }
-
- return association;
- }
-}
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/edm/xml/v3/AssociationEndImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationEndImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationEndImpl.java
deleted file mode 100644
index 6171501..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationEndImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml.v3;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.OnDelete;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.AssociationEnd;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class AssociationEndImpl extends AbstractEdmItem implements AssociationEnd {
-
- private static final long serialVersionUID = 3305394053564979376L;
-
- @JsonProperty(value = "Type", required = true)
- private String type;
-
- @JsonProperty(value = "Role")
- private String role;
-
- @JsonProperty(value = "Multiplicity")
- private String multiplicity;
-
- @JsonProperty(value = "OnDelete")
- private OnDelete onDelete;
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- @Override
- public String getRole() {
- return role;
- }
-
- public void setRole(final String role) {
- this.role = role;
- }
-
- @Override
- public String getMultiplicity() {
- return multiplicity;
- }
-
- public void setMultiplicity(final String multiplicity) {
- this.multiplicity = multiplicity;
- }
-
- @Override
- public OnDelete getOnDelete() {
- return onDelete;
- }
-
- public void setOnDelete(final OnDelete onDelete) {
- this.onDelete = onDelete;
- }
-}
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/edm/xml/v3/AssociationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationImpl.java
deleted file mode 100644
index b807b9c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationImpl.java
+++ /dev/null
@@ -1,62 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Association;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.AssociationEnd;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.ReferentialConstraint;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-@JsonDeserialize(using = AssociationDeserializer.class)
-public class AssociationImpl extends AbstractEdmItem implements Association {
-
- private static final long serialVersionUID = 73763231919532482L;
-
- private String name;
-
- private ReferentialConstraint referentialConstraint;
-
- private List<AssociationEnd> ends = new ArrayList<AssociationEnd>();
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public ReferentialConstraint getReferentialConstraint() {
- return referentialConstraint;
- }
-
- public void setReferentialConstraint(final ReferentialConstraint referentialConstraint) {
- this.referentialConstraint = referentialConstraint;
- }
-
- @Override
- public List<AssociationEnd> getEnds() {
- return ends;
- }
-}
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/edm/xml/v3/AssociationSetDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationSetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationSetDeserializer.java
deleted file mode 100644
index 16cae5a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationSetDeserializer.java
+++ /dev/null
@@ -1,52 +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.edm.xml.v3;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class AssociationSetDeserializer extends AbstractEdmDeserializer<AssociationSetImpl> {
-
- @Override
- protected AssociationSetImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final AssociationSetImpl associationSet = new AssociationSetImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- associationSet.setName(jp.nextTextValue());
- } else if ("Association".equals(jp.getCurrentName())) {
- associationSet.setAssociation(jp.nextTextValue());
- } else if ("End".equals(jp.getCurrentName())) {
- jp.nextToken();
- associationSet.getEnds().add(jp.readValueAs( AssociationSetEndImpl.class));
- }
- }
- }
-
- return associationSet;
- }
-}
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/edm/xml/v3/AssociationSetEndImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationSetEndImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationSetEndImpl.java
deleted file mode 100644
index 66c35ce..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationSetEndImpl.java
+++ /dev/null
@@ -1,52 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.AssociationSetEnd;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class AssociationSetEndImpl extends AbstractEdmItem implements AssociationSetEnd {
-
- private static final long serialVersionUID = -6238344152962217446L;
-
- @JsonProperty("Role")
- private String role;
-
- @JsonProperty(value = "EntitySet", required = true)
- private String entitySet;
-
- @Override
- public String getRole() {
- return role;
- }
-
- public void setRole(final String role) {
- this.role = role;
- }
-
- @Override
- public String getEntitySet() {
- return entitySet;
- }
-
- public void setEntitySet(final String entitySet) {
- this.entitySet = entitySet;
- }
-}
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/edm/xml/v3/AssociationSetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationSetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationSetImpl.java
deleted file mode 100644
index 48c3fcb..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/AssociationSetImpl.java
+++ /dev/null
@@ -1,61 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.AssociationSet;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.AssociationSetEnd;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-@JsonDeserialize(using = AssociationSetDeserializer.class)
-public class AssociationSetImpl extends AbstractEdmItem implements AssociationSet {
-
- private static final long serialVersionUID = 1248430921598774799L;
-
- private String name;
-
- private String association;
-
- private List<AssociationSetEnd> ends = new ArrayList<AssociationSetEnd>();
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getAssociation() {
- return association;
- }
-
- public void setAssociation(final String association) {
- this.association = association;
- }
-
- @Override
- public List<AssociationSetEnd> getEnds() {
- return ends;
- }
-}
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/edm/xml/v3/ComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ComplexTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ComplexTypeImpl.java
deleted file mode 100644
index 276cac1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ComplexTypeImpl.java
+++ /dev/null
@@ -1,54 +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.edm.xml.v3;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.ComplexType;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractComplexType;
-
-public class ComplexTypeImpl extends AbstractComplexType implements ComplexType {
-
- private static final long serialVersionUID = -1251230308269425962L;
-
- private final List<PropertyImpl> properties = new ArrayList<PropertyImpl>();
-
- private final List<NavigationPropertyImpl> navigationProperties = new ArrayList<NavigationPropertyImpl>();
-
- @Override
- public PropertyImpl getProperty(final String name) {
- return (PropertyImpl) super.getProperty(name);
- }
-
- @Override
- public List<PropertyImpl> getProperties() {
- return properties;
- }
-
- @Override
- public NavigationPropertyImpl getNavigationProperty(String name) {
- return (NavigationPropertyImpl) super.getNavigationProperty(name);
- }
-
- @Override
- public List<NavigationPropertyImpl> getNavigationProperties() {
- return navigationProperties;
- }
-
-}
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/edm/xml/v3/DataServicesImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/DataServicesImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/DataServicesImpl.java
deleted file mode 100644
index 7db60ff..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/DataServicesImpl.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.edm.xml.v3;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.Schema;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractDataServices;
-
-public class DataServicesImpl extends AbstractDataServices {
-
- private static final long serialVersionUID = 633129618050875211L;
-
- private final List<Schema> schemas = new ArrayList<Schema>();
-
- @Override
- public List<Schema> getSchemas() {
- return schemas;
- }
-
-}
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/edm/xml/v3/EdmxImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EdmxImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EdmxImpl.java
deleted file mode 100644
index a64d5eb..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EdmxImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml.v3;
-
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmx;
-
-public class EdmxImpl extends AbstractEdmx {
-
- private static final long serialVersionUID = -8031883176876401375L;
-
- @Override
- public DataServicesImpl getDataServices() {
- return (DataServicesImpl) super.getDataServices();
- }
-
-}
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/edm/xml/v3/EntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EntityContainerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EntityContainerImpl.java
deleted file mode 100644
index 22e0488..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EntityContainerImpl.java
+++ /dev/null
@@ -1,68 +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.edm.xml.v3;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.EntitySet;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.AssociationSet;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntityContainer;
-
-public class EntityContainerImpl extends AbstractEntityContainer {
-
- private static final long serialVersionUID = 8934431875078180370L;
-
- private final List<EntitySet> entitySets = new ArrayList<EntitySet>();
-
- private final List<AssociationSet> associationSets = new ArrayList<AssociationSet>();
-
- private final List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
-
- @Override
- public EntitySetImpl getEntitySet(final String name) {
- return (EntitySetImpl) super.getEntitySet(name);
- }
-
- @Override
- public List<EntitySet> getEntitySets() {
- return entitySets;
- }
-
- public List<AssociationSet> getAssociationSets() {
- return associationSets;
- }
-
- @Override
- public FunctionImportImpl getFunctionImport(final String name) {
- return (FunctionImportImpl) super.getFunctionImport(name);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public List<FunctionImport> getFunctionImports(final String name) {
- return (List<FunctionImport>) super.getFunctionImports(name);
- }
-
- @Override
- public List<FunctionImport> getFunctionImports() {
- return functionImports;
- }
-
-}
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/edm/xml/v3/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EntitySetImpl.java
deleted file mode 100644
index bc28cc6..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EntitySetImpl.java
+++ /dev/null
@@ -1,27 +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.edm.xml.v3;
-
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntitySet;
-
-public class EntitySetImpl extends AbstractEntitySet {
-
- private static final long serialVersionUID = 5570833733884884012L;
-
-}
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/edm/xml/v3/EntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EntityTypeImpl.java
deleted file mode 100644
index 7f10fa6..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EntityTypeImpl.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.edm.xml.v3;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntityType;
-
-public class EntityTypeImpl extends AbstractEntityType {
-
- private static final long serialVersionUID = 8727765036150269547L;
-
- private final List<PropertyImpl> properties = new ArrayList<PropertyImpl>();
-
- private final List<NavigationPropertyImpl> navigationProperties = new ArrayList<NavigationPropertyImpl>();
-
- @Override
- public PropertyImpl getProperty(final String name) {
- return (PropertyImpl) super.getProperty(name);
- }
-
- @Override
- public List<PropertyImpl> getProperties() {
- return properties;
- }
-
- @Override
- public NavigationPropertyImpl getNavigationProperty(final String name) {
- return (NavigationPropertyImpl) super.getNavigationProperty(name);
- }
-
- @Override
- public List<NavigationPropertyImpl> getNavigationProperties() {
- return navigationProperties;
- }
-
-}
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/edm/xml/v3/EnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EnumTypeImpl.java
deleted file mode 100644
index dffd226..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/EnumTypeImpl.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.edm.xml.v3;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.Member;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEnumType;
-
-public class EnumTypeImpl extends AbstractEnumType {
-
- private static final long serialVersionUID = 8967396195669128419L;
-
- private final List<Member> members = new ArrayList<Member>();
-
- @Override
- public List<Member> getMembers() {
- return members;
- }
-
-}
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/edm/xml/v3/FunctionImportDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/FunctionImportDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/FunctionImportDeserializer.java
deleted file mode 100644
index bdb5a1c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/FunctionImportDeserializer.java
+++ /dev/null
@@ -1,67 +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.edm.xml.v3;
-
-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 java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class FunctionImportDeserializer extends AbstractEdmDeserializer<FunctionImportImpl> {
-
- @Override
- protected FunctionImportImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final FunctionImportImpl funcImp = new FunctionImportImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- funcImp.setName(jp.nextTextValue());
- } else if ("ReturnType".equals(jp.getCurrentName())) {
- funcImp.setReturnType(jp.nextTextValue());
- } else if ("EntitySet".equals(jp.getCurrentName())) {
- funcImp.setEntitySet(jp.nextTextValue());
- } else if ("EntitySetPath".equals(jp.getCurrentName())) {
- funcImp.setEntitySetPath(jp.nextTextValue());
- } else if ("IsComposable".equals(jp.getCurrentName())) {
- funcImp.setComposable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("IsSideEffecting".equals(jp.getCurrentName())) {
- funcImp.setSideEffecting(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("IsBindable".equals(jp.getCurrentName())) {
- funcImp.setBindable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("IsAlwaysBindable".equals(jp.getCurrentName())) {
- funcImp.setAlwaysBindable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("HttpMethod".equals(jp.getCurrentName())) {
- funcImp.setHttpMethod(jp.nextTextValue());
- } else if ("Parameter".equals(jp.getCurrentName())) {
- jp.nextToken();
- funcImp.getParameters().add(jp.readValueAs( ParameterImpl.class));
- }
- }
- }
-
- return funcImp;
- }
-}
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/edm/xml/v3/FunctionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/FunctionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/FunctionImportImpl.java
deleted file mode 100644
index b648fde..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/FunctionImportImpl.java
+++ /dev/null
@@ -1,138 +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.edm.xml.v3;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.FunctionImport;
-import org.apache.olingo.odata4.client.api.edm.xml.v3.Parameter;
-
-@JsonDeserialize(using = FunctionImportDeserializer.class)
-public class FunctionImportImpl implements FunctionImport {
-
- private static final long serialVersionUID = -6214472528425935461L;
-
- private String name;
-
- private String returnType;
-
- private String entitySet;
-
- private String entitySetPath;
-
- private boolean composable;
-
- private boolean sideEffecting = true;
-
- private boolean bindable;
-
- private boolean alwaysBindable;
-
- private String httpMethod;
-
- private final List<Parameter> parameters = new ArrayList<Parameter>();
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getReturnType() {
- return returnType;
- }
-
- public void setReturnType(final String returnType) {
- this.returnType = returnType;
- }
-
- @Override
- public String getEntitySet() {
- return entitySet;
- }
-
- public void setEntitySet(final String entitySet) {
- this.entitySet = entitySet;
- }
-
- @Override
- public String getEntitySetPath() {
- return entitySetPath;
- }
-
- public void setEntitySetPath(final String entitySetPath) {
- this.entitySetPath = entitySetPath;
- }
-
- @Override
- public boolean isComposable() {
- return composable;
- }
-
- public void setComposable(final boolean composable) {
- this.composable = composable;
- }
-
- @Override
- public boolean isSideEffecting() {
- return sideEffecting;
- }
-
- public void setSideEffecting(final boolean sideEffecting) {
- this.sideEffecting = sideEffecting;
- }
-
- @Override
- public boolean isBindable() {
- return bindable;
- }
-
- public void setBindable(final boolean bindable) {
- this.bindable = bindable;
- }
-
- @Override
- public boolean isAlwaysBindable() {
- return alwaysBindable;
- }
-
- public void setAlwaysBindable(final boolean alwaysBindable) {
- this.alwaysBindable = alwaysBindable;
- }
-
- @Override
- public String getHttpMethod() {
- return httpMethod;
- }
-
- public void setHttpMethod(final String httpMethod) {
- this.httpMethod = httpMethod;
- }
-
- @Override
- public List<Parameter> getParameters() {
- return parameters;
- }
-
-}
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/edm/xml/v3/MemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/MemberImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/MemberImpl.java
deleted file mode 100644
index 91577f7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/MemberImpl.java
+++ /dev/null
@@ -1,27 +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.edm.xml.v3;
-
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractMember;
-
-public class MemberImpl extends AbstractMember {
-
- private static final long serialVersionUID = 6605381518349837929L;
-
-}
[10/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffsetTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffsetTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffsetTest.java
new file mode 100644
index 0000000..f92fbec
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffsetTest.java
@@ -0,0 +1,125 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class EdmDateTimeOffsetTest extends PrimitiveTypeBaseTest {
+
+ final EdmPrimitiveType instance = EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("2009-12-26T21:23:38Z", instance.toUriLiteral("2009-12-26T21:23:38Z"));
+ assertEquals("2002-10-10T12:00:00-05:00", instance.toUriLiteral("2002-10-10T12:00:00-05:00"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("2009-12-26T21:23:38Z", instance.fromUriLiteral("2009-12-26T21:23:38Z"));
+ assertEquals("2002-10-10T12:00:00-05:00", instance.fromUriLiteral("2002-10-10T12:00:00-05:00"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ Calendar dateTime = Calendar.getInstance();
+ dateTime.clear();
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
+ dateTime.set(2012, 1, 29, 1, 2, 3);
+ assertEquals("2012-02-29T01:02:03Z", instance.valueToString(dateTime, null, null, null, null, null));
+ assertEquals("2012-02-29T01:02:03Z", instance.valueToString(dateTime, null, null, 0, null, null));
+ assertEquals("2012-02-29T01:02:03Z", instance.valueToString(dateTime, null, null, 5, null, null));
+
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT-1:30"));
+ assertEquals("2012-02-29T01:02:03-01:30", instance.valueToString(dateTime, null, null, null, null, null));
+
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT+11:00"));
+ assertEquals("2012-02-29T01:02:03+11:00", instance.valueToString(dateTime, null, null, null, null, null));
+
+ final Long millis = 1330558323007L;
+ assertEquals("2012-02-29T23:32:03.007Z", instance.valueToString(millis, null, null, 3, null, null));
+ assertEquals("1969-12-31T23:59:59.9Z", instance.valueToString(-100L, null, null, 1, null, null));
+ assertEquals("1969-12-31T23:59:59.98Z", instance.valueToString(-20L, null, null, 2, null, null));
+
+ final Date date = new Date(millis);
+ final String time = date.toString().substring(11, 19);
+ assertTrue(instance.valueToString(date, null, null, 3, null, null).contains(time));
+
+ expectFacetsErrorInValueToString(instance, millis, null, null, null, null, null);
+ expectFacetsErrorInValueToString(instance, 3L, null, null, 2, null, null);
+
+ expectTypeErrorInValueToString(instance, 0);
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ Calendar dateTime = Calendar.getInstance();
+ dateTime.clear();
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
+ dateTime.set(2012, 1, 29, 1, 2, 3);
+ assertEquals(dateTime, instance.valueOfString("2012-02-29T01:02:03Z", null, null, null, null, null,
+ Calendar.class));
+ assertEquals(Long.valueOf(dateTime.getTimeInMillis()), instance.valueOfString("2012-02-29T01:02:03+00:00", null,
+ null, null, null, null, Long.class));
+ assertEquals(dateTime, instance.valueOfString("2012-02-29T01:02:03", null, null, null, null, null,
+ Calendar.class));
+
+ dateTime.clear();
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT-01:30"));
+ dateTime.set(2012, 1, 29, 1, 2, 3);
+ assertEquals(dateTime.getTime(), instance.valueOfString("2012-02-29T01:02:03-01:30", null, null, null, null, null,
+ Date.class));
+
+ dateTime.clear();
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT+11:00"));
+ dateTime.set(2012, 1, 29, 1, 2, 3);
+ assertEquals(dateTime, instance.valueOfString("2012-02-29T01:02:03+11:00", null, null, null, null, null,
+ Calendar.class));
+
+ dateTime.add(Calendar.MILLISECOND, 7);
+ assertEquals(dateTime, instance.valueOfString("2012-02-29T01:02:03.007+11:00", null, null, 3, null, null,
+ Calendar.class));
+
+ assertEquals(Long.valueOf(120000L), instance.valueOfString("1970-01-01T00:02", null, null, null, null, null,
+ Long.class));
+ assertEquals(Long.valueOf(12L), instance.valueOfString("1970-01-01T00:00:00.012", null, null, 3, null, null,
+ Long.class));
+ assertEquals(Long.valueOf(120L), instance.valueOfString("1970-01-01T00:00:00.12", null, null, 2, null, null,
+ Long.class));
+
+ expectFacetsErrorInValueOfString(instance, "2012-02-29T23:32:02.9Z", null, null, null, null, null);
+ expectFacetsErrorInValueOfString(instance, "2012-02-29T23:32:02.9Z", null, null, 0, null, null);
+ expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02X");
+ expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02+24:00");
+ expectContentErrorInValueOfString(instance, "2012-02-30T01:02:03");
+ expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02.");
+ expectContentErrorInValueOfString(instance, "2012-02-29T23:32:02.0000000000000");
+
+ expectTypeErrorInValueOfString(instance, "2012-02-29T01:02:03Z");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimalTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimalTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimalTest.java
new file mode 100644
index 0000000..9f987a7
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimalTest.java
@@ -0,0 +1,132 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class EdmDecimalTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Decimal.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void compatibility() {
+ assertTrue(instance.isCompatible(Uint7.getInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance()));
+ }
+
+ @Test
+ public void uriLiteral() throws Exception {
+ assertEquals("12.34", instance.toUriLiteral("12.34"));
+ assertEquals("12.34", instance.fromUriLiteral("12.34"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("0", instance.valueToString(0, null, null, null, null, null));
+ assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
+ assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
+ assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
+ assertEquals("-32768", instance.valueToString(-32768, null, null, null, null, null));
+ assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
+ assertEquals("1234567890123456789012345678901", instance.valueToString(new BigInteger(
+ "1234567890123456789012345678901"), null, null, null, null, null));
+ assertEquals("0.00390625", instance.valueToString(1.0 / 256, null, null, null, 8, null));
+ assertEquals("-0.125", instance.valueToString(-0.125f, null, null, null, 3, null));
+ assertEquals("-1234567890.1234567890", instance.valueToString(new BigDecimal(
+ "-1234567890.1234567890"), null, null, null, 10, null));
+
+ assertEquals("-32768", instance.valueToString(-32768, null, null, 42, null, null));
+ assertEquals("-32768", instance.valueToString(-32768, null, null, 5, null, null));
+ assertEquals("32768", instance.valueToString(32768, null, null, 5, null, null));
+ assertEquals("0.5", instance.valueToString(0.5, null, null, 1, 1, null));
+ assertEquals("0.5", instance.valueToString(0.5, null, null, null, 1, null));
+ assertEquals("100", instance.valueToString(new BigDecimal(BigInteger.ONE, -2), null, null, 3, null, null));
+
+ expectFacetsErrorInValueToString(instance, 0.5, null, null, null, null, null);
+ expectFacetsErrorInValueToString(instance, -1234, null, null, 2, null, null);
+ expectFacetsErrorInValueToString(instance, 1234, null, null, 3, null, null);
+ expectFacetsErrorInValueToString(instance, 0.00390625, null, null, 5, null, null);
+ expectFacetsErrorInValueToString(instance, 0.00390625, null, null, null, 7, null);
+
+ expectContentErrorInValueToString(instance, Double.NaN);
+
+ expectTypeErrorInValueToString(instance, 'A');
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(BigDecimal.ONE, instance.valueOfString("1", null, null, null, null, null, BigDecimal.class));
+ assertEquals(Byte.valueOf((byte) -2), instance.valueOfString("-2", null, null, null, null, null, Byte.class));
+ assertEquals(new BigDecimal("-123456789012345678901234567890"), instance.valueOfString(
+ "-123456789012345678901234567890", null, null, null, null, null, BigDecimal.class));
+ assertEquals(Short.valueOf((short) 0), instance.valueOfString("0", null, null, null, null, null, Short.class));
+
+ assertEquals(Integer.valueOf(-32768), instance.valueOfString("-32768", null, null, 42, null, null, Integer.class));
+ assertEquals(Long.valueOf(-32768), instance.valueOfString("-32768", null, null, 5, null, null, Long.class));
+ assertEquals(BigInteger.valueOf(32768), instance.valueOfString("32768", null, null, 5, null, null,
+ BigInteger.class));
+ assertEquals(Double.valueOf(0.5), instance.valueOfString("0.5", null, null, 1, 1, null, Double.class));
+ assertEquals(Float.valueOf(0.5F), instance.valueOfString("0.5", null, null, null, 1, null, Float.class));
+ assertEquals(new BigDecimal("12.3"), instance.valueOfString("12.3", null, null, 3, 1, null, BigDecimal.class));
+
+ expectFacetsErrorInValueOfString(instance, "0.5", null, null, null, null, null);
+ expectFacetsErrorInValueOfString(instance, "-1234", null, null, 2, null, null);
+ expectFacetsErrorInValueOfString(instance, "1234", null, null, 3, null, null);
+ expectFacetsErrorInValueOfString(instance, "12.34", null, null, 3, null, null);
+ expectFacetsErrorInValueOfString(instance, "12.34", null, null, 3, 2, null);
+ expectFacetsErrorInValueOfString(instance, "12.34", null, null, 4, 1, null);
+ expectFacetsErrorInValueOfString(instance, "0.00390625", null, null, 5, null, null);
+ expectFacetsErrorInValueOfString(instance, "0.00390625", null, null, null, 7, null);
+
+ expectContentErrorInValueOfString(instance, "-1E2");
+ expectContentErrorInValueOfString(instance, "1.");
+ expectContentErrorInValueOfString(instance, ".1");
+ expectContentErrorInValueOfString(instance, "1.0.1");
+ expectContentErrorInValueOfString(instance, "1M");
+ expectContentErrorInValueOfString(instance, "0x42");
+
+ expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-2147483649", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "2147483648", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-9223372036854775809", Long.class);
+ expectUnconvertibleErrorInValueOfString(instance, "9223372036854775808", Long.class);
+ expectUnconvertibleErrorInValueOfString(instance, "12345678901234567", Double.class);
+ expectUnconvertibleErrorInValueOfString(instance, "1234567890", Float.class);
+
+ expectTypeErrorInValueOfString(instance, "1");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDoubleTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDoubleTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDoubleTest.java
new file mode 100644
index 0000000..abb3a6b
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDoubleTest.java
@@ -0,0 +1,132 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class EdmDoubleTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Double.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void compatibility() {
+ assertTrue(instance.isCompatible(Uint7.getInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance()));
+ }
+
+ @Test
+ public void toUriLiteral() {
+ assertEquals("127E42", instance.toUriLiteral("127E42"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("127E42", instance.fromUriLiteral("127E42"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("0", instance.valueToString(0, null, null, null, null, null));
+ assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
+ assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
+ assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
+ assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
+ assertEquals("0.00390625", instance.valueToString(1.0 / 256, null, null, null, null, null));
+ assertEquals("4.2E-41", instance.valueToString(42e-42, null, null, null, null, null));
+ assertEquals("INF", instance.valueToString(Double.POSITIVE_INFINITY, null, null, null, null, null));
+ assertEquals("-INF", instance.valueToString(Double.NEGATIVE_INFINITY, null, null, null, null, null));
+ assertEquals("NaN", instance.valueToString(Double.NaN, null, null, null, null, null));
+ assertEquals("-0.125", instance.valueToString(-0.125f, null, null, null, null, null));
+ assertEquals("INF", instance.valueToString(Float.POSITIVE_INFINITY, null, null, null, null, null));
+ assertEquals("-INF", instance.valueToString(Float.NEGATIVE_INFINITY, null, null, null, null, null));
+ assertEquals("NaN", instance.valueToString(Float.NaN, null, null, null, null, null));
+ assertEquals("-1234567890.12345", instance.valueToString(new BigDecimal("-1234567890.12345"), null, null, null,
+ null, null));
+
+ expectContentErrorInValueToString(instance, 3234567890123456L);
+ expectContentErrorInValueToString(instance, new BigDecimal("98765432109876543"));
+ expectContentErrorInValueToString(instance, new BigDecimal(BigInteger.ONE, 324));
+ expectContentErrorInValueToString(instance, new BigDecimal(BigInteger.ONE.negate(), -309));
+
+ expectTypeErrorInValueToString(instance, 'A');
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(Double.valueOf(1.42), instance.valueOfString("1.42", null, null, null, null, null, Double.class));
+ assertEquals(Float.valueOf(-42.25F), instance.valueOfString("-42.25", null, null, null, null, null, Float.class));
+ assertEquals(Double.valueOf(42.0), instance.valueOfString("42", null, null, null, null, null, Double.class));
+ assertEquals(Double.valueOf(42E42), instance.valueOfString("42E42", null, null, null, null, null, Double.class));
+ assertEquals(BigDecimal.TEN, instance.valueOfString("10", null, null, null, null, null, BigDecimal.class));
+ assertEquals(Byte.valueOf((byte) 0), instance.valueOfString("0", null, null, null, null, null, Byte.class));
+ assertEquals(Short.valueOf((short) 1), instance.valueOfString("1.00", null, null, null, null, null, Short.class));
+ assertEquals(Integer.valueOf(42), instance.valueOfString("4.2E1", null, null, null, null, null, Integer.class));
+ assertEquals(Long.valueOf(1234567890), instance.valueOfString("1234567890E-00", null, null, null, null, null,
+ Long.class));
+
+ assertEquals(Double.valueOf(Double.NaN), instance.valueOfString("NaN", null, null, null, null, null,
+ Double.class));
+ assertEquals(Double.valueOf(Double.NEGATIVE_INFINITY), instance.valueOfString("-INF", null, null, null, null,
+ null, Double.class));
+ assertEquals(Float.valueOf(Float.POSITIVE_INFINITY), instance.valueOfString("INF", null, null, null, null, null,
+ Float.class));
+
+ expectContentErrorInValueOfString(instance, "0.");
+ expectContentErrorInValueOfString(instance, ".0");
+ expectContentErrorInValueOfString(instance, "1234567890.12345678");
+ expectContentErrorInValueOfString(instance, "42E400");
+ expectContentErrorInValueOfString(instance, "42.42.42");
+ expectContentErrorInValueOfString(instance, "42F");
+ expectContentErrorInValueOfString(instance, "0x42P42");
+
+ expectUnconvertibleErrorInValueOfString(instance, "INF", BigDecimal.class);
+ expectUnconvertibleErrorInValueOfString(instance, "NaN", BigDecimal.class);
+ expectUnconvertibleErrorInValueOfString(instance, "1234567.0625", Float.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-INF", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "NaN", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "5E-1", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "5E-1", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "5E-1", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "5E-1", Long.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-2147483649", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "2147483648", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-922337203685477.5E10", Long.class);
+ expectUnconvertibleErrorInValueOfString(instance, "922337203685477.5E10", Long.class);
+
+ expectTypeErrorInValueOfString(instance, "1.42");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDurationTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDurationTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDurationTest.java
new file mode 100644
index 0000000..7b97f7e
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDurationTest.java
@@ -0,0 +1,105 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class EdmDurationTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Duration.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("duration'P120D'", instance.toUriLiteral("P120D"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("P120D", instance.fromUriLiteral("duration'P120D'"));
+
+ expectErrorInFromUriLiteral(instance, "");
+ expectErrorInFromUriLiteral(instance, "Duration'PT1S'");
+ expectErrorInFromUriLiteral(instance, "duration'PT1S\"");
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("PT10S", instance.valueToString(BigDecimal.TEN, null, null, null, null, null));
+ assertEquals("-PT10S", instance.valueToString(BigDecimal.TEN.negate(), null, null, null, null, null));
+ assertEquals("PT10S", instance.valueToString(BigDecimal.TEN, null, null, null, null, null));
+ assertEquals("PT10S", instance.valueToString(BigDecimal.TEN, null, null, 0, null, null));
+ assertEquals("-PT0.01S", instance.valueToString(BigDecimal.ONE.movePointLeft(2).negate(), null, null, 2, null,
+ null));
+ assertEquals("PT2M3S", instance.valueToString(123, null, null, null, null, null));
+ assertEquals("PT2M3S", instance.valueToString((byte) 123, null, null, null, null, null));
+ assertEquals("PT3H25M45S", instance.valueToString((short) 12345, null, null, null, null, null));
+ assertEquals("P14288DT23H31M30S", instance.valueToString(1234567890L, null, null, null, null, null));
+ assertEquals("P50903316DT2H25M4S", instance.valueToString(BigInteger.ONE.shiftLeft(42), null, null, null, null,
+ null));
+
+ expectFacetsErrorInValueToString(instance, BigDecimal.ONE.movePointLeft(1), null, null, null, null, null);
+ expectFacetsErrorInValueToString(instance, BigDecimal.ONE.movePointLeft(1), null, null, 0, null, null);
+
+ expectTypeErrorInValueToString(instance, "");
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(BigDecimal.TEN, instance.valueOfString("PT10S", null, null, null, null, null, BigDecimal.class));
+ assertEquals(BigDecimal.TEN.negate(), instance.valueOfString("-PT10S", null, null, null, null, null,
+ BigDecimal.class));
+ assertEquals(BigDecimal.TEN, instance.valueOfString("PT10S", null, null, null, null, null, BigDecimal.class));
+ assertEquals(BigDecimal.ONE.movePointLeft(1), instance.valueOfString("PT0.1S", null, null, 1, null, null,
+ BigDecimal.class));
+ assertEquals(Byte.valueOf((byte) 123), instance.valueOfString("PT2M3S", null, null, null, null, null, Byte.class));
+ assertEquals(Short.valueOf((short) 123), instance.valueOfString("PT2M3S", null, null, null, null, null,
+ Short.class));
+ assertEquals(Integer.valueOf(12345), instance.valueOfString("PT3H25M45S", null, null, null, null, null,
+ Integer.class));
+ assertEquals(Long.valueOf(1234567890L), instance.valueOfString("P14288DT23H31M30S", null, null, null, null, null,
+ Long.class));
+ assertEquals(BigInteger.ONE.shiftLeft(42), instance.valueOfString("P50903316DT2H25M4S", null, null, null, null,
+ null, BigInteger.class));
+
+ expectFacetsErrorInValueOfString(instance, "PT1.1S", null, null, null, null, null);
+ expectFacetsErrorInValueOfString(instance, "PT1H2M3.123S", null, null, 2, null, null);
+ expectFacetsErrorInValueOfString(instance, "PT13H2M3.9S", null, null, 0, null, null);
+
+ expectContentErrorInValueOfString(instance, "PT1H2M3S.1234");
+ expectContentErrorInValueOfString(instance, "P2012Y2M29DT23H32M2S");
+ expectContentErrorInValueOfString(instance, "PT-1H");
+ expectContentErrorInValueOfString(instance, "PT");
+
+ expectUnconvertibleErrorInValueOfString(instance, "-PT2M9S", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "PT2M8S", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "PT10H", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "P25000D", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "P123456789012345D", Long.class);
+ // expectUnconvertibleErrorInValueOfString(instance, "PT1.1S", BigInteger.class);
+
+ expectTypeErrorInValueOfString(instance, "PT0S");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuidTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuidTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuidTest.java
new file mode 100644
index 0000000..c6d73ca
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuidTest.java
@@ -0,0 +1,68 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.UUID;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class EdmGuidTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Guid.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void toUriLiteral() {
+ assertEquals("aabbccdd-aabb-ccdd-eeff-aabbccddeeff",
+ instance.toUriLiteral("aabbccdd-aabb-ccdd-eeff-aabbccddeeff"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("aabbccdd-aabb-ccdd-eeff-aabbccddeeff",
+ instance.fromUriLiteral("aabbccdd-aabb-ccdd-eeff-aabbccddeeff"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ final UUID uuid = UUID.randomUUID();
+ assertEquals(uuid.toString(), instance.valueToString(uuid, null, null, null, null, null));
+
+ expectTypeErrorInValueToString(instance, 'A');
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ final UUID uuid = UUID.fromString("aabbccdd-aabb-ccdd-eeff-aabbccddeeff");
+
+ assertEquals(uuid, instance.valueOfString("aabbccdd-aabb-ccdd-eeff-aabbccddeeff", null, null, null, null, null,
+ UUID.class));
+ assertEquals(uuid, instance.valueOfString("AABBCCDD-AABB-CCDD-EEFF-AABBCCDDEEFF", null, null, null, null, null,
+ UUID.class));
+ assertEquals(uuid, instance.valueOfString("AABBCCDD-aabb-ccdd-eeff-AABBCCDDEEFF", null, null, null, null, null,
+ UUID.class));
+
+ expectContentErrorInValueOfString(instance, "AABBCCDDAABBCCDDEEFFAABBCCDDEEFF");
+
+ expectTypeErrorInValueOfString(instance, uuid.toString());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16Test.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16Test.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16Test.java
new file mode 100644
index 0000000..458e1d4
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16Test.java
@@ -0,0 +1,88 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class EdmInt16Test extends PrimitiveTypeBaseTest {
+
+ final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void testInt16Compatibility() {
+ assertTrue(instance.isCompatible(Uint7.getInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
+ }
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("127", instance.toUriLiteral("127"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("127", instance.fromUriLiteral("127"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("0", instance.valueToString(0, null, null, null, null, null));
+ assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
+ assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
+ assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
+ assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
+ assertEquals("-32768", instance.valueToString(BigInteger.valueOf(Short.MIN_VALUE), null, null, null, null, null));
+
+ expectContentErrorInValueToString(instance, 123456);
+ expectContentErrorInValueToString(instance, -32769);
+ expectContentErrorInValueToString(instance, BigInteger.valueOf(32768));
+
+ expectTypeErrorInValueToString(instance, 1.0);
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(Byte.valueOf((byte) 1), instance.valueOfString("1", null, null, null, null, null, Byte.class));
+ assertEquals(Short.valueOf((short) 2), instance.valueOfString("2", null, null, null, null, null, Short.class));
+ assertEquals(Short.valueOf((short) -32768), instance.valueOfString("-32768", null, null, null, null, null,
+ Short.class));
+ assertEquals(Short.valueOf((short) 32767), instance.valueOfString("32767", null, null, null, null, null,
+ Short.class));
+ assertEquals(Integer.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Integer.class));
+ assertEquals(Long.valueOf(-1), instance.valueOfString("-1", null, null, null, null, null, Long.class));
+ assertEquals(BigInteger.TEN, instance.valueOfString("10", null, null, null, null, null, BigInteger.class));
+
+ expectContentErrorInValueOfString(instance, "32768");
+ expectContentErrorInValueOfString(instance, "1.0");
+
+ expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
+
+ expectTypeErrorInValueOfString(instance, "1");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32Test.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32Test.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32Test.java
new file mode 100644
index 0000000..f0ada7e
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32Test.java
@@ -0,0 +1,89 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class EdmInt32Test extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void compatibility() {
+ assertTrue(instance.isCompatible(Uint7.getInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
+ }
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("127", instance.toUriLiteral("127"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("127", instance.fromUriLiteral("127"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("0", instance.valueToString(0, null, null, null, null, null));
+ assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
+ assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
+ assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
+ assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
+ assertEquals("-2147483648", instance.valueToString(BigInteger.valueOf(Integer.MIN_VALUE), null, null, null, null,
+ null));
+
+ expectContentErrorInValueToString(instance, 12345678901L);
+ expectContentErrorInValueToString(instance, -2147483649L);
+ expectContentErrorInValueToString(instance, BigInteger.valueOf(2147483648L));
+
+ expectTypeErrorInValueToString(instance, 1.0);
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(Byte.valueOf((byte) 1), instance.valueOfString("1", null, null, null, null, null, Byte.class));
+ assertEquals(Short.valueOf((short) 2), instance.valueOfString("2", null, null, null, null, null, Short.class));
+ assertEquals(Integer.valueOf(-10000000), instance.valueOfString("-10000000", null, null, null, null, null,
+ Integer.class));
+ assertEquals(Long.valueOf(10000000), instance.valueOfString("10000000", null, null, null, null, null, Long.class));
+ assertEquals(BigInteger.TEN, instance.valueOfString("10", null, null, null, null, null, BigInteger.class));
+
+ expectContentErrorInValueOfString(instance, "-2147483649");
+ expectContentErrorInValueOfString(instance, "1.0");
+
+ expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
+
+ expectTypeErrorInValueOfString(instance, "1");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64Test.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64Test.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64Test.java
new file mode 100644
index 0000000..d704770
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64Test.java
@@ -0,0 +1,96 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class EdmInt64Test extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void compatibility() {
+ assertTrue(instance.isCompatible(Uint7.getInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance()));
+ }
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("127", instance.toUriLiteral("127"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("127", instance.fromUriLiteral("127"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("0", instance.valueToString(0, null, null, null, null, null));
+ assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
+ assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
+ assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
+ assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
+ assertEquals("12345678901", instance.valueToString(12345678901L, null, null, null, null, null));
+ assertEquals("1234567890123456789", instance.valueToString(new BigInteger("1234567890123456789"), null, null, null,
+ null, null));
+ assertEquals("-1234567890123456789", instance.valueToString(new BigInteger("-1234567890123456789"), null, null,
+ null, null, null));
+
+ expectContentErrorInValueToString(instance, new BigInteger("123456789012345678901"));
+
+ expectTypeErrorInValueToString(instance, 1.0);
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(Short.valueOf((short) 1), instance.valueOfString("1", null, null, null, null, null, Short.class));
+ assertEquals(Integer.valueOf(2), instance.valueOfString("2", null, null, null, null, null, Integer.class));
+ assertEquals(Long.valueOf(-1234567890123456789L), instance.valueOfString("-1234567890123456789", null, null, null,
+ null, null, Long.class));
+ assertEquals(BigInteger.ONE, instance.valueOfString("1", null, null, null, null, null, BigInteger.class));
+ assertEquals(Long.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Long.class));
+ assertEquals(Byte.valueOf((byte) 0), instance.valueOfString("0", null, null, null, null, null, Byte.class));
+
+ expectContentErrorInValueOfString(instance, "-12345678901234567890");
+ expectContentErrorInValueOfString(instance, "1.0");
+ expectContentErrorInValueOfString(instance, "0L");
+ expectContentErrorInValueOfString(instance, "0x42");
+
+ expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-2147483649", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "2147483648", Integer.class);
+
+ expectTypeErrorInValueOfString(instance, "1");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmNullTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmNullTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmNullTest.java
new file mode 100644
index 0000000..3a9daaf
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmNullTest.java
@@ -0,0 +1,50 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertNull;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class EdmNullTest extends PrimitiveTypeBaseTest {
+
+ @Test
+ public void checkNull() throws Exception {
+ for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
+ final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
+ assertNull(instance.valueToString(null, null, null, null, null, null));
+ assertNull(instance.valueToString(null, true, null, null, null, null));
+
+ expectNullErrorInValueToString(instance);
+ }
+ }
+
+ @Test
+ public void checkValueOfNull() throws Exception {
+ for (EdmPrimitiveTypeKind kind : EdmPrimitiveTypeKind.values()) {
+ final EdmPrimitiveType instance = kind.getEdmPrimitiveTypeInstance();
+ assertNull(instance.valueOfString(null, null, null, null, null, null, instance.getDefaultType()));
+ assertNull(instance.valueOfString(null, true, null, null, null, null, instance.getDefaultType()));
+
+ expectNullErrorInValueOfString(instance);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByteTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByteTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByteTest.java
new file mode 100644
index 0000000..0ebb342
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByteTest.java
@@ -0,0 +1,82 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class EdmSByteTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void compatibility() {
+ assertTrue(instance.isCompatible(Uint7.getInstance()));
+ }
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("127", instance.toUriLiteral("127"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("127", instance.fromUriLiteral("127"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("0", instance.valueToString(0, null, null, null, null, null));
+ assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
+ assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
+ assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
+ assertEquals("64", instance.valueToString(64L, null, null, null, null, null));
+ assertEquals("-128", instance.valueToString(BigInteger.valueOf(Byte.MIN_VALUE), null, null, null, null, null));
+
+ expectContentErrorInValueToString(instance, -129);
+ expectContentErrorInValueToString(instance, 128);
+ expectContentErrorInValueToString(instance, BigInteger.valueOf(128));
+
+ expectTypeErrorInValueToString(instance, 'A');
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(Byte.valueOf((byte) 1), instance.valueOfString("1", null, null, null, null, null, Byte.class));
+ assertEquals(Short.valueOf((short) -2), instance.valueOfString("-2", null, null, null, null, null, Short.class));
+ assertEquals(Byte.valueOf((byte) 127), instance.valueOfString("127", null, null, null, null, null, Byte.class));
+ assertEquals(Byte.valueOf((byte) -128), instance.valueOfString("-128", null, null, null, null, null, Byte.class));
+ assertEquals(Integer.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Integer.class));
+ assertEquals(Long.valueOf(0), instance.valueOfString("0", null, null, null, null, null, Long.class));
+ assertEquals(BigInteger.TEN, instance.valueOfString("10", null, null, null, null, null, BigInteger.class));
+
+ expectContentErrorInValueOfString(instance, "128");
+ expectContentErrorInValueOfString(instance, "-129");
+ expectContentErrorInValueOfString(instance, "1.0");
+
+ expectTypeErrorInValueOfString(instance, "1");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSingleTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSingleTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSingleTest.java
new file mode 100644
index 0000000..67847c7
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSingleTest.java
@@ -0,0 +1,138 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class EdmSingleTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.Single.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void compatibility() {
+ assertTrue(instance.isCompatible(Uint7.getInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Byte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.SByte.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int16.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance()));
+ assertTrue(instance.isCompatible(EdmPrimitiveTypeKind.Int64.getEdmPrimitiveTypeInstance()));
+ }
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("127", instance.toUriLiteral("127"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("127", instance.fromUriLiteral("127"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("0", instance.valueToString(0, null, null, null, null, null));
+ assertEquals("8", instance.valueToString((byte) 8, null, null, null, null, null));
+ assertEquals("16", instance.valueToString((short) 16, null, null, null, null, null));
+ assertEquals("32", instance.valueToString(Integer.valueOf(32), null, null, null, null, null));
+ assertEquals("255", instance.valueToString(255L, null, null, null, null, null));
+ assertEquals("0.00390625", instance.valueToString(1.0 / 256, null, null, null, null, null));
+ assertEquals("4.2E-8", instance.valueToString(42e-9, null, null, null, null, null));
+ assertEquals("INF", instance.valueToString(Double.POSITIVE_INFINITY, null, null, null, null, null));
+ assertEquals("-INF", instance.valueToString(Double.NEGATIVE_INFINITY, null, null, null, null, null));
+ assertEquals("NaN", instance.valueToString(Double.NaN, null, null, null, null, null));
+ assertEquals("-0.125", instance.valueToString(-0.125f, null, null, null, null, null));
+ assertEquals("INF", instance.valueToString(Float.POSITIVE_INFINITY, null, null, null, null, null));
+ assertEquals("-INF", instance.valueToString(Float.NEGATIVE_INFINITY, null, null, null, null, null));
+ assertEquals("NaN", instance.valueToString(Float.NaN, null, null, null, null, null));
+ assertEquals("-123456.75", instance.valueToString(new BigDecimal("-123456.75"), null, null, null, null, null));
+
+ expectContentErrorInValueToString(instance, 12345678L);
+ expectContentErrorInValueToString(instance, new BigDecimal("123456789"));
+ expectContentErrorInValueToString(instance, new BigDecimal(BigInteger.ONE, -39));
+ expectContentErrorInValueToString(instance, 42e38);
+ expectContentErrorInValueToString(instance, 12345.6789);
+ expectContentErrorInValueToString(instance, 1E-50);
+
+ expectTypeErrorInValueToString(instance, 'A');
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals(Float.valueOf(1.42F), instance.valueOfString("1.42", null, null, null, null, null, Float.class));
+ assertEquals(Double.valueOf(-42.42), instance.valueOfString("-42.42", null, null, null, null, null, Double.class));
+ assertEquals(Float.valueOf(42.0F), instance.valueOfString("42", null, null, null, null, null, Float.class));
+ assertEquals(Float.valueOf(2.2E38F), instance.valueOfString("22E37", null, null, null, null, null, Float.class));
+ assertEquals(Float.valueOf(1.23E-38F), instance.valueOfString("12.3E-39", null, null, null, null, null,
+ Float.class));
+ assertEquals(BigDecimal.TEN, instance.valueOfString("10", null, null, null, null, null, BigDecimal.class));
+ assertEquals(Byte.valueOf((byte) 0), instance.valueOfString("0", null, null, null, null, null, Byte.class));
+ assertEquals(Short.valueOf((short) 1), instance.valueOfString("1.00", null, null, null, null, null, Short.class));
+ assertEquals(Integer.valueOf(42), instance.valueOfString("4.2E1", null, null, null, null, null, Integer.class));
+ assertEquals(Long.valueOf(12345678), instance.valueOfString("12345.678E+03", null, null, null, null, null,
+ Long.class));
+
+ assertEquals(Float.valueOf(Float.NaN), instance.valueOfString("NaN", null, null, null, null, null, Float.class));
+ assertEquals(Float.valueOf(Float.NEGATIVE_INFINITY), instance.valueOfString("-INF", null, null, null, null, null,
+ Float.class));
+ assertEquals(Float.valueOf(Float.POSITIVE_INFINITY), instance.valueOfString("INF", null, null, null, null, null,
+ Float.class));
+ assertEquals(Double.valueOf(Double.NaN), instance.valueOfString("NaN", null, null, null, null, null,
+ Double.class));
+ assertEquals(Double.valueOf(Double.NEGATIVE_INFINITY), instance.valueOfString("-INF", null, null, null, null, null,
+ Double.class));
+
+ expectContentErrorInValueOfString(instance, "0.");
+ expectContentErrorInValueOfString(instance, ".0");
+ expectContentErrorInValueOfString(instance, "1E-50");
+ expectContentErrorInValueOfString(instance, "12345.6789");
+ expectContentErrorInValueOfString(instance, "42E42");
+ expectContentErrorInValueOfString(instance, "42.42.42");
+ expectContentErrorInValueOfString(instance, "42.42.42");
+ expectContentErrorInValueOfString(instance, "42D");
+ expectContentErrorInValueOfString(instance, "0x42P4");
+
+ expectUnconvertibleErrorInValueOfString(instance, "INF", BigDecimal.class);
+ expectUnconvertibleErrorInValueOfString(instance, "NaN", BigDecimal.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-INF", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "NaN", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "5E-1", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "5E-1", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "5E-1", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "5E-1", Long.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-129", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "128", Byte.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-32769", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "32768", Short.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-2147483.65E3", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "2147483.65E3", Integer.class);
+ expectUnconvertibleErrorInValueOfString(instance, "-1E19", Long.class);
+ expectUnconvertibleErrorInValueOfString(instance, "1E19", Long.class);
+
+ expectTypeErrorInValueOfString(instance, "1.42");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java
new file mode 100644
index 0000000..993c943
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class EdmStringTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("'StringValue'", instance.toUriLiteral("StringValue"));
+ assertEquals("'String''Value'", instance.toUriLiteral("String'Value"));
+ assertEquals("'String''''''Value'", instance.toUriLiteral("String'''Value"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("String''Value", instance.fromUriLiteral("'String''''Value'"));
+
+ expectErrorInFromUriLiteral(instance, "");
+ expectErrorInFromUriLiteral(instance, "'");
+ expectErrorInFromUriLiteral(instance, "'\"");
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ assertEquals("text", instance.valueToString("text", null, null, null, null, null));
+ assertEquals("a\nb", instance.valueToString("a\nb", null, null, null, null, null));
+ assertEquals("true", instance.valueToString(true, null, null, null, null, null));
+ assertEquals("a'b", instance.valueToString("a'b", null, null, null, null, null));
+
+ assertEquals("text", instance.valueToString("text", null, null, null, null, true));
+ assertEquals("text", instance.valueToString("text", null, 4, null, null, null));
+ assertEquals("text", instance.valueToString("text", null, Integer.MAX_VALUE, null, null, null));
+
+ expectFacetsErrorInValueToString(instance, "schräg", null, null, null, null, false);
+ expectFacetsErrorInValueToString(instance, "text", null, 3, null, null, null);
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ assertEquals("text", instance.valueOfString("text", null, null, null, null, null, String.class));
+ assertEquals("a\nb", instance.valueOfString("a\nb", null, null, null, null, null, String.class));
+ assertEquals("true", instance.valueOfString("true", null, null, null, null, null, String.class));
+ assertEquals("'a''b'", instance.valueOfString("'a''b'", null, null, null, null, null, String.class));
+
+ assertEquals("text", instance.valueOfString("text", null, null, null, null, true, String.class));
+ assertEquals("text", instance.valueOfString("text", null, 4, null, null, null, String.class));
+ assertEquals("text", instance.valueOfString("text", null, Integer.MAX_VALUE, null, null, null, String.class));
+
+ expectFacetsErrorInValueOfString(instance, "schräg", null, null, null, null, false);
+ expectFacetsErrorInValueOfString(instance, "text", null, 3, null, null, null);
+
+ expectTypeErrorInValueOfString(instance, "text");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmTimeOfDayTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmTimeOfDayTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmTimeOfDayTest.java
new file mode 100644
index 0000000..8979df9
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmTimeOfDayTest.java
@@ -0,0 +1,93 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Calendar;
+import java.util.TimeZone;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class EdmTimeOfDayTest extends PrimitiveTypeBaseTest {
+
+ private final EdmPrimitiveType instance = EdmPrimitiveTypeKind.TimeOfDay.getEdmPrimitiveTypeInstance();
+
+ @Test
+ public void toUriLiteral() throws Exception {
+ assertEquals("11:12", instance.toUriLiteral("11:12"));
+ assertEquals("11:12:13.012", instance.toUriLiteral("11:12:13.012"));
+ }
+
+ @Test
+ public void fromUriLiteral() throws Exception {
+ assertEquals("11:12", instance.fromUriLiteral("11:12"));
+ assertEquals("11:12:13.012", instance.fromUriLiteral("11:12:13.012"));
+ }
+
+ @Test
+ public void valueToString() throws Exception {
+ Calendar dateTime = Calendar.getInstance();
+ dateTime.clear();
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT+11:30"));
+ dateTime.set(1, 2, 3, 4, 5, 6);
+ assertEquals("04:05:06", instance.valueToString(dateTime, null, null, null, null, null));
+
+ dateTime.add(Calendar.MILLISECOND, 42);
+ assertEquals("04:05:06.042", instance.valueToString(dateTime, null, null, 3, null, null));
+ assertEquals("04:05:06.042", instance.valueToString(dateTime, null, null, 4, null, null));
+
+ expectFacetsErrorInValueToString(instance, dateTime, null, null, null, null, null);
+ expectFacetsErrorInValueToString(instance, dateTime, null, null, 2, null, null);
+
+ expectTypeErrorInValueToString(instance, 0);
+ }
+
+ @Test
+ public void valueOfString() throws Exception {
+ Calendar dateTime = Calendar.getInstance();
+ dateTime.clear();
+ dateTime.setTimeZone(TimeZone.getTimeZone("GMT"));
+
+ assertEquals(dateTime, instance.valueOfString("00:00", null, null, null, null, null, Calendar.class));
+ assertEquals(dateTime, instance.valueOfString("00:00:00", null, null, null, null, null, Calendar.class));
+ assertEquals(dateTime, instance.valueOfString("00:00:00.000000000000", null, null, null, null, null,
+ Calendar.class));
+
+ dateTime.set(Calendar.MILLISECOND, 999);
+ assertEquals(dateTime, instance.valueOfString("00:00:00.999", null, null, 3, null, null, Calendar.class));
+ assertEquals(dateTime, instance.valueOfString("00:00:00.999", null, null, 3, null, null, Calendar.class));
+
+ expectFacetsErrorInValueOfString(instance, "11:12:13.123", null, null, null, null, null);
+ expectFacetsErrorInValueOfString(instance, "11:12:13.123", null, null, 2, null, null);
+
+ expectContentErrorInValueOfString(instance, "24:32:02");
+ expectContentErrorInValueOfString(instance, "011:12:13");
+ expectContentErrorInValueOfString(instance, "11:12:13:14");
+ expectContentErrorInValueOfString(instance, "111213");
+ expectContentErrorInValueOfString(instance, "1:2:3");
+ expectContentErrorInValueOfString(instance, "11:12:13.0.1");
+ expectContentErrorInValueOfString(instance, "11:12:13.");
+ expectContentErrorInValueOfString(instance, "11:12:13.0000000000000");
+
+ expectTypeErrorInValueOfString(instance, "11:12:13");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/PrimitiveTypeBaseTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/PrimitiveTypeBaseTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/PrimitiveTypeBaseTest.java
new file mode 100644
index 0000000..fd752fc
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/PrimitiveTypeBaseTest.java
@@ -0,0 +1,119 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+
+public abstract class PrimitiveTypeBaseTest {
+
+ private void expectErrorInValueToString(final EdmPrimitiveType instance,
+ final Object value, final Boolean isNullable, final Integer maxLength,
+ final Integer precision, final Integer scale, final Boolean isUnicode,
+ final String messageReferenceString) {
+ try {
+ instance.valueToString(value, isNullable, maxLength, precision, scale, isUnicode);
+ fail("Expected exception not thrown");
+ } catch (final EdmPrimitiveTypeException e) {
+ assertNotNull(e.getLocalizedMessage());
+ assertTrue(e.getLocalizedMessage().startsWith(messageReferenceString));
+ }
+ }
+
+ private void expectErrorInValueToString(final EdmPrimitiveType instance, final Object value,
+ final String messageReference) {
+ expectErrorInValueToString(instance, value, null, null, null, null, null, messageReference);
+ }
+
+ protected void expectTypeErrorInValueToString(final EdmPrimitiveType instance, final Object value) {
+ expectErrorInValueToString(instance, value, "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED");
+ }
+
+ protected void expectContentErrorInValueToString(final EdmPrimitiveType instance, final Object value) {
+ expectErrorInValueToString(instance, value, "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT");
+ }
+
+ protected void expectFacetsErrorInValueToString(final EdmPrimitiveType instance, final Object value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) {
+ expectErrorInValueToString(instance, value, isNullable, maxLength, precision, scale, isUnicode,
+ "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED");
+ }
+
+ protected void expectNullErrorInValueToString(final EdmPrimitiveType instance) {
+ expectErrorInValueToString(instance, null, false, null, null, null, null,
+ "EdmPrimitiveTypeException.VALUE_NULL_NOT_ALLOWED");
+ }
+
+ private void expectErrorInValueOfString(final EdmPrimitiveType instance,
+ final String value, final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode, final Class<?> returnType,
+ final String messageReferenceString) {
+
+ try {
+ instance.valueOfString(value, isNullable, maxLength, precision, scale, isUnicode, returnType);
+ fail("Expected exception not thrown");
+ } catch (final EdmPrimitiveTypeException e) {
+ assertNotNull(e.getLocalizedMessage());
+ assertTrue(e.getLocalizedMessage().startsWith(messageReferenceString));
+ }
+ }
+
+ protected void expectTypeErrorInValueOfString(final EdmPrimitiveType instance, final String value) {
+ expectErrorInValueOfString(instance, value, null, null, null, null, null, Class.class,
+ "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED");
+ }
+
+ protected void expectUnconvertibleErrorInValueOfString(final EdmPrimitiveType instance, final String value,
+ final Class<?> type) {
+ expectErrorInValueOfString(instance, value, null, null, null, null, null, type,
+ "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE");
+ }
+
+ protected void expectContentErrorInValueOfString(final EdmPrimitiveType instance, final String value) {
+ expectErrorInValueOfString(instance, value, null, null, null, null, null, instance.getDefaultType(),
+ "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT");
+ }
+
+ protected void expectFacetsErrorInValueOfString(final EdmPrimitiveType instance, final String value,
+ final Boolean isNullable, final Integer maxLength, final Integer precision,
+ final Integer scale, final Boolean isUnicode) {
+ expectErrorInValueOfString(instance, value, isNullable, maxLength, precision, scale, isUnicode,
+ instance.getDefaultType(), "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED");
+ }
+
+ protected void expectNullErrorInValueOfString(final EdmPrimitiveType instance) {
+ expectErrorInValueOfString(instance, null, false, null, null, null, null, instance.getDefaultType(),
+ "EdmPrimitiveTypeException.LITERAL_NULL_NOT_ALLOWED");
+ }
+
+ protected void expectErrorInFromUriLiteral(final EdmPrimitiveType instance, final String value) {
+ try {
+ instance.fromUriLiteral(value);
+ fail("Expected exception not thrown");
+ } catch (final EdmPrimitiveTypeException e) {
+ assertNotNull(e.getLocalizedMessage());
+ assertTrue(e.getLocalizedMessage().startsWith("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/UInt7Test.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/UInt7Test.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/UInt7Test.java
new file mode 100644
index 0000000..05807ee
--- /dev/null
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/UInt7Test.java
@@ -0,0 +1,35 @@
+/*
+ * 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.commons.core.edm.primitivetype;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.core.edm.primitivetype.Uint7;
+import org.junit.Test;
+
+public class UInt7Test extends PrimitiveTypeBaseTest {
+
+ @Test
+ public void compatibility() {
+ assertTrue(Uint7.getInstance().isCompatible(Uint7.getInstance()));
+ assertFalse(Uint7.getInstance().isCompatible(EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/ActionMapKeyTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/ActionMapKeyTest.java b/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/ActionMapKeyTest.java
deleted file mode 100644
index 339b9be..0000000
--- a/lib/commons-core/src/test/java/org/apache/olingo/odata4/commons/core/edm/ActionMapKeyTest.java
+++ /dev/null
@@ -1,101 +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.commons.core.edm;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.fail;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmException;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.junit.Test;
-
-public class ActionMapKeyTest {
-
- private final FullQualifiedName fqn = new FullQualifiedName("namespace", "name");
-
- private final FullQualifiedName fqnType = new FullQualifiedName("namespace2", "name2");
-
- @Test
- public void invalidParametersTest() {
- createAndCheckForEdmException(null, null, null);
- createAndCheckForEdmException(fqn, null, null);
- createAndCheckForEdmException(fqn, fqnType, null);
- createAndCheckForEdmException(fqn, null, true);
- createAndCheckForEdmException(null, fqnType, true);
- createAndCheckForEdmException(null, fqnType, null);
- createAndCheckForEdmException(null, null, true);
-
- }
-
- private void createAndCheckForEdmException(final FullQualifiedName fqn, final FullQualifiedName typeName,
- final Boolean collection) {
- try {
- new ActionMapKey(fqn, typeName, collection);
- } catch (EdmException e) {
- return;
- }
- fail("EdmException expected for parameters: " + fqn + " " + typeName + " " + collection);
- }
-
- @Test
- public void testEqualsMethod() {
- ActionMapKey key;
- ActionMapKey someKey;
-
- key = new ActionMapKey(fqn, fqnType, false);
- someKey = new ActionMapKey(fqn, fqnType, false);
- assertEquals(key, someKey);
-
- key = new ActionMapKey(fqn, fqnType, new Boolean(false));
- someKey = new ActionMapKey(fqn, fqnType, false);
- assertEquals(key, someKey);
-
- key = new ActionMapKey(fqn, fqnType, true);
- someKey = new ActionMapKey(fqn, fqnType, false);
- assertNotSame(key, someKey);
-
- key = new ActionMapKey(fqn, fqnType, true);
- someKey = new ActionMapKey(fqn, fqnType, new Boolean(false));
- assertNotSame(key, someKey);
- }
-
- @Test
- public void testHashMethod() {
- ActionMapKey key;
- ActionMapKey someKey;
-
- key = new ActionMapKey(fqn, fqnType, false);
- someKey = new ActionMapKey(fqn, fqnType, false);
- assertEquals(key.hashCode(), someKey.hashCode());
-
- key = new ActionMapKey(fqn, fqnType, new Boolean(false));
- someKey = new ActionMapKey(fqn, fqnType, false);
- assertEquals(key.hashCode(), someKey.hashCode());
-
- key = new ActionMapKey(fqn, fqnType, true);
- someKey = new ActionMapKey(fqn, fqnType, false);
- assertNotSame(key.hashCode(), someKey.hashCode());
-
- key = new ActionMapKey(fqn, fqnType, true);
- someKey = new ActionMapKey(fqn, fqnType, new Boolean(false));
- assertNotSame(key.hashCode(), someKey.hashCode());
- }
-
-}
[07/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityType.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityType.java
deleted file mode 100644
index dec7584..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EntityType.java
+++ /dev/null
@@ -1,84 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class EntityType extends StructuredType {
-
- private List<PropertyRef> key;
-
- private boolean hasStream;
-
- public boolean hasStream() {
- return hasStream;
- }
-
- public EntityType setHasStream(final boolean hasStream) {
- this.hasStream = hasStream;
- return this;
- }
-
- public List<PropertyRef> getKey() {
- return key;
- }
-
- public EntityType setKey(final List<PropertyRef> key) {
- this.key = key;
- return this;
- }
-
- @Override
- public EntityType setName(final String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public EntityType setOpenType(final boolean isOpenType) {
- this.isOpenType = isOpenType;
- return this;
- }
-
- @Override
- public EntityType setBaseType(final FullQualifiedName baseType) {
- this.baseType = baseType;
- return this;
- }
-
- @Override
- public EntityType setAbstract(final boolean isAbstract) {
- this.isAbstract = isAbstract;
- return this;
- }
-
- @Override
- public EntityType setProperties(final List<Property> properties) {
- this.properties = properties;
- return this;
- }
-
- @Override
- public EntityType setNavigationProperties(final List<NavigationProperty> navigationProperties) {
- this.navigationProperties = navigationProperties;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EnumMember.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EnumMember.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EnumMember.java
deleted file mode 100644
index 83870c9..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EnumMember.java
+++ /dev/null
@@ -1,49 +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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmMember;
-
-public class EnumMember implements EdmMember {
-
- private String name;
-
- private String value;
-
- // Annotations?
- @Override
- public String getName() {
- return name;
- }
-
- public EnumMember setName(final String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public String getValue() {
- return value;
- }
-
- public EnumMember setValue(final String value) {
- this.value = value;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EnumType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EnumType.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EnumType.java
deleted file mode 100644
index 6f83f35..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/EnumType.java
+++ /dev/null
@@ -1,73 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class EnumType {
-
- private String name;
-
- private boolean isFlags;
-
- // Underlying Type can only be primitve...
- private FullQualifiedName underlyingType;
-
- private List<EnumMember> members;
-
- // Facets
- // Annotations?
- public String getName() {
- return name;
- }
-
- public EnumType setName(final String name) {
- this.name = name;
- return this;
- }
-
- public boolean isFlags() {
- return isFlags;
- }
-
- public EnumType setFlags(final boolean isFlags) {
- this.isFlags = isFlags;
- return this;
- }
-
- public FullQualifiedName getUnderlyingType() {
- return underlyingType;
- }
-
- public EnumType setUnderlyingType(final FullQualifiedName underlyingType) {
- this.underlyingType = underlyingType;
- return this;
- }
-
- public List<EnumMember> getMembers() {
- return members;
- }
-
- public EnumType setMembers(final List<EnumMember> members) {
- this.members = members;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Expression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Expression.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Expression.java
deleted file mode 100644
index eaa1e34..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Expression.java
+++ /dev/null
@@ -1,24 +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.server.api.edm.provider;
-
-//TODO: Expression implementation
-public class Expression {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Function.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Function.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Function.java
deleted file mode 100644
index 6ada83f..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Function.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.server.api.edm.provider;
-
-import java.util.List;
-
-public class Function extends Operation {
-
- private boolean isComposable;
-
- public boolean isComposable() {
- return isComposable;
- }
-
- public Function setComposable(final boolean isComposable) {
- this.isComposable = isComposable;
- return this;
- }
-
- @Override
- public Function setName(final String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public Function setBound(final boolean isBound) {
- this.isBound = isBound;
- return this;
- }
-
- @Override
- public Function setEntitySetPath(final EntitySetPath entitySetPath) {
- this.entitySetPath = entitySetPath;
- return this;
- }
-
- @Override
- public Function setParameters(final List<Parameter> parameters) {
- this.parameters = parameters;
- return this;
- }
-
- @Override
- public Function setReturnType(final ReturnType returnType) {
- this.returnType = returnType;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/FunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/FunctionImport.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/FunctionImport.java
deleted file mode 100644
index 6b82bbe..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/FunctionImport.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.Target;
-
-public class FunctionImport extends OperationImport {
-
- private FullQualifiedName function;
-
- private boolean includeInServiceDocument;
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public FunctionImport setName(final String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public FunctionImport setEntitySet(final Target entitySet) {
- this.entitySet = entitySet;
- return this;
- }
-
- public FullQualifiedName getFunction() {
- return function;
- }
-
- public FunctionImport setFunction(final FullQualifiedName function) {
- this.function = function;
- return this;
- }
-
- public boolean isIncludeInServiceDocument() {
- return includeInServiceDocument;
- }
-
- public FunctionImport setIncludeInServiceDocument(final boolean includeInServiceDocument) {
- this.includeInServiceDocument = includeInServiceDocument;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Mapping.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Mapping.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Mapping.java
deleted file mode 100644
index a968fbd..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Mapping.java
+++ /dev/null
@@ -1,96 +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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmMapping;
-
-public class Mapping implements EdmMapping {
-
- private String value;
-
- private Object object;
-
- private String mediaResourceSourceKey;
-
- private String mediaResourceMimeTypeKey;
-
- @Override
- public String getInternalName() {
- return value;
- }
-
- @Override
- public Object getObject() {
- return object;
- }
-
- @Override
- public String getMediaResourceSourceKey() {
- return mediaResourceSourceKey;
- }
-
- @Override
- public String getMediaResourceMimeTypeKey() {
- return mediaResourceMimeTypeKey;
- }
-
- /**
- * Sets the value for this {@link Mapping}.
- *
- * @param value
- * @return {@link Mapping} for method chaining
- */
- public Mapping setInternalName(final String value) {
- this.value = value;
- return this;
- }
-
- /**
- * Sets an object. This method can be used by a provider to set whatever it wants to associate with this.
- *
- * @param object
- * @return {@link Mapping} for method chaining
- */
- public Mapping setObject(final Object object) {
- this.object = object;
- return this;
- }
-
- /**
- * Sets the key for the resource source key which is used for the lookup in the data map
- *
- * @param mediaResourceSourceKey under which the source can be found in the data map
- * @return {@link Mapping} for method chaining
- */
- public Mapping setMediaResourceSourceKey(final String mediaResourceSourceKey) {
- this.mediaResourceSourceKey = mediaResourceSourceKey;
- return this;
- }
-
- /**
- * Sets the key for the resource mime type key which is used for the lookup in the data map
- *
- * @param mediaResourceMimeTypeKey under which the mime type can be found in the data map
- * @return {@link Mapping} for method chaining
- */
- public Mapping setMediaResourceMimeTypeKey(final String mediaResourceMimeTypeKey) {
- this.mediaResourceMimeTypeKey = mediaResourceMimeTypeKey;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/NavigationProperty.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/NavigationProperty.java
deleted file mode 100644
index 773485f..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/NavigationProperty.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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.commons.api.edm.constants.EdmOnDelete;
-
-public class NavigationProperty {
-
- private String name;
-
- private FullQualifiedName type;
-
- private boolean isCollection;
-
- private String partner;
-
- private boolean containsTarget;
-
- private List<ReferentialConstraint> referentialConstraints;
-
- // Facets
- private Boolean nullable;
-
- // Refactor this onDelete
- private EdmOnDelete onDelete;
-
-//Annotations?
- public String getName() {
- return name;
- }
-
- public boolean isCollection() {
- return isCollection;
- }
-
- public NavigationProperty setCollection(final boolean isCollection) {
- this.isCollection = isCollection;
- return this;
- }
-
- public NavigationProperty setName(final String name) {
- this.name = name;
- return this;
- }
-
- public FullQualifiedName getType() {
- return type;
- }
-
- public NavigationProperty setType(final FullQualifiedName type) {
- this.type = type;
- return this;
- }
-
- public String getPartner() {
- return partner;
- }
-
- public NavigationProperty setPartner(final String partner) {
- this.partner = partner;
- return this;
- }
-
- public boolean isContainsTarget() {
- return containsTarget;
- }
-
- public NavigationProperty setContainsTarget(final boolean containsTarget) {
- this.containsTarget = containsTarget;
- return this;
- }
-
- public List<ReferentialConstraint> getReferentialConstraints() {
- return referentialConstraints;
- }
-
- public NavigationProperty setReferentialConstraints(final List<ReferentialConstraint> referentialConstraints) {
- this.referentialConstraints = referentialConstraints;
- return this;
- }
-
- public Boolean getNullable() {
- return nullable;
- }
-
- public NavigationProperty setNullable(final Boolean nullable) {
- this.nullable = nullable;
- return this;
- }
-
- public EdmOnDelete getOnDelete() {
- return onDelete;
- }
-
- public NavigationProperty setOnDelete(final EdmOnDelete onDelete) {
- this.onDelete = onDelete;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/NavigationPropertyBinding.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/NavigationPropertyBinding.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/NavigationPropertyBinding.java
deleted file mode 100644
index 0e82a3c..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/NavigationPropertyBinding.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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.Target;
-
-public class NavigationPropertyBinding {
-
- private String path;
-
- private Target target;
-
- public String getPath() {
- return path;
- }
-
- public NavigationPropertyBinding setPath(final String path) {
- this.path = path;
- return this;
- }
-
- public Target getTarget() {
- return target;
- }
-
- public NavigationPropertyBinding setTarget(final Target target) {
- this.target = target;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Operation.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Operation.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Operation.java
deleted file mode 100644
index d2a7dfe..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Operation.java
+++ /dev/null
@@ -1,81 +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.server.api.edm.provider;
-
-import java.util.List;
-
-public abstract class Operation {
-
- protected String name;
-
- protected boolean isBound;
-
- // Do we need EntitySetPath as a class?
- protected EntitySetPath entitySetPath;
-
- protected List<Parameter> parameters;
-
- protected ReturnType returnType;
-
- // Annotations?
- public String getName() {
- return name;
- }
-
- public Operation setName(final String name) {
- this.name = name;
- return this;
- }
-
- public boolean isBound() {
- return isBound;
- }
-
- public Operation setBound(final boolean isBound) {
- this.isBound = isBound;
- return this;
- }
-
- public EntitySetPath getEntitySetPath() {
- return entitySetPath;
- }
-
- public Operation setEntitySetPath(final EntitySetPath entitySetPath) {
- this.entitySetPath = entitySetPath;
- return this;
- }
-
- public List<Parameter> getParameters() {
- return parameters;
- }
-
- public Operation setParameters(final List<Parameter> parameters) {
- this.parameters = parameters;
- return this;
- }
-
- public ReturnType getReturnType() {
- return returnType;
- }
-
- public Operation setReturnType(final ReturnType returnType) {
- this.returnType = returnType;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/OperationImport.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/OperationImport.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/OperationImport.java
deleted file mode 100644
index bd845bd..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/OperationImport.java
+++ /dev/null
@@ -1,47 +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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.Target;
-
-public abstract class OperationImport {
-
- protected String name;
-
- protected Target entitySet;
-
- // Annotations?
- public String getName() {
- return name;
- }
-
- public OperationImport setName(final String name) {
- this.name = name;
- return this;
- }
-
- public Target getEntitySet() {
- return entitySet;
- }
-
- public OperationImport setEntitySet(final Target entitySet) {
- this.entitySet = entitySet;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Parameter.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Parameter.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Parameter.java
deleted file mode 100644
index 50dcee8..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Parameter.java
+++ /dev/null
@@ -1,113 +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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class Parameter {
-
- private String name;
-
- private FullQualifiedName type;
-
- private boolean isCollection;
-
- private Mapping mapping;
-
- // Facets?
- private Boolean nullable;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- public String getName() {
- return name;
- }
-
- public Parameter setName(final String name) {
- this.name = name;
- return this;
- }
-
- public FullQualifiedName getType() {
- return type;
- }
-
- public Parameter setType(final FullQualifiedName type) {
- this.type = type;
- return this;
- }
-
- public boolean isCollection() {
- return isCollection;
- }
-
- public Parameter setCollection(final boolean isCollection) {
- this.isCollection = isCollection;
- return this;
- }
-
- public Boolean getNullable() {
- return nullable;
- }
-
- public Parameter setNullable(final Boolean nullable) {
- this.nullable = nullable;
- return this;
- }
-
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public Parameter setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- return this;
- }
-
- public Integer getPrecision() {
- return precision;
- }
-
- public Parameter setPrecision(final Integer precision) {
- this.precision = precision;
- return this;
- }
-
- public Integer getScale() {
- return scale;
- }
-
- public Parameter setScale(final Integer scale) {
- this.scale = scale;
- return this;
- }
-
- public Mapping getMapping() {
- return mapping;
- }
-
- public Parameter setMapping(final Mapping mapping) {
- this.mapping = mapping;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Property.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Property.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Property.java
deleted file mode 100644
index 064779a..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Property.java
+++ /dev/null
@@ -1,148 +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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class Property {
-
- private String name;
-
- // Can be simple or complex
- private FullQualifiedName type;
-
- private boolean collection;
-
- // TODO: Mimetype and mapping what here
- private String mimeType;
-
- private Mapping mapping;
-
- // Facets
- private String defaultValue;
-
- private Boolean nullable;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- private Boolean unicode;
-
- public String getName() {
- return name;
- }
-
- public Property setName(final String name) {
- this.name = name;
- return this;
- }
-
- public FullQualifiedName getType() {
- return type;
- }
-
- public Property setType(final FullQualifiedName type) {
- this.type = type;
- return this;
- }
-
- public boolean isCollection() {
- return collection;
- }
-
- public Property setCollection(final boolean isCollection) {
- collection = isCollection;
- return this;
- }
-
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public Property setDefaultValue(final String defaultValue) {
- this.defaultValue = defaultValue;
- return this;
- }
-
- public Boolean getNullable() {
- return nullable;
- }
-
- public Property setNullable(final Boolean nullable) {
- this.nullable = nullable;
- return this;
- }
-
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public Property setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- return this;
- }
-
- public Integer getPrecision() {
- return precision;
- }
-
- public Property setPrecision(final Integer precision) {
- this.precision = precision;
- return this;
- }
-
- public Integer getScale() {
- return scale;
- }
-
- public Property setScale(final Integer scale) {
- this.scale = scale;
- return this;
- }
-
- public Boolean isUnicode() {
- return unicode;
- }
-
- public Property setUnicode(final Boolean isUnicode) {
- unicode = isUnicode;
- return this;
- }
-
- public String getMimeType() {
- return mimeType;
- }
-
- public Property setMimeType(final String mimeType) {
- this.mimeType = mimeType;
- return this;
- }
-
- public Mapping getMapping() {
- return mapping;
- }
-
- public Property setMapping(final Mapping mapping) {
- this.mapping = mapping;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/PropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/PropertyRef.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/PropertyRef.java
deleted file mode 100644
index f5ab3b0..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/PropertyRef.java
+++ /dev/null
@@ -1,55 +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.server.api.edm.provider;
-
-public class PropertyRef {
-
- private String propertyName;
-
- private String alias;
-
- private String path;
-
- public String getPath() {
- return path;
- }
-
- public PropertyRef setPath(final String path) {
- this.path = path;
- return this;
- }
-
- public String getPropertyName() {
- return propertyName;
- }
-
- public PropertyRef setPropertyName(final String name) {
- propertyName = name;
- return this;
- }
-
- public String getAlias() {
- return alias;
- }
-
- public PropertyRef setAlias(final String alias) {
- this.alias = alias;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ReferentialConstraint.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ReferentialConstraint.java
deleted file mode 100644
index ee0b3a3..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ReferentialConstraint.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.server.api.edm.provider;
-
-public class ReferentialConstraint {
-
- // TODO: check data type
- private String property;
-
- private String referencedProperty;
-
- // Annotations
- public String getProperty() {
- return property;
- }
-
- public ReferentialConstraint setProperty(final String property) {
- this.property = property;
- return this;
- }
-
- public String getReferencedProperty() {
- return referencedProperty;
- }
-
- public ReferentialConstraint setReferencedProperty(final String referencedProperty) {
- this.referencedProperty = referencedProperty;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ReturnType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ReturnType.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ReturnType.java
deleted file mode 100644
index 45d2690..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/ReturnType.java
+++ /dev/null
@@ -1,91 +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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class ReturnType {
-
- private FullQualifiedName type;
-
- private boolean isCollection;
-
- // facets
- private Boolean nullable;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- public FullQualifiedName getType() {
- return type;
- }
-
- public ReturnType setType(final FullQualifiedName type) {
- this.type = type;
- return this;
- }
-
- public boolean isCollection() {
- return isCollection;
- }
-
- public ReturnType setCollection(final boolean isCollection) {
- this.isCollection = isCollection;
- return this;
- }
-
- public Boolean getNullable() {
- return nullable;
- }
-
- public ReturnType setNullable(final Boolean nullable) {
- this.nullable = nullable;
- return this;
- }
-
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public ReturnType setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- return this;
- }
-
- public Integer getPrecision() {
- return precision;
- }
-
- public ReturnType setPrecision(final Integer precision) {
- this.precision = precision;
- return this;
- }
-
- public Integer getScale() {
- return scale;
- }
-
- public ReturnType setScale(final Integer scale) {
- this.scale = scale;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Schema.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Schema.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Schema.java
deleted file mode 100644
index 480a28e..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Schema.java
+++ /dev/null
@@ -1,135 +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.server.api.edm.provider;
-
-import java.util.List;
-
-public class Schema {
-
- private String namespace;
-
- private String alias;
-
- private List<EnumType> enumTypes;
-
- private List<TypeDefinition> typeDefinitions;
-
- private List<EntityType> entityTypes;
-
- private List<ComplexType> complexTypes;
-
- private List<Action> actions;
-
- private List<Function> functions;
-
- private EntityContainer entityContainer;
-
- private List<Term> terms;
-
- // Annotations
- public String getNamespace() {
- return namespace;
- }
-
- public Schema setNamespace(final String namespace) {
- this.namespace = namespace;
- return this;
- }
-
- public String getAlias() {
- return alias;
- }
-
- public Schema setAlias(final String alias) {
- this.alias = alias;
- return this;
- }
-
- public List<EnumType> getEnumTypes() {
- return enumTypes;
- }
-
- public Schema setEnumTypes(final List<EnumType> enumTypes) {
- this.enumTypes = enumTypes;
- return this;
- }
-
- public List<TypeDefinition> getTypeDefinitions() {
- return typeDefinitions;
- }
-
- public Schema setTypeDefinitions(final List<TypeDefinition> typeDefinitions) {
- this.typeDefinitions = typeDefinitions;
- return this;
- }
-
- public List<EntityType> getEntityTypes() {
- return entityTypes;
- }
-
- public Schema setEntityTypes(final List<EntityType> entityTypes) {
- this.entityTypes = entityTypes;
- return this;
- }
-
- public List<ComplexType> getComplexTypes() {
- return complexTypes;
- }
-
- public Schema setComplexTypes(final List<ComplexType> complexTypes) {
- this.complexTypes = complexTypes;
- return this;
- }
-
- public List<Action> getActions() {
- return actions;
- }
-
- public Schema setActions(final List<Action> actions) {
- this.actions = actions;
- return this;
- }
-
- public List<Function> getFunctions() {
- return functions;
- }
-
- public Schema setFunctions(final List<Function> functions) {
- this.functions = functions;
- return this;
- }
-
- public EntityContainer getEntityContainer() {
- return entityContainer;
- }
-
- public Schema setEntityContainer(final EntityContainer entityContainer) {
- this.entityContainer = entityContainer;
- return this;
- }
-
- public List<Term> getTerms() {
- return terms;
- }
-
- public Schema setTerms(final List<Term> terms) {
- this.terms = terms;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Singleton.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Singleton.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Singleton.java
deleted file mode 100644
index b8607db..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Singleton.java
+++ /dev/null
@@ -1,44 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class Singleton extends BindingTarget {
-
- @Override
- public Singleton setName(final String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public Singleton setType(final FullQualifiedName type) {
- this.type = type;
- return this;
- }
-
- @Override
- public Singleton setNavigationPropertyBindings(final List<NavigationPropertyBinding> navigationPropertyBindings) {
- this.navigationPropertyBindings = navigationPropertyBindings;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/StructuredType.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/StructuredType.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/StructuredType.java
deleted file mode 100644
index f91e55e..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/StructuredType.java
+++ /dev/null
@@ -1,93 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public abstract class StructuredType {
-
- protected String name;
-
- protected boolean isOpenType;
-
- protected FullQualifiedName baseType;
-
- protected boolean isAbstract;
-
- protected List<Property> properties;
-
- protected List<NavigationProperty> navigationProperties;
-
- // What about mapping and annotations?
- public String getName() {
- return name;
- }
-
- public StructuredType setName(final String name) {
- this.name = name;
- return this;
- }
-
- public boolean isOpenType() {
- return isOpenType;
- }
-
- public StructuredType setOpenType(final boolean isOpenType) {
- this.isOpenType = isOpenType;
- return this;
- }
-
- public FullQualifiedName getBaseType() {
- return baseType;
- }
-
- public StructuredType setBaseType(final FullQualifiedName baseType) {
- this.baseType = baseType;
- return this;
- }
-
- public boolean isAbstract() {
- return isAbstract;
- }
-
- public StructuredType setAbstract(final boolean isAbstract) {
- this.isAbstract = isAbstract;
- return this;
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
- public StructuredType setProperties(final List<Property> properties) {
- this.properties = properties;
- return this;
- }
-
- public List<NavigationProperty> getNavigationProperties() {
- return navigationProperties;
- }
-
- public StructuredType setNavigationProperties(final List<NavigationProperty> navigationProperties) {
- this.navigationProperties = navigationProperties;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Term.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Term.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Term.java
deleted file mode 100644
index b0ddbe6..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/Term.java
+++ /dev/null
@@ -1,150 +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.server.api.edm.provider;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class Term {
-
- private String name;
-
- private FullQualifiedName type;
-
- private FullQualifiedName baseTerm;
-
- // TODO: AppliesTo is a list of csdl elements => should we put this list inside an enum?
- private String appliesTo;
-
- private boolean isCollection;
-
- // Facets
- private String defaultValue;
-
- private Boolean nullable;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- // Annotation
- private List<Annotation> annotations;
-
- public String getName() {
- return name;
- }
-
- public Term setName(final String name) {
- this.name = name;
- return this;
- }
-
- public FullQualifiedName getType() {
- return type;
- }
-
- public Term setType(final FullQualifiedName type) {
- this.type = type;
- return this;
- }
-
- public FullQualifiedName getBaseTerm() {
- return baseTerm;
- }
-
- public Term setBaseTerm(final FullQualifiedName baseTerm) {
- this.baseTerm = baseTerm;
- return this;
- }
-
- public String getAppliesTo() {
- return appliesTo;
- }
-
- public Term setAppliesTo(final String appliesTo) {
- this.appliesTo = appliesTo;
- return this;
- }
-
- public boolean isCollection() {
- return isCollection;
- }
-
- public Term setCollection(final boolean isCollection) {
- this.isCollection = isCollection;
- return this;
- }
-
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public Term setDefaultValue(final String defaultValue) {
- this.defaultValue = defaultValue;
- return this;
- }
-
- public Boolean getNullable() {
- return nullable;
- }
-
- public Term setNullable(final Boolean nullable) {
- this.nullable = nullable;
- return this;
- }
-
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public Term setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- return this;
- }
-
- public Integer getPrecision() {
- return precision;
- }
-
- public Term setPrecision(final Integer precision) {
- this.precision = precision;
- return this;
- }
-
- public Integer getScale() {
- return scale;
- }
-
- public Term setScale(final Integer scale) {
- this.scale = scale;
- return this;
- }
-
- public List<Annotation> getAnnotations() {
- return annotations;
- }
-
- public Term setAnnotations(final List<Annotation> annotations) {
- this.annotations = annotations;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/TypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/TypeDefinition.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/TypeDefinition.java
deleted file mode 100644
index 55d0ebf..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/edm/provider/TypeDefinition.java
+++ /dev/null
@@ -1,94 +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.server.api.edm.provider;
-
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-
-public class TypeDefinition {
-
- private String name;
-
- // TODO: UnderlyingType can only be primitve...
- private FullQualifiedName underlyingType;
-
- // Facets
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- private Boolean isUnicode;
-
- // Annotations
- public String getName() {
- return name;
- }
-
- public TypeDefinition setName(final String name) {
- this.name = name;
- return this;
- }
-
- public FullQualifiedName getUnderlyingType() {
- return underlyingType;
- }
-
- public TypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) {
- this.underlyingType = underlyingType;
- return this;
- }
-
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public TypeDefinition setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- return this;
- }
-
- public Integer getPrecision() {
- return precision;
- }
-
- public TypeDefinition setPrecision(final Integer precision) {
- this.precision = precision;
- return this;
- }
-
- public Integer getScale() {
- return scale;
- }
-
- public TypeDefinition setScale(final Integer scale) {
- this.scale = scale;
- return this;
- }
-
- public Boolean getIsUnicode() {
- return isUnicode;
- }
-
- public TypeDefinition setIsUnicode(final Boolean isUnicode) {
- this.isUnicode = isUnicode;
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfo.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfo.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfo.java
deleted file mode 100644
index 9bca76a..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfo.java
+++ /dev/null
@@ -1,48 +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.server.api.uri;
-
-
-/**
- * Object acting as general access to URI information extracted from the request URI. Depending on
- * the URI info kind different interfaces are used to provide access to that information. </p>
- * Use method {@link #getKind()} to obtain URI info kind information and to perform an appropriate cast.
- */
-public interface UriInfo extends
- UriInfoService, UriInfoAll, UriInfoBatch, UriInfoCrossjoin,
- UriInfoEntityId, UriInfoMetadata, UriInfoResource {
-
- public UriInfoKind getKind();
-
- public UriInfoService asUriInfoService();
-
- public UriInfoAll asUriInfoAll();
-
- public UriInfoBatch asUriInfoBatch();
-
- public UriInfoCrossjoin asUriInfoCrossjoin();
-
- public UriInfoEntityId asUriInfoEntityId();
-
- public UriInfoMetadata asUriInfoMetadata();
-
- public UriInfoResource asUriInfoResource();
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoAll.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoAll.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoAll.java
deleted file mode 100644
index 5a1e0c7..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoAll.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.server.api.uri;
-
-
-/**
- * Used for URI info kind {@link UriInfoKind#all} to describe URIs like
- * http://.../serviceroot/$all
- */
-public interface UriInfoAll {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoBatch.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoBatch.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoBatch.java
deleted file mode 100644
index 4e3142e..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoBatch.java
+++ /dev/null
@@ -1,27 +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.server.api.uri;
-
-/**
- * Used for URI info kind {@link UriInfoKind#batch} to describe URIs like
- * http://.../serviceroot/$batch
- */
-public interface UriInfoBatch {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoCrossjoin.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoCrossjoin.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoCrossjoin.java
deleted file mode 100644
index d74cf12..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoCrossjoin.java
+++ /dev/null
@@ -1,34 +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.server.api.uri;
-
-import java.util.List;
-
-/**
- * Used for URI info kind {@link UriInfoKind#crossjoin} to describe URIs like
- * http://.../serviceroot/$crossjoin(...)
- */
-public interface UriInfoCrossjoin {
-
- /**
- * @return List of entity set names
- */
- List<String> getEntitySetNames();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoEntityId.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoEntityId.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoEntityId.java
deleted file mode 100644
index b28f373..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoEntityId.java
+++ /dev/null
@@ -1,68 +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.server.api.uri;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.server.api.uri.queryoption.CustomQueryOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.ExpandOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.FormatOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.IdOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.SelectOption;
-
-/**
- * Used for URI info kind {@link UriInfoKind#entityId} to describe URIs like
- * http://.../serviceroot/$entity...
- */
-public interface UriInfoEntityId {
-
- /**
- * @return List of custom query options used in the URI
- */
- public List<CustomQueryOption> getCustomQueryOptions();
-
- /**
- * Behind $entity a optional type cast can be used in the URI.
- * For example: http://.../serviceroot/$entity/namespace.entitytype
- * @return Type cast if found, otherwise null
- */
- public EdmEntityType getEntityTypeCast();
-
- /**
- * @return Object containing information of the $expand option
- */
- public ExpandOption getExpandOption();
-
- /**
- * @return Object containing information of the $format option
- */
- public FormatOption getFormatOption();
-
- /**
- * @return Object containing information of the $id option
- */
- public IdOption getIdOption();
-
- /**
- * @return Object containing information of the $select option
- */
- public SelectOption getSelectOption();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoKind.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoKind.java
deleted file mode 100644
index 7065edf..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoKind.java
+++ /dev/null
@@ -1,67 +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.server.api.uri;
-
-/**
- * Defining the various info kinds
- */
-public enum UriInfoKind {
-
- /**
- * Class: {@link UriInfoAll}<br>
- * URI: http://.../serviceroot/$all
- */
- all,
-
- /**
- * Class: {@link UriInfoBatch}<br>
- * URI: http://.../serviceroot/$batch
- */
- batch,
-
- /**
- * Class: {@link UriInfoCrossjoin}<br>
- * URI: http://.../serviceroot/$crossjoin
- */
- crossjoin,
-
- /**
- * Class: {@link UriInfoEntityId}<br>
- * URI: http://.../serviceroot/$entity(...)
- */
- entityId,
-
- /**
- * Class: {@link UriInfoMetadata}<br>
- * URI: http://.../serviceroot/$metadata...
- */
- metadata,
-
- /**
- * Class: {@link UriInfoResource}<br>
- * URI: http://.../serviceroot/entitySet
- */
- resource,
-
- /**
- * Class: {@link UriInfoService}<br>
- * URI: http://.../serviceroot
- */
- service;
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoMetadata.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoMetadata.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoMetadata.java
deleted file mode 100644
index d23d93e..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoMetadata.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.server.api.uri;
-
-import org.apache.olingo.odata4.server.api.uri.queryoption.FormatOption;
-
-/**
- * Used for URI info kind {@link UriInfoKind#metadata} to describe URIs like
- * http://.../serviceroot/$metadata...
- */
-public interface UriInfoMetadata {
-
- /**
- * @return Object containing information of the $id option
- */
- public FormatOption getFormatOption();
-
- /**
- * @return Object containing information of the URI fragment
- */
- public String getFragment();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoResource.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoResource.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoResource.java
deleted file mode 100644
index c7f90c2..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoResource.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.server.api.uri;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.server.api.uri.queryoption.CustomQueryOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.ExpandOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.FilterOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.FormatOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.IdOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.CountOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.OrderByOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.SearchOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.SelectOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.SkipOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.SkipTokenOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.TopOption;
-
-/**
- * Used for URI info kind {@link UriInfoKind#resource} to describe URIs like
- * E.g. http://.../serviceroot/entitySet
- */
-public interface UriInfoResource {
-
- /**
- * @return List of custom query options used in the URI
- */
- List<CustomQueryOption> getCustomQueryOptions();
-
- /**
- * @return Object containing information of the $expand option
- */
- ExpandOption getExpandOption();
-
- /**
- * @return Object containing information of the $filter option
- */
- FilterOption getFilterOption();
-
- /**
- * @return Object containing information of the $format option
- */
- FormatOption getFormatOption();
-
- /**
- * @return Object containing information of the $id option
- */
- IdOption getIdOption();
-
- /**
- * @return Object containing information of the $count option
- */
- CountOption getCountOption();
-
- /**
- * @return Object containing information of the $orderby option
- */
- OrderByOption getOrderByOption();
-
- /**
- * @return Object containing information of the $search option
- */
- SearchOption getSearchOption();
-
- /**
- * @return Object containing information of the $select option
- */
- SelectOption getSelectOption();
-
- /**
- * @return Object containing information of the $skip option
- */
- SkipOption getSkipOption();
-
- /**
- * @return Object containing information of the $skiptoken option
- */
- SkipTokenOption getSkipTokenOption();
-
- /**
- * @return Object containing information of the $top option
- */
- TopOption getTopOption();
-
- /**
- * The path segments behind the service root define which resources are
- * requested by that URI. This may be entities/functions/actions and more.
- * Each segments information (name, key predicates, function parameters, ...) is
- * stored within an resource object dedicated for that segment type.</p>
- * For example: the URI http://.../serviceroot/entitySet(1)/Adresse will
- * have 2 ResourceParts:<br>
- * - The first one of type {@link UriResourceEntitySet}
- * containing the name of the entity set and also the key predicate information.<br>
- * - The second one of type {@link UriResourceComplexProperty} containing the name of
- * the accessed complex property
- *
- * @return List of resource parts.
- */
- List<UriResource> getUriResourceParts();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoService.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoService.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoService.java
deleted file mode 100644
index a6c9eb9..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoService.java
+++ /dev/null
@@ -1,27 +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.server.api.uri;
-
-/**
- * Used for URI info kind {@link UriInfoKind#service} to describe URIs like
- * http://.../serviceroot
- */
-public interface UriInfoService {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriParameter.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriParameter.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriParameter.java
deleted file mode 100644
index 19584c9..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriParameter.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.server.api.uri;
-
-import org.apache.olingo.odata4.server.api.uri.queryoption.expression.Expression;
-
-/**
- * Represents an function parameter or key predicate when used in the URI.
- */
-public interface UriParameter {
-
- /**
- * @return Alias name if the parameters values is an alias, otherwise null
- */
- public String getAlias();
-
- /**
- * @return Text of the parameters value
- */
- public String getText();
-
- /**
- * @return If the parameters value is a expression and expression is returned, otherwise null
- */
- public Expression getExression();
-
- /**
- * @return Name of the parameter
- */
- public String getName();
-
- /**
- * @return Name of the referenced property when referential constrains are used
- */
- public String getRefencedProperty();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResource.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResource.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResource.java
deleted file mode 100644
index a83c5da..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResource.java
+++ /dev/null
@@ -1,35 +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.server.api.uri;
-
-/**
- * Super interface for all objects representing resource parts.
- * See {@link UriInfoResource} for details.
- */
-public interface UriResource {
-
- /**
- * @return Kind of the resource part
- */
- UriResourceKind getKind();
-
- @Override
- String toString();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceAction.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceAction.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceAction.java
deleted file mode 100644
index 83c83e5..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceAction.java
+++ /dev/null
@@ -1,42 +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.server.api.uri;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmAction;
-import org.apache.olingo.odata4.commons.api.edm.EdmActionImport;
-
-/**
- * Used to describe an action used within an resource path
- * For example: http://.../serviceroot/action()
- */
-public interface UriResourceAction extends UriResourcePartTyped {
-
- /**
- * @return Action used in the resource path
- */
- EdmAction getAction();
-
- /**
- * Convenience method which returns the {@link EdmActionImport} which was used in
- * the resource path to define the {@link EdmAction}.
- * @return
- */
- EdmActionImport getActionImport();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceComplexProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceComplexProperty.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceComplexProperty.java
deleted file mode 100644
index e0b0425..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceComplexProperty.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.server.api.uri;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
-
-/**
- * Used to describe an complex property used within an resource path
- * E.g. http://.../serviceroot/entityset(1)/complexproperty
- */
-public interface UriResourceComplexProperty extends UriResourceProperty {
-
- /**
- * @return Complex property used in the resource path
- */
- EdmComplexType getComplexType();
-
- /**
- * Behind a complex property may be a type filter
- * E.g. http://.../serviceroot/entityset(1)/complexproperty/namespace.complextype
- * @return Type filter if found, otherwise null
- */
- EdmComplexType getComplexTypeFilter();
-
-}
[36/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
new file mode 100644
index 0000000..831a8a3
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
@@ -0,0 +1,147 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.core.JsonLocation;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.ClassUtils;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class DynExprConstructDeserializer extends AbstractEdmDeserializer<DynExprConstructImpl> {
+
+ private static final String[] EL_OR_ATTR = { AnnotationPath.class.getSimpleName(), Path.class.getSimpleName() };
+
+ private static final String APPLY = Apply.class.getSimpleName();
+
+ private static final String CAST = Cast.class.getSimpleName();
+
+ private static final String COLLECTION = Collection.class.getSimpleName();
+
+ private static final String IF = If.class.getSimpleName();
+
+ private static final String IS_OF = IsOf.class.getSimpleName();
+
+ private static final String LABELED_ELEMENT = LabeledElement.class.getSimpleName();
+
+ private static final String NULL = Null.class.getSimpleName();
+
+ private static final String RECORD = Record.class.getSimpleName();
+
+ private static final String URL_REF = UrlRef.class.getSimpleName();
+
+ private AbstractElOrAttrConstruct getElOrAttrInstance(final String simpleClassName) throws JsonParseException {
+ try {
+ @SuppressWarnings("unchecked")
+ Class<? extends AbstractElOrAttrConstruct> elOrAttrClass =
+ (Class<? extends AbstractElOrAttrConstruct>) ClassUtils.getClass(
+ getClass().getPackage().getName() + "." + simpleClassName);
+ return elOrAttrClass.newInstance();
+ } catch (Exception e) {
+ throw new JsonParseException("Could not instantiate " + simpleClassName, JsonLocation.NA, e);
+ }
+ }
+
+ private ExprConstructImpl parseConstOrEnumExprConstruct(final JsonParser jp) throws IOException {
+ ExprConstructImpl result;
+ if (isAnnotationConstExprConstruct(jp)) {
+ result = parseAnnotationConstExprConstruct(jp);
+ } else {
+ result = jp.readValueAs( DynExprConstructImpl.class);
+ }
+ jp.nextToken();
+
+ return result;
+ }
+
+ @Override
+ protected DynExprConstructImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ DynExprConstructImpl construct = null;
+
+ if (DynExprSingleParamOp.Type.fromString(jp.getCurrentName()) != null) {
+ final DynExprSingleParamOp dynExprSingleParamOp = new DynExprSingleParamOp();
+ dynExprSingleParamOp.setType(DynExprSingleParamOp.Type.fromString(jp.getCurrentName()));
+
+ jp.nextToken();
+ jp.nextToken();
+ dynExprSingleParamOp.setExpression(jp.readValueAs( DynExprConstructImpl.class));
+
+ construct = dynExprSingleParamOp;
+ } else if (DynExprDoubleParamOp.Type.fromString(jp.getCurrentName()) != null) {
+ final DynExprDoubleParamOp dynExprDoubleParamOp = new DynExprDoubleParamOp();
+ dynExprDoubleParamOp.setType(DynExprDoubleParamOp.Type.fromString(jp.getCurrentName()));
+
+ jp.nextToken();
+ jp.nextToken();
+ dynExprDoubleParamOp.setLeft(jp.readValueAs( DynExprConstructImpl.class));
+ dynExprDoubleParamOp.setRight(jp.readValueAs( DynExprConstructImpl.class));
+
+ construct = dynExprDoubleParamOp;
+ } else if (ArrayUtils.contains(EL_OR_ATTR, jp.getCurrentName())) {
+ final AbstractElOrAttrConstruct elOrAttr = getElOrAttrInstance(jp.getCurrentName());
+ elOrAttr.setValue(jp.nextTextValue());
+
+ construct = elOrAttr;
+ } else if (APPLY.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( Apply.class);
+ } else if (CAST.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( Cast.class);
+ } else if (COLLECTION.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( Collection.class);
+ } else if (IF.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ jp.nextToken();
+
+ final If _if = new If();
+ _if.setGuard(parseConstOrEnumExprConstruct(jp));
+ _if.setThen(parseConstOrEnumExprConstruct(jp));
+ _if.setElse(parseConstOrEnumExprConstruct(jp));
+
+ construct = _if;
+ } else if (IS_OF.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( IsOf.class);
+ } else if (LABELED_ELEMENT.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( LabeledElement.class);
+ } else if (NULL.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( Null.class);
+ } else if (RECORD.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( Record.class);
+ } else if (URL_REF.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( UrlRef.class);
+ }
+
+ return construct;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java
new file mode 100644
index 0000000..8d73943
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java
@@ -0,0 +1,30 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+@JsonDeserialize(using = DynExprConstructDeserializer.class)
+public abstract class DynExprConstructImpl extends ExprConstructImpl implements DynExprConstruct {
+
+ private static final long serialVersionUID = -642012862023177349L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java
new file mode 100644
index 0000000..85ec044
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java
@@ -0,0 +1,73 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+public class DynExprDoubleParamOp extends DynExprConstructImpl {
+
+ private static final long serialVersionUID = -7974475975925167731L;
+
+ public static enum Type {
+
+ And,
+ Or;
+
+ public static Type fromString(final String value) {
+ Type result = null;
+ for (Type type : values()) {
+ if (value.equals(type.name())) {
+ result = type;
+ }
+ }
+ return result;
+ }
+ }
+
+ private Type type;
+
+ private DynExprConstruct left;
+
+ private DynExprConstruct right;
+
+ public Type getType() {
+ return type;
+ }
+
+ public void setType(final Type type) {
+ this.type = type;
+ }
+
+ public DynExprConstruct getLeft() {
+ return left;
+ }
+
+ public void setLeft(final DynExprConstruct left) {
+ this.left = left;
+ }
+
+ public DynExprConstruct getRight() {
+ return right;
+ }
+
+ public void setRight(final DynExprConstruct right) {
+ this.right = right;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java
new file mode 100644
index 0000000..06797e9
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java
@@ -0,0 +1,69 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+public class DynExprSingleParamOp extends DynExprConstructImpl {
+
+ private static final long serialVersionUID = -7974475975925167731L;
+
+ public static enum Type {
+
+ Not,
+ Eq,
+ Ne,
+ Gt,
+ Ge,
+ Lt,
+ Le;
+
+ public static Type fromString(final String value) {
+ Type result = null;
+ for (Type type : values()) {
+ if (value.equals(type.name())) {
+ result = type;
+ }
+ }
+ return result;
+ }
+
+ }
+
+ private Type type;
+
+ private DynExprConstruct expression;
+
+ public Type getType() {
+ return type;
+ }
+
+ public void setType(final Type type) {
+ this.type = type;
+ }
+
+ public DynExprConstruct getExpression() {
+ return expression;
+ }
+
+ public void setExpression(final DynExprConstruct expression) {
+ this.expression = 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/edm/xml/v4/annotation/ExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ExprConstructImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ExprConstructImpl.java
new file mode 100644
index 0000000..c0bd626
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ExprConstructImpl.java
@@ -0,0 +1,28 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.ExprConstruct;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public abstract class ExprConstructImpl extends AbstractEdmItem implements ExprConstruct {
+
+ private static final long serialVersionUID = 7108626008005050492L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/If.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/If.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/If.java
new file mode 100644
index 0000000..8477bd4
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/If.java
@@ -0,0 +1,57 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.ExprConstruct;
+
+public class If extends AnnotatedDynExprConstruct {
+
+ private static final long serialVersionUID = 6752952406406218936L;
+
+ private ExprConstruct guard;
+
+ private ExprConstruct _then;
+
+ private ExprConstruct _else;
+
+ public ExprConstruct getGuard() {
+ return guard;
+ }
+
+ public void setGuard(final ExprConstruct guard) {
+ this.guard = guard;
+ }
+
+ public ExprConstruct getThen() {
+ return _then;
+ }
+
+ public void setThen(final ExprConstruct _then) {
+ this._then = _then;
+ }
+
+ public ExprConstruct getElse() {
+ return _else;
+ }
+
+ public void setElse(final ExprConstruct _else) {
+ this._else = _else;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOf.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOf.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOf.java
new file mode 100644
index 0000000..6854fd2
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOf.java
@@ -0,0 +1,92 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.math.BigInteger;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+@JsonDeserialize(using = IsOfDeserializer.class)
+public class IsOf extends AnnotatedDynExprConstruct {
+
+ private static final long serialVersionUID = 6958304670385303776L;
+
+ private String type;
+
+ private String maxLength;
+
+ private BigInteger precision;
+
+ private BigInteger scale;
+
+ private String srid;
+
+ private DynExprConstruct value;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public String getMaxLength() {
+ return maxLength;
+ }
+
+ public void setMaxLength(final String maxLength) {
+ this.maxLength = maxLength;
+ }
+
+ public BigInteger getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(final BigInteger precision) {
+ this.precision = precision;
+ }
+
+ public BigInteger getScale() {
+ return scale;
+ }
+
+ public void setScale(final BigInteger scale) {
+ this.scale = scale;
+ }
+
+ public String getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final String srid) {
+ this.srid = srid;
+ }
+
+ public DynExprConstruct getValue() {
+ return value;
+ }
+
+ public void setValue(final DynExprConstruct value) {
+ this.value = value;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
new file mode 100644
index 0000000..51bafd6
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
@@ -0,0 +1,64 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+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 java.io.IOException;
+import java.math.BigInteger;
+
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class IsOfDeserializer extends AbstractEdmDeserializer<IsOf> {
+
+ @Override
+ protected IsOf doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final IsOf isof = new IsOf();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Type".equals(jp.getCurrentName())) {
+ isof.setType(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ isof.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ isof.setMaxLength(jp.nextTextValue());
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ isof.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L)));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ isof.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ isof.setSrid(jp.nextTextValue());
+ } else {
+ isof.setValue(jp.readValueAs(DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return isof;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElement.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElement.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElement.java
new file mode 100644
index 0000000..ccfdc37
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElement.java
@@ -0,0 +1,50 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+@JsonDeserialize(using = LabeledElementDeserializer.class)
+public class LabeledElement extends AnnotatedDynExprConstruct {
+
+ private static final long serialVersionUID = 6938971787086282939L;
+
+ private String name;
+
+ private DynExprConstruct value;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public DynExprConstruct getValue() {
+ return value;
+ }
+
+ public void setValue(final DynExprConstruct value) {
+ this.value = value;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
new file mode 100644
index 0000000..da99713
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
@@ -0,0 +1,55 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class LabeledElementDeserializer extends AbstractEdmDeserializer<LabeledElement> {
+
+ @Override
+ protected LabeledElement doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final LabeledElement element = new LabeledElement();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ element.setName(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ element.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ } else {
+ element.setValue(jp.readValueAs(DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return element;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementReference.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementReference.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementReference.java
new file mode 100644
index 0000000..d33c955
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementReference.java
@@ -0,0 +1,25 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+public class LabeledElementReference extends AbstractElOrAttrConstruct {
+
+ private static final long serialVersionUID = 3649068436729494270L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NavigationPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NavigationPropertyPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NavigationPropertyPath.java
new file mode 100644
index 0000000..f6b21d1
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NavigationPropertyPath.java
@@ -0,0 +1,25 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+public class NavigationPropertyPath extends AbstractElOrAttrConstruct {
+
+ private static final long serialVersionUID = -8066400142504963043L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Null.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Null.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Null.java
new file mode 100644
index 0000000..0ff8a1e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Null.java
@@ -0,0 +1,28 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = NullDeserializer.class)
+public class Null extends AnnotatedDynExprConstruct {
+
+ private static final long serialVersionUID = -3611384710172781951L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java
new file mode 100644
index 0000000..192be27
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java
@@ -0,0 +1,51 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class NullDeserializer extends AbstractEdmDeserializer<Null> {
+
+ @Override
+ protected Null doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final Null _null = new Null();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Annotation".equals(jp.getCurrentName())) {
+ _null.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return _null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Path.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Path.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Path.java
new file mode 100644
index 0000000..b9c4136
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Path.java
@@ -0,0 +1,25 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+public class Path extends AbstractElOrAttrConstruct {
+
+ private static final long serialVersionUID = -2551058493469292082L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyPath.java
new file mode 100644
index 0000000..ca47253
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyPath.java
@@ -0,0 +1,25 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+public class PropertyPath extends AbstractElOrAttrConstruct {
+
+ private static final long serialVersionUID = 2328584735437885159L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValue.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValue.java
new file mode 100644
index 0000000..5493c33
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValue.java
@@ -0,0 +1,50 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.ExprConstruct;
+
+@JsonDeserialize(using = PropertyValueDeserializer.class)
+public class PropertyValue extends AnnotatedDynExprConstruct {
+
+ private static final long serialVersionUID = 3081968466425707461L;
+
+ private String property;
+
+ private ExprConstruct value;
+
+ public String getProperty() {
+ return property;
+ }
+
+ public void setProperty(final String property) {
+ this.property = property;
+ }
+
+ public ExprConstruct getValue() {
+ return value;
+ }
+
+ public void setValue(final ExprConstruct value) {
+ this.value = value;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java
new file mode 100644
index 0000000..7a52412
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java
@@ -0,0 +1,57 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class PropertyValueDeserializer extends AbstractEdmDeserializer<PropertyValue> {
+
+ @Override
+ protected PropertyValue doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final PropertyValue propValue = new PropertyValue();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Property".equals(jp.getCurrentName())) {
+ propValue.setProperty(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ propValue.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ } else if (isAnnotationConstExprConstruct(jp)) {
+ propValue.setValue(parseAnnotationConstExprConstruct(jp));
+ } else {
+ propValue.setValue(jp.readValueAs(DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return propValue;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Record.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Record.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Record.java
new file mode 100644
index 0000000..862a677
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/Record.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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonDeserialize(using = RecordDeserializer.class)
+public class Record extends AnnotatedDynExprConstruct {
+
+ private static final long serialVersionUID = -2886526224721870304L;
+
+ private String type;
+
+ private final List<PropertyValue> propertyValues = new ArrayList<PropertyValue>();
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public List<PropertyValue> getPropertyValues() {
+ return propertyValues;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/RecordDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/RecordDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/RecordDeserializer.java
new file mode 100644
index 0000000..efe49cc
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/RecordDeserializer.java
@@ -0,0 +1,55 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class RecordDeserializer extends AbstractEdmDeserializer<Record> {
+
+ @Override
+ protected Record doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final Record record = new Record();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Tyoe".equals(jp.getCurrentName())) {
+ record.setType(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ record.setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ } else {
+ record.getPropertyValues().add(jp.readValueAs(PropertyValue.class));
+ }
+ }
+ }
+
+ return record;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRef.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRef.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRef.java
new file mode 100644
index 0000000..ebaea99
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRef.java
@@ -0,0 +1,40 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import org.apache.olingo.client.api.edm.xml.v4.annotation.ExprConstruct;
+
+@JsonDeserialize(using = UrlRefDeserializer.class)
+public class UrlRef extends DynExprConstructImpl {
+
+ private static final long serialVersionUID = 3755101394647430897L;
+
+ private ExprConstruct value;
+
+ public ExprConstruct getValue() {
+ return value;
+ }
+
+ public void setValue(final ExprConstruct value) {
+ this.value = value;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java
new file mode 100644
index 0000000..f4fab83
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java
@@ -0,0 +1,52 @@
+/*
+ * 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.edm.xml.v4.annotation;
+
+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 java.io.IOException;
+
+import org.apache.olingo.client.core.op.impl.AbstractEdmDeserializer;
+
+public class UrlRefDeserializer extends AbstractEdmDeserializer<UrlRef> {
+
+ @Override
+ protected UrlRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final UrlRef urlref = new UrlRef();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if (isAnnotationConstExprConstruct(jp)) {
+ urlref.setValue(parseAnnotationConstExprConstruct(jp));
+ } else {
+ urlref.setValue(jp.readValueAs( DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return urlref;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/http/AbstractBasicAuthHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/http/AbstractBasicAuthHttpClientFactory.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/AbstractBasicAuthHttpClientFactory.java
new file mode 100644
index 0000000..806bfb5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/AbstractBasicAuthHttpClientFactory.java
@@ -0,0 +1,51 @@
+/*
+ * 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.http;
+
+import java.net.URI;
+
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.olingo.client.api.http.HttpMethod;
+
+/**
+ * Base implementation for working with Basic Authentication: needs to be subclassed in order to provide actual username
+ * and password.
+ */
+public abstract class AbstractBasicAuthHttpClientFactory extends DefaultHttpClientFactory {
+
+ private static final long serialVersionUID = 7985626503125490244L;
+
+ protected abstract String getUsername();
+
+ protected abstract String getPassword();
+
+ @Override
+ public HttpClient createHttpClient(final HttpMethod method, final URI uri) {
+ final DefaultHttpClient httpclient = (DefaultHttpClient) super.createHttpClient(method, uri);
+
+ httpclient.getCredentialsProvider().setCredentials(
+ new AuthScope(uri.getHost(), uri.getPort()),
+ new UsernamePasswordCredentials(getUsername(), getPassword()));
+
+ return httpclient;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/http/AbstractNTLMAuthHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/http/AbstractNTLMAuthHttpClientFactory.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/AbstractNTLMAuthHttpClientFactory.java
new file mode 100644
index 0000000..e7c0ca0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/AbstractNTLMAuthHttpClientFactory.java
@@ -0,0 +1,63 @@
+/*
+ * 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.http;
+
+import java.net.URI;
+
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.NTCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.olingo.client.api.http.HttpMethod;
+
+/**
+ * Base implementation for working with NTLM Authentication via embedded HttpClient features: needs to be subclassed in
+ * order to provide all needed login information.
+ * <br/>
+ * External NTLM engine such as <a href="http://jcifs.samba.org/">JCIFS</a> library developed by the
+ * <a href="http://www.samba.org/">Samba</a> project as a part of their Windows interoperability suite of programs.
+ *
+ * @see NTCredentials
+ * @see http://hc.apache.org/httpcomponents-client-ga/ntlm.html#Using_Samba_JCIFS_as_an_alternative_NTLM_engine
+ */
+public abstract class AbstractNTLMAuthHttpClientFactory extends DefaultHttpClientFactory {
+
+ protected abstract String getUsername();
+
+ protected abstract String getPassword();
+
+ protected abstract String getWorkstation();
+
+ protected abstract String getDomain();
+
+ @Override
+ public HttpClient createHttpClient(final HttpMethod method, final URI uri) {
+ final DefaultHttpClient httpclient = (DefaultHttpClient) super.createHttpClient(method, uri);
+
+ final CredentialsProvider credsProvider = new BasicCredentialsProvider();
+ credsProvider.setCredentials(AuthScope.ANY,
+ new NTCredentials(getUsername(), getPassword(), getWorkstation(), getDomain()));
+
+ httpclient.setCredentialsProvider(credsProvider);
+
+ return httpclient;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/http/DefaultHttpClientFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/http/DefaultHttpClientFactory.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/DefaultHttpClientFactory.java
new file mode 100644
index 0000000..30336bb
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/DefaultHttpClientFactory.java
@@ -0,0 +1,40 @@
+/*
+ * 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.http;
+
+import java.io.Serializable;
+import java.net.URI;
+
+import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.olingo.client.api.http.HttpClientFactory;
+import org.apache.olingo.client.api.http.HttpMethod;
+
+/**
+ * Default implementation returning HttpClients with default parameters.
+ */
+public class DefaultHttpClientFactory implements HttpClientFactory, Serializable {
+
+ private static final long serialVersionUID = -2461355444507227332L;
+
+ @Override
+ public HttpClient createHttpClient(final HttpMethod method, final URI uri) {
+ return new DefaultHttpClient();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/http/DefaultHttpUriRequestFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/http/DefaultHttpUriRequestFactory.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/DefaultHttpUriRequestFactory.java
new file mode 100644
index 0000000..aaa17c0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/DefaultHttpUriRequestFactory.java
@@ -0,0 +1,69 @@
+/*
+ * 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.http;
+
+import java.net.URI;
+
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.olingo.client.api.http.HttpMethod;
+import org.apache.olingo.client.api.http.HttpUriRequestFactory;
+
+/**
+ * Default implementation returning default HttpUriRequest implementations.
+ */
+public class DefaultHttpUriRequestFactory implements HttpUriRequestFactory {
+
+ @Override
+ public HttpUriRequest createHttpUriRequest(final HttpMethod method, final URI uri) {
+ HttpUriRequest result;
+
+ switch (method) {
+ case POST:
+ result = new HttpPost(uri);
+ break;
+
+ case PUT:
+ result = new HttpPut(uri);
+ break;
+
+ case PATCH:
+ result = new HttpPatch(uri);
+ break;
+
+ case MERGE:
+ result = new HttpMerge(uri);
+ break;
+
+ case DELETE:
+ result = new HttpDelete(uri);
+ break;
+
+ case GET:
+ default:
+ result = new HttpGet(uri);
+ break;
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/http/HttpMerge.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/http/HttpMerge.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/HttpMerge.java
new file mode 100644
index 0000000..3dead87
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/HttpMerge.java
@@ -0,0 +1,70 @@
+/*
+ * 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.http;
+
+import java.net.URI;
+import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
+
+/**
+ * Class identifying MERGE HTTP method.
+ */
+@NotThreadSafe
+public class HttpMerge extends HttpEntityEnclosingRequestBase {
+
+ public final static String METHOD_NAME = "MERGE";
+
+ /**
+ * Constructor.
+ */
+ public HttpMerge() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param uri request URI.
+ */
+ public HttpMerge(final URI uri) {
+ super();
+ setURI(uri);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param uri request URI.
+ * @throws IllegalArgumentException if the uri is invalid.
+ */
+ public HttpMerge(final String uri) {
+ super();
+ setURI(URI.create(uri));
+ }
+
+ /**
+ * Gets HTTP method name.
+ *
+ * @return HTTP method name.
+ */
+ @Override
+ public String getMethod() {
+ return METHOD_NAME;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/http/HttpPatch.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/http/HttpPatch.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/HttpPatch.java
new file mode 100644
index 0000000..9e85cc7
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/http/HttpPatch.java
@@ -0,0 +1,70 @@
+/*
+ * 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.http;
+
+import java.net.URI;
+import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
+
+/**
+ * Class identifying PATCH HTTP method.
+ */
+@NotThreadSafe
+public class HttpPatch extends HttpEntityEnclosingRequestBase {
+
+ public final static String METHOD_NAME = "PATCH";
+
+ /**
+ * Constructor.
+ */
+ public HttpPatch() {
+ super();
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param uri request URI.
+ */
+ public HttpPatch(final URI uri) {
+ super();
+ setURI(uri);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param uri request URI.
+ * @throws IllegalArgumentException if the uri is invalid.
+ */
+ public HttpPatch(final String uri) {
+ super();
+ setURI(URI.create(uri));
+ }
+
+ /**
+ * Gets HTTP method name.
+ *
+ * @return HTTP method name.
+ */
+ @Override
+ public String getMethod() {
+ return METHOD_NAME;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractEdmDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractEdmDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractEdmDeserializer.java
new file mode 100644
index 0000000..71dcb7c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractEdmDeserializer.java
@@ -0,0 +1,71 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.core.edm.xml.v4.ReturnTypeImpl;
+import org.apache.olingo.client.core.edm.xml.v4.annotation.ConstExprConstructImpl;
+
+public abstract class AbstractEdmDeserializer<T> extends JsonDeserializer<T> {
+
+ protected ODataClient client;
+
+ protected boolean isAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
+ return ConstExprConstructImpl.Type.fromString(jp.getCurrentName()) != null;
+ }
+
+ protected ConstExprConstructImpl parseAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
+ final ConstExprConstructImpl constExpr = new ConstExprConstructImpl();
+ constExpr.setType(ConstExprConstructImpl.Type.fromString(jp.getCurrentName()));
+ constExpr.setValue(jp.nextTextValue());
+ return constExpr;
+ }
+
+ protected ReturnTypeImpl parseReturnType(final JsonParser jp, final String elementName) throws IOException {
+ ReturnTypeImpl returnType;
+ if (elementName.equals(((FromXmlParser) jp).getStaxReader().getLocalName())) {
+ returnType = new ReturnTypeImpl();
+ returnType.setType(jp.nextTextValue());
+ } else {
+ jp.nextToken();
+ returnType = jp.readValueAs( ReturnTypeImpl.class);
+ }
+ return returnType;
+ }
+
+ 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/client/core/op/impl/AbstractJacksonTool.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractJacksonTool.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractJacksonTool.java
new file mode 100644
index 0000000..2c5e0cb
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/AbstractJacksonTool.java
@@ -0,0 +1,85 @@
+/*
+ * 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.op.impl;
+
+import com.fasterxml.aalto.stax.InputFactoryImpl;
+import com.fasterxml.aalto.stax.OutputFactoryImpl;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.InjectableValues;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.deser.DeserializationProblemHandler;
+import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
+import com.fasterxml.jackson.dataformat.xml.XmlFactory;
+import com.fasterxml.jackson.dataformat.xml.XmlMapper;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+abstract class AbstractJacksonTool {
+
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractJacksonTool.class);
+
+ protected final ODataClient client;
+
+ protected AbstractJacksonTool(final ODataClient client) {
+ this.client = client;
+ }
+
+ protected ObjectMapper getObjectMapper() {
+ final ObjectMapper mapper = new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);
+
+ mapper.setInjectableValues(new InjectableValues.Std().addValue(ODataClient.class, client));
+
+ mapper.setSerializerProvider(new InjectableSerializerProvider(mapper.getSerializerProvider(),
+ mapper.getSerializationConfig().withAttribute(ODataClient.class, client),
+ mapper.getSerializerFactory()));
+
+ return mapper;
+ }
+
+ protected XmlMapper getXmlMapper() {
+ final XmlMapper xmlMapper = new XmlMapper(
+ new XmlFactory(new InputFactoryImpl(), new OutputFactoryImpl()), new JacksonXmlModule());
+
+ xmlMapper.setInjectableValues(new InjectableValues.Std().addValue(ODataClient.class, client));
+
+ xmlMapper.addHandler(new DeserializationProblemHandler() {
+
+ @Override
+ public boolean handleUnknownProperty(final DeserializationContext ctxt, final JsonParser jp,
+ final JsonDeserializer<?> deserializer, final Object beanOrClass, final String propertyName)
+ throws IOException, JsonProcessingException {
+
+ // skip any unknown property
+ LOG.warn("Skipping unknown property {}", propertyName);
+ ctxt.getParser().skipChildren();
+ return true;
+ }
+ });
+ return xmlMapper;
+ }
+
+}
[28/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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/edm/xml/v4/FunctionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/FunctionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/FunctionImportImpl.java
deleted file mode 100644
index da07545..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/FunctionImportImpl.java
+++ /dev/null
@@ -1,92 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.FunctionImport;
-
-public class FunctionImportImpl implements FunctionImport {
-
- private static final long serialVersionUID = 3023813358471000019L;
-
- @JsonProperty(value = "Name", required = true)
- private String name;
-
- @JsonProperty(value = "Function", required = true)
- private String function;
-
- @JsonProperty(value = "EntitySet")
- private String entitySet;
-
- @JsonProperty(value = "IncludeInServiceDocument")
- private boolean includeInServiceDocument = false;
-
- @JsonProperty(value = "Annotation")
- private Annotation annotation;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getFunction() {
- return function;
- }
-
- public void setFunction(final String function) {
- this.function = function;
- }
-
- @Override
- public String getEntitySet() {
- return entitySet;
- }
-
- @Override
- public void setEntitySet(final String entitySet) {
- this.entitySet = entitySet;
- }
-
- @Override
- public boolean isIncludeInServiceDocument() {
- return includeInServiceDocument;
- }
-
- public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
- this.includeInServiceDocument = includeInServiceDocument;
- }
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- @JsonIgnore
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-
-}
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/edm/xml/v4/IncludeAnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/IncludeAnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/IncludeAnnotationsImpl.java
deleted file mode 100644
index d051986..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/IncludeAnnotationsImpl.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.edm.xml.v4;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.IncludeAnnotations;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class IncludeAnnotationsImpl extends AbstractEdmItem implements IncludeAnnotations {
-
- private static final long serialVersionUID = -5600031479702563436L;
-
- @JsonProperty(value = "TermNamespace", required = true)
- private String termNamespace;
-
- @JsonProperty(value = "Qualifier")
- private String qualifier;
-
- @JsonProperty(value = "TargetNamespace")
- private String targeyNamespace;
-
- @Override
- public String getTermNamespace() {
- return termNamespace;
- }
-
- public void setTermNamespace(final String termNamespace) {
- this.termNamespace = termNamespace;
- }
-
- @Override
- public String getQualifier() {
- return qualifier;
- }
-
- public void setQualifier(final String qualifier) {
- this.qualifier = qualifier;
- }
-
- @Override
- public String getTargeyNamespace() {
- return targeyNamespace;
- }
-
- public void setTargeyNamespace(final String targeyNamespace) {
- this.targeyNamespace = targeyNamespace;
- }
-
-}
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/edm/xml/v4/IncludeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/IncludeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/IncludeImpl.java
deleted file mode 100644
index 6c7a385..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/IncludeImpl.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.edm.xml.v4;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Include;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class IncludeImpl extends AbstractEdmItem implements Include {
-
- private static final long serialVersionUID = -5600031479702563436L;
-
- @JsonProperty(value = "Namespace", required = true)
- private String namespace;
-
- @JsonProperty(value = "Alias")
- private String alias;
-
- @Override
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(final String namespace) {
- this.namespace = namespace;
- }
-
- @Override
- public String getAlias() {
- return alias;
- }
-
- public void setAlias(final String alias) {
- this.alias = alias;
- }
-
-}
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/edm/xml/v4/MemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/MemberImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/MemberImpl.java
deleted file mode 100644
index dfcb6cf..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/MemberImpl.java
+++ /dev/null
@@ -1,44 +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.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.AnnotatedEdmItem;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractMember;
-
-public class MemberImpl extends AbstractMember implements AnnotatedEdmItem {
-
- private static final long serialVersionUID = -344920557183058824L;
-
- @JsonProperty("Annotation")
- private Annotation annotation;
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- @JsonIgnore
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-
-}
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/edm/xml/v4/NavigationPropertyBindingImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/NavigationPropertyBindingImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/NavigationPropertyBindingImpl.java
deleted file mode 100644
index b32378a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/NavigationPropertyBindingImpl.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.edm.xml.v4;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationPropertyBinding;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public class NavigationPropertyBindingImpl extends AbstractEdmItem implements NavigationPropertyBinding {
-
- private static final long serialVersionUID = -6026065326479176817L;
-
- @JsonProperty(value = "Path", required = true)
- private String path;
-
- @JsonProperty(value = "Target", required = true)
- private String target;
-
- @Override
- public String getPath() {
- return path;
- }
-
- public void setPath(final String path) {
- this.path = path;
- }
-
- @Override
- public String getTarget() {
- return target;
- }
-
- public void setTarget(final String target) {
- this.target = target;
- }
-
-}
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/edm/xml/v4/NavigationPropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/NavigationPropertyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/NavigationPropertyDeserializer.java
deleted file mode 100644
index 89c942b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/NavigationPropertyDeserializer.java
+++ /dev/null
@@ -1,67 +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.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.core.edm.xml.OnDeleteImpl;
-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 java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class NavigationPropertyDeserializer extends AbstractEdmDeserializer<NavigationPropertyImpl> {
-
- @Override
- protected NavigationPropertyImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final NavigationPropertyImpl property = new NavigationPropertyImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- property.setName(jp.nextTextValue());
- } else if ("Type".equals(jp.getCurrentName())) {
- property.setType(jp.nextTextValue());
- } else if ("Nullable".equals(jp.getCurrentName())) {
- property.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Partner".equals(jp.getCurrentName())) {
- property.setPartner(jp.nextTextValue());
- } else if ("ContainsTarget".equals(jp.getCurrentName())) {
- property.setContainsTarget(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("ReferentialConstraint".equals(jp.getCurrentName())) {
- jp.nextToken();
- property.getReferentialConstraints().add(jp.readValueAs(ReferentialConstraintImpl.class));
- } else if ("OnDelete".equals(jp.getCurrentName())) {
- jp.nextToken();
- property.setOnDelete(jp.readValueAs(OnDeleteImpl.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- property.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return property;
- }
-
-}
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/edm/xml/v4/NavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/NavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/NavigationPropertyImpl.java
deleted file mode 100644
index 844d6de..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/NavigationPropertyImpl.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 org.apache.olingo.odata4.client.core.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.OnDelete;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ReferentialConstraint;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractNavigationProperty;
-
-@JsonDeserialize(using = NavigationPropertyDeserializer.class)
-public class NavigationPropertyImpl extends AbstractNavigationProperty implements NavigationProperty {
-
- private static final long serialVersionUID = -2889417442815563307L;
-
- private String type;
-
- private boolean nullable = true;
-
- private String partner;
-
- private boolean containsTarget = false;
-
- private final List<ReferentialConstraint> referentialConstraints = new ArrayList<ReferentialConstraint>();
-
- private OnDelete onDelete;
-
- private Annotation annotation;
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- @Override
- public boolean isNullable() {
- return nullable;
- }
-
- public void setNullable(final boolean nullable) {
- this.nullable = nullable;
- }
-
- @Override
- public String getPartner() {
- return partner;
- }
-
- public void setPartner(final String partner) {
- this.partner = partner;
- }
-
- @Override
- public boolean isContainsTarget() {
- return containsTarget;
- }
-
- public void setContainsTarget(final boolean containsTarget) {
- this.containsTarget = containsTarget;
- }
-
- @Override
- public List<ReferentialConstraint> getReferentialConstraints() {
- return referentialConstraints;
- }
-
- @Override
- public OnDelete getOnDelete() {
- return onDelete;
- }
-
- public void setOnDelete(final OnDelete onDelete) {
- this.onDelete = onDelete;
- }
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-
-}
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/edm/xml/v4/ParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ParameterImpl.java
deleted file mode 100644
index bb6416a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ParameterImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml.v4;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Parameter;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractParameter;
-
-public class ParameterImpl extends AbstractParameter implements Parameter {
-
- private static final long serialVersionUID = -1067642515116697747L;
-
- private String srid;
-
- @Override
- public String getSrid() {
- return srid;
- }
-
- public void setSrid(final String srid) {
- this.srid = srid;
- }
-
-}
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/edm/xml/v4/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/PropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/PropertyImpl.java
deleted file mode 100644
index f71f68f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/PropertyImpl.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.edm.xml.v4;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Property;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractProperty;
-
-public class PropertyImpl extends AbstractProperty implements Property {
-
- private static final long serialVersionUID = -5541908235094985412L;
-
- private Annotation annotation;
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- @JsonIgnore
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-}
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/edm/xml/v4/ReferenceDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReferenceDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReferenceDeserializer.java
deleted file mode 100644
index 60c225a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReferenceDeserializer.java
+++ /dev/null
@@ -1,58 +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.edm.xml.v4;
-
-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 java.io.IOException;
-import java.net.URI;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class ReferenceDeserializer extends AbstractEdmDeserializer<ReferenceImpl> {
-
- @Override
- protected ReferenceImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final ReferenceImpl reference = new ReferenceImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Uri".equals(jp.getCurrentName())) {
- reference.setUri(URI.create(jp.nextTextValue()));
- } else if ("Include".equals(jp.getCurrentName())) {
- jp.nextToken();
- reference.getIncludes().add(jp.readValueAs( IncludeImpl.class));
- } else if ("IncludeAnnotations".equals(jp.getCurrentName())) {
- jp.nextToken();
- reference.getIncludeAnnotations().add(jp.readValueAs( IncludeAnnotationsImpl.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- reference.getAnnotations().add(jp.readValueAs( AnnotationImpl.class));
- }
- }
- }
-
- return reference;
- }
-
-}
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/edm/xml/v4/ReferenceImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReferenceImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReferenceImpl.java
deleted file mode 100644
index 3437ea2..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReferenceImpl.java
+++ /dev/null
@@ -1,68 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Include;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.IncludeAnnotations;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Reference;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-@JsonDeserialize(using = ReferenceDeserializer.class)
-public class ReferenceImpl extends AbstractEdmItem implements Reference {
-
- private static final long serialVersionUID = -5600031479702563436L;
-
- private URI uri;
-
- private final List<Include> includes = new ArrayList<Include>();
-
- private final List<IncludeAnnotations> includeAnnotations = new ArrayList<IncludeAnnotations>();
-
- private final List<Annotation> annotations = new ArrayList<Annotation>();
-
- @Override
- public URI getUri() {
- return uri;
- }
-
- public void setUri(final URI uri) {
- this.uri = uri;
- }
-
- @Override
- public List<Include> getIncludes() {
- return includes;
- }
-
- @Override
- public List<IncludeAnnotations> getIncludeAnnotations() {
- return includeAnnotations;
- }
-
- @Override
- public List<Annotation> getAnnotations() {
- return annotations;
- }
-
-}
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/edm/xml/v4/ReferentialConstraintImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReferentialConstraintImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReferentialConstraintImpl.java
deleted file mode 100644
index 1b1a8e1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReferentialConstraintImpl.java
+++ /dev/null
@@ -1,52 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ReferentialConstraint;
-
-public class ReferentialConstraintImpl extends AbstractAnnotatedEdmItem implements ReferentialConstraint {
-
- private static final long serialVersionUID = -9182114558289778632L;
-
- @JsonProperty(value = "Property", required = true)
- private String property;
-
- @JsonProperty(value = "ReferencedProperty", required = true)
- private String referencedProperty;
-
- @Override
- public String getProperty() {
- return property;
- }
-
- public void setProperty(final String property) {
- this.property = property;
- }
-
- @Override
- public String getReferencedProperty() {
- return referencedProperty;
- }
-
- public void setReferencedProperty(final String referencedProperty) {
- this.referencedProperty = referencedProperty;
- }
-
-}
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/edm/xml/v4/ReturnTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeDeserializer.java
deleted file mode 100644
index d3e426f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeDeserializer.java
+++ /dev/null
@@ -1,60 +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.edm.xml.v4;
-
-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 java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class ReturnTypeDeserializer extends AbstractEdmDeserializer<ReturnTypeImpl> {
-
- @Override
- protected ReturnTypeImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final ReturnTypeImpl returnType = new ReturnTypeImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Type".equals(jp.getCurrentName())) {
- returnType.setType(jp.nextTextValue());
- } else if ("Nullable".equals(jp.getCurrentName())) {
- returnType.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- final String maxLenght = jp.nextTextValue();
- returnType.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
- } else if ("Precision".equals(jp.getCurrentName())) {
- returnType.setPrecision(Integer.valueOf(jp.nextTextValue()));
- } else if ("Scale".equals(jp.getCurrentName())) {
- returnType.setScale(Integer.valueOf(jp.nextTextValue()));
- } else if ("SRID".equals(jp.getCurrentName())) {
- returnType.setSrid(jp.nextTextValue());
- }
- }
- }
-
- return returnType;
- }
-
-}
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/edm/xml/v4/ReturnTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeImpl.java
deleted file mode 100644
index 2157038..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeImpl.java
+++ /dev/null
@@ -1,96 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ReturnType;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-@JsonDeserialize(using = ReturnTypeDeserializer.class)
-public class ReturnTypeImpl extends AbstractEdmItem implements ReturnType {
-
- private static final long serialVersionUID = -5888231162358116515L;
-
- private String type;
-
- private boolean nullable = true;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- private String srid;
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- @Override
- public boolean isNullable() {
- return nullable;
- }
-
- public void setNullable(final boolean nullable) {
- this.nullable = nullable;
- }
-
- @Override
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public void setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- }
-
- @Override
- public Integer getPrecision() {
- return precision;
- }
-
- public void setPrecision(final Integer precision) {
- this.precision = precision;
- }
-
- @Override
- public Integer getScale() {
- return scale;
- }
-
- public void setScale(final Integer scale) {
- this.scale = scale;
- }
-
- @Override
- public String getSrid() {
- return srid;
- }
-
- public void setSrid(final String srid) {
- this.srid = srid;
- }
-
-}
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/edm/xml/v4/SchemaImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SchemaImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SchemaImpl.java
deleted file mode 100644
index fe67a85..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SchemaImpl.java
+++ /dev/null
@@ -1,180 +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.edm.xml.v4;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.EnumType;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Action;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotations;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.ComplexType;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntityContainer;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.EntityType;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Function;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Term;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.TypeDefinition;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractSchema;
-
-public class SchemaImpl extends AbstractSchema implements Schema {
-
- private static final long serialVersionUID = 4453992249818796144L;
-
- private final List<Action> actions = new ArrayList<Action>();
-
- private final List<Annotations> annotationsList = new ArrayList<Annotations>();
-
- private final List<Annotation> annotations = new ArrayList<Annotation>();
-
- private final List<ComplexType> complexTypes = new ArrayList<ComplexType>();
-
- private EntityContainer entityContainer;
-
- private final List<EnumType> enumTypes = new ArrayList<EnumType>();
-
- private final List<EntityType> entityTypes = new ArrayList<EntityType>();
-
- private final List<Function> functions = new ArrayList<Function>();
-
- private final List<Term> terms = new ArrayList<Term>();
-
- private final List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>();
-
- private Annotation annotation;
-
- @Override
- public List<Action> getActions() {
- return actions;
- }
-
- @Override
- public List<Action> getActions(final String name) {
- return getAllByName(name, getActions());
- }
-
- @Override
- public List<Annotations> getAnnotationsList() {
- return annotationsList;
- }
-
- @Override
- public Annotations getAnnotationsList(final String target) {
- Annotations result = null;
- for (Annotations annots : getAnnotationsList()) {
- if (target.equals(annots.getTarget())) {
- result = annots;
- }
- }
- return result;
- }
-
- @Override
- public List<Annotation> getAnnotations() {
- return annotations;
- }
-
- @Override
- public List<Function> getFunctions() {
- return functions;
- }
-
- @Override
- public List<Function> getFunctions(final String name) {
- return getAllByName(name, getFunctions());
- }
-
- @Override
- public List<Term> getTerms() {
- return terms;
- }
-
- @Override
- public TypeDefinition getTypeDefinition(final String name) {
- return getOneByName(name, getTypeDefinitions());
- }
-
- @Override
- public List<TypeDefinition> getTypeDefinitions() {
- return typeDefinitions;
- }
-
- @Override
- public EntityContainer getEntityContainer() {
- return entityContainer;
- }
-
- public void setEntityContainer(final EntityContainerImpl entityContainer) {
- this.entityContainer = entityContainer;
- }
-
- @Override
- public List<EntityContainer> getEntityContainers() {
- return entityContainer == null
- ? Collections.<EntityContainer>emptyList() : Collections.singletonList(entityContainer);
- }
-
- @Override
- public EntityContainer getDefaultEntityContainer() {
- return entityContainer;
- }
-
- @Override
- public EntityContainer getEntityContainer(final String name) {
- if (entityContainer != null && name.equals(entityContainer.getName())) {
- return entityContainer;
- }
- return null;
- }
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-
- @Override
- public List<EnumType> getEnumTypes() {
- return enumTypes;
- }
-
- @Override
- public ComplexType getComplexType(final String name) {
- return (ComplexType) super.getComplexType(name);
- }
-
- @Override
- public List<ComplexType> getComplexTypes() {
- return complexTypes;
- }
-
- @Override
- public EntityType getEntityType(final String name) {
- return (EntityType) super.getEntityType(name);
- }
-
- @Override
- public List<EntityType> getEntityTypes() {
- return entityTypes;
- }
-}
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/edm/xml/v4/SingletonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonDeserializer.java
deleted file mode 100644
index 77b7889..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonDeserializer.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.edm.xml.v4;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class SingletonDeserializer extends AbstractEdmDeserializer<SingletonImpl> {
-
- @Override
- protected SingletonImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final SingletonImpl singleton = new SingletonImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- singleton.setName(jp.nextTextValue());
- } else if ("Type".equals(jp.getCurrentName())) {
- singleton.setEntityType(jp.nextTextValue());
- } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
- jp.nextToken();
- singleton.getNavigationPropertyBindings().add(
- jp.readValueAs(NavigationPropertyBindingImpl.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- singleton.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return singleton;
- }
-
-}
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/edm/xml/v4/SingletonImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonImpl.java
deleted file mode 100644
index 235b16d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonImpl.java
+++ /dev/null
@@ -1,61 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationPropertyBinding;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Singleton;
-
-@JsonDeserialize(using = SingletonDeserializer.class)
-public class SingletonImpl extends AbstractAnnotatedEdmItem implements Singleton {
-
- private static final long serialVersionUID = 941802518279658559L;
-
- private String name;
-
- private String entityType;
-
- private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getEntityType() {
- return entityType;
- }
-
- public void setEntityType(final String entityType) {
- this.entityType = entityType;
- }
-
- @Override
- public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
- return navigationPropertyBindings;
- }
-
-}
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/edm/xml/v4/TermDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TermDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TermDeserializer.java
deleted file mode 100644
index c8fed65..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TermDeserializer.java
+++ /dev/null
@@ -1,75 +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.edm.xml.v4;
-
-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 java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.CSDLElement;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class TermDeserializer extends AbstractEdmDeserializer<TermImpl> {
-
- @Override
- protected TermImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final TermImpl term = new TermImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- term.setName(jp.nextTextValue());
- } else if ("Type".equals(jp.getCurrentName())) {
- term.setType(jp.nextTextValue());
- } else if ("BaseTerm".equals(jp.getCurrentName())) {
- term.setBaseTerm(jp.nextTextValue());
- } else if ("DefaultValue".equals(jp.getCurrentName())) {
- term.setDefaultValue(jp.nextTextValue());
- } else if ("Nullable".equals(jp.getCurrentName())) {
- term.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- final String maxLenght = jp.nextTextValue();
- term.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
- } else if ("Precision".equals(jp.getCurrentName())) {
- term.setPrecision(Integer.valueOf(jp.nextTextValue()));
- } else if ("Scale".equals(jp.getCurrentName())) {
- term.setScale(Integer.valueOf(jp.nextTextValue()));
- } else if ("SRID".equals(jp.getCurrentName())) {
- term.setSrid(jp.nextTextValue());
- } else if ("AppliesTo".equals(jp.getCurrentName())) {
- for (String split : StringUtils.split(jp.nextTextValue())) {
- term.getAppliesTo().add(CSDLElement.valueOf(split));
- }
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- term.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return term;
- }
-
-}
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/edm/xml/v4/TermImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TermImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TermImpl.java
deleted file mode 100644
index 5e7097d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TermImpl.java
+++ /dev/null
@@ -1,138 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.CSDLElement;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Term;
-
-@JsonDeserialize(using = TermDeserializer.class)
-public class TermImpl extends AbstractAnnotatedEdmItem implements Term {
-
- private static final long serialVersionUID = -5888231162358116515L;
-
- private String name;
-
- private String type;
-
- private String baseTerm;
-
- private String defaultValue;
-
- private boolean nullable = true;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- private String srid;
-
- private final List<CSDLElement> appliesTo = new ArrayList<CSDLElement>();
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- @Override
- public String getBaseTerm() {
- return baseTerm;
- }
-
- public void setBaseTerm(final String baseTerm) {
- this.baseTerm = baseTerm;
- }
-
- @Override
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public void setDefaultValue(final String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- @Override
- public boolean isNullable() {
- return nullable;
- }
-
- public void setNullable(final boolean nullable) {
- this.nullable = nullable;
- }
-
- @Override
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public void setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- }
-
- @Override
- public Integer getPrecision() {
- return precision;
- }
-
- public void setPrecision(final Integer precision) {
- this.precision = precision;
- }
-
- @Override
- public Integer getScale() {
- return scale;
- }
-
- public void setScale(final Integer scale) {
- this.scale = scale;
- }
-
- @Override
- public String getSrid() {
- return srid;
- }
-
- public void setSrid(final String srid) {
- this.srid = srid;
- }
-
- @Override
- public List<CSDLElement> getAppliesTo() {
- return appliesTo;
- }
-
-}
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/edm/xml/v4/TypeDefinitionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
deleted file mode 100644
index 07d2589..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.xml.v4;
-
-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 java.io.IOException;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class TypeDefinitionDeserializer extends AbstractEdmDeserializer<TypeDefinitionImpl> {
-
- @Override
- protected TypeDefinitionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final TypeDefinitionImpl typeDefinition = new TypeDefinitionImpl();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- typeDefinition.setName(jp.nextTextValue());
- } else if ("UnderlyingType".equals(jp.getCurrentName())) {
- typeDefinition.setUnderlyingType(jp.nextTextValue());
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- typeDefinition.setMaxLength(jp.nextIntValue(0));
- } else if ("Unicode".equals(jp.getCurrentName())) {
- typeDefinition.setUnicode(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Precision".equals(jp.getCurrentName())) {
- typeDefinition.setPrecision(jp.nextIntValue(0));
- } else if ("Scale".equals(jp.getCurrentName())) {
- typeDefinition.setScale(jp.nextIntValue(0));
- } else if ("SRID".equals(jp.getCurrentName())) {
- typeDefinition.setSrid(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- typeDefinition.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return typeDefinition;
- }
-
-}
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/edm/xml/v4/TypeDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionImpl.java
deleted file mode 100644
index a6b27c4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionImpl.java
+++ /dev/null
@@ -1,117 +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.edm.xml.v4;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.TypeDefinition;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-@JsonDeserialize(using = TypeDefinitionDeserializer.class)
-public class TypeDefinitionImpl extends AbstractEdmItem implements TypeDefinition {
-
- private static final long serialVersionUID = -5888231162358116515L;
-
- private String name;
-
- private String underlyingType;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- private boolean unicode = true;
-
- private String srid;
-
- private final List<Annotation> annotations = new ArrayList<Annotation>();
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public String getUnderlyingType() {
- return underlyingType;
- }
-
- public void setUnderlyingType(final String underlyingType) {
- this.underlyingType = underlyingType;
- }
-
- @Override
- public Integer getMaxLength() {
- return maxLength;
- }
-
- public void setMaxLength(final Integer maxLength) {
- this.maxLength = maxLength;
- }
-
- @Override
- public Integer getPrecision() {
- return precision;
- }
-
- public void setPrecision(final Integer precision) {
- this.precision = precision;
- }
-
- @Override
- public Integer getScale() {
- return scale;
- }
-
- public void setScale(final Integer scale) {
- this.scale = scale;
- }
-
- @Override
- public boolean isUnicode() {
- return unicode;
- }
-
- public void setUnicode(final boolean unicode) {
- this.unicode = unicode;
- }
-
- @Override
- public String getSrid() {
- return srid;
- }
-
- public void setSrid(final String srid) {
- this.srid = srid;
- }
-
- @Override
- public List<Annotation> getAnnotations() {
- return annotations;
- }
-
-}
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/edm/xml/v4/XMLMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/XMLMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/XMLMetadataImpl.java
deleted file mode 100644
index 5a6a7cc..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/XMLMetadataImpl.java
+++ /dev/null
@@ -1,55 +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.edm.xml.v4;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Edmx;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Reference;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Schema;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.XMLMetadata;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractXMLMetadata;
-
-public class XMLMetadataImpl extends AbstractXMLMetadata implements XMLMetadata {
-
- private static final long serialVersionUID = -7765327879691528010L;
-
- public XMLMetadataImpl(final EdmxImpl edmx) {
- super(edmx);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public List<Schema> getSchemas() {
- return (List<Schema>) super.getSchemas();
- }
-
- @Override
- public Schema getSchema(final int index) {
- return (Schema) super.getSchema(index);
- }
-
- @Override
- public Schema getSchema(final String key) {
- return (Schema) super.getSchema(key);
- }
-
- public List<Reference> getReferences() {
- return ((Edmx) this.edmx).getReferences();
- }
-}
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/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java
deleted file mode 100644
index fe871b3..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.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.edm.xml.v4.annotation;
-
-/**
- * Groups dynamic expressions that may be provided using element notation or attribute notation.
- */
-abstract class AbstractElOrAttrConstruct extends DynExprConstructImpl {
-
- private static final long serialVersionUID = 5503275111425750339L;
-
- private String value;
-
- public String getValue() {
- return value;
- }
-
- public void setValue(final String value) {
- this.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/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java
deleted file mode 100644
index 1532cf0..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java
+++ /dev/null
@@ -1,38 +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.edm.xml.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.AnnotatedEdmItem;
-
-abstract class AnnotatedDynExprConstruct extends DynExprConstructImpl implements AnnotatedEdmItem {
-
- private static final long serialVersionUID = -8117155475397749038L;
-
- private Annotation annotation;
-
- @Override
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public void setAnnotation(final Annotation annotation) {
- this.annotation = annotation;
- }
-}
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/edm/xml/v4/annotation/AnnotationPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotationPath.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotationPath.java
deleted file mode 100644
index b6a4c7d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotationPath.java
+++ /dev/null
@@ -1,25 +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.edm.xml.v4.annotation;
-
-public class AnnotationPath extends AbstractElOrAttrConstruct {
-
- private static final long serialVersionUID = 6198019768659098819L;
-
-}
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/edm/xml/v4/annotation/Apply.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Apply.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Apply.java
deleted file mode 100644
index 362fbc2..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Apply.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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-
-@JsonDeserialize(using = ApplyDeserializer.class)
-public class Apply extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = 6198019768659098819L;
-
- public static final String CANONICAL_FUNCTION_CONCAT = "odata.concat";
-
- public static final String CANONICAL_FUNCTION_FILLURITEMPLATE = "odata.fillUriTemplate";
-
- public static final String CANONICAL_FUNCTION_URIENCODE = "odata.uriEncode";
-
- private String function;
-
- private final List<ExprConstruct> parameters = new ArrayList<ExprConstruct>();
-
- public String getFunction() {
- return function;
- }
-
- public void setFunction(final String function) {
- this.function = function;
- }
-
- public List<ExprConstruct> getParameters() {
- return parameters;
- }
-
-}
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/edm/xml/v4/annotation/ApplyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ApplyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
deleted file mode 100644
index 56378dc..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
+++ /dev/null
@@ -1,55 +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.edm.xml.v4.annotation;
-
-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 java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class ApplyDeserializer extends AbstractEdmDeserializer<Apply> {
-
- @Override
- protected Apply doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final Apply apply = new Apply();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Function".equals(jp.getCurrentName())) {
- apply.setFunction(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- apply.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else if (isAnnotationConstExprConstruct(jp)) {
- apply.getParameters().add(parseAnnotationConstExprConstruct(jp));
- } else {
- apply.getParameters().add(jp.readValueAs(DynExprConstructImpl.class));
- }
- }
- }
-
- return apply;
- }
-
-}
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/edm/xml/v4/annotation/Cast.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Cast.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Cast.java
deleted file mode 100644
index b3e3127..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Cast.java
+++ /dev/null
@@ -1,90 +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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.math.BigInteger;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-@JsonDeserialize(using = CastDeserializer.class)
-public class Cast extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = -7836626668653004926L;
-
- private String type;
-
- private String maxLength;
-
- private BigInteger precision;
-
- private BigInteger scale;
-
- private String srid;
-
- private DynExprConstruct value;
-
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- public String getMaxLength() {
- return maxLength;
- }
-
- public void setMaxLength(final String maxLength) {
- this.maxLength = maxLength;
- }
-
- public BigInteger getPrecision() {
- return precision;
- }
-
- public void setPrecision(final BigInteger precision) {
- this.precision = precision;
- }
-
- public BigInteger getScale() {
- return scale;
- }
-
- public void setScale(final BigInteger scale) {
- this.scale = scale;
- }
-
- public String getSrid() {
- return srid;
- }
-
- public void setSrid(final String srid) {
- this.srid = srid;
- }
-
- public DynExprConstruct getValue() {
- return value;
- }
-
- public void setValue(final DynExprConstruct value) {
- this.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/edm/xml/v4/annotation/CastDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CastDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CastDeserializer.java
deleted file mode 100644
index 4430bc0..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CastDeserializer.java
+++ /dev/null
@@ -1,62 +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.edm.xml.v4.annotation;
-
-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 java.io.IOException;
-import java.math.BigInteger;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class CastDeserializer extends AbstractEdmDeserializer<Cast> {
-
- @Override
- protected Cast doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final Cast cast = new Cast();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Type".equals(jp.getCurrentName())) {
- cast.setType(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- cast.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- cast.setMaxLength(jp.nextTextValue());
- } else if ("Precision".equals(jp.getCurrentName())) {
- cast.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L)));
- } else if ("Scale".equals(jp.getCurrentName())) {
- cast.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
- } else if ("SRID".equals(jp.getCurrentName())) {
- cast.setSrid(jp.nextTextValue());
- } else {
- cast.setValue(jp.readValueAs(DynExprConstructImpl.class));
- }
- }
- }
-
- return cast;
- }
-
-}
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/edm/xml/v4/annotation/Collection.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Collection.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Collection.java
deleted file mode 100644
index 3583a5c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Collection.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.edm.xml.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-
-@JsonDeserialize(using = CollectionDeserializer.class)
-public class Collection extends DynExprConstructImpl {
-
- private static final long serialVersionUID = -4975881520695477686L;
-
- private final List<ExprConstruct> items = new ArrayList<ExprConstruct>();
-
- public List<ExprConstruct> getItems() {
- return items;
- }
-
-}
[24/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
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/uri/filter/V4FilterArgFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V4FilterArgFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V4FilterArgFactoryImpl.java
deleted file mode 100644
index 47670a1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V4FilterArgFactoryImpl.java
+++ /dev/null
@@ -1,107 +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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-import org.apache.olingo.odata4.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/odata4/client/core/uri/filter/V4FilterFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V4FilterFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V4FilterFactoryImpl.java
deleted file mode 100644
index 93e5352..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/uri/filter/V4FilterFactoryImpl.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.uri.filter;
-
-import org.apache.olingo.odata4.client.api.uri.filter.FilterArg;
-import org.apache.olingo.odata4.client.api.uri.filter.URIFilter;
-import org.apache.olingo.odata4.client.api.uri.filter.V4FilterArgFactory;
-import org.apache.olingo.odata4.client.api.uri.filter.V4FilterFactory;
-import org.apache.olingo.odata4.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/odata4/client/core/xml/AbstractDOMParser.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/AbstractDOMParser.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/AbstractDOMParser.java
deleted file mode 100644
index 7237895..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/AbstractDOMParser.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.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/odata4/client/core/xml/AndroidDOMParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/AndroidDOMParserImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/AndroidDOMParserImpl.java
deleted file mode 100644
index 0d49c8e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/AndroidDOMParserImpl.java
+++ /dev/null
@@ -1,50 +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.xml;
-
-import org.apache.olingo.odata4.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/odata4/client/core/xml/DefaultDOMParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/DefaultDOMParserImpl.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/DefaultDOMParserImpl.java
deleted file mode 100644
index deaefc1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/DefaultDOMParserImpl.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.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/odata4/client/core/xml/XMLParser.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/XMLParser.java b/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/XMLParser.java
deleted file mode 100644
index d0f0b76..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/odata4/client/core/xml/XMLParser.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.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/test/java/org/apache/olingo/client/core/AbstractTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/AbstractTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/AbstractTest.java
new file mode 100644
index 0000000..592163c
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/AbstractTest.java
@@ -0,0 +1,60 @@
+/*
+ * 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;
+
+import java.util.Locale;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.api.ODataV3Client;
+import org.apache.olingo.client.api.ODataV4Client;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.client.api.format.ODataPubFormat;
+import org.apache.olingo.client.core.ODataClientFactory;
+import org.junit.BeforeClass;
+
+public abstract class AbstractTest {
+
+ protected static ODataV3Client v3Client;
+
+ protected static ODataV4Client v4Client;
+
+ protected abstract ODataClient getClient();
+
+ /**
+ * This is needed for correct number handling (Double, for example).
+ */
+ @BeforeClass
+ public static void setEnglishLocale() {
+ Locale.setDefault(Locale.ENGLISH);
+ }
+
+ @BeforeClass
+ public static void setClientInstances() {
+ v3Client = ODataClientFactory.getV3();
+ v4Client = ODataClientFactory.getV4();
+ }
+
+ protected String getSuffix(final ODataPubFormat format) {
+ return format == ODataPubFormat.ATOM ? "xml" : "json";
+ }
+
+ protected String getSuffix(final ODataFormat format) {
+ return format == ODataFormat.XML ? "xml" : "json";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/ODataClientTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/ODataClientTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/ODataClientTest.java
new file mode 100644
index 0000000..844152a
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/ODataClientTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.olingo.client.api.ODataClient;
+import org.apache.olingo.client.core.ODataClientFactory;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+import org.junit.Test;
+
+public class ODataClientTest {
+
+ @Test
+ public void before() {
+ ODataClient client = ODataClientFactory.getV3();
+ assertNotNull(client);
+ assertEquals(ODataServiceVersion.V30, client.getServiceVersion());
+
+ client = ODataClientFactory.getV4();
+ assertNotNull(client);
+ assertEquals(ODataServiceVersion.V40, client.getServiceVersion());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/deserializer/JsonReaderPerformance.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/deserializer/JsonReaderPerformance.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/deserializer/JsonReaderPerformance.java
new file mode 100644
index 0000000..1937e04
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/deserializer/JsonReaderPerformance.java
@@ -0,0 +1,76 @@
+/*
+ * 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.deserializer;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.olingo.client.api.deserializer.ComplexValue;
+import org.apache.olingo.client.api.deserializer.Property;
+import org.apache.olingo.client.api.deserializer.StructuralProperty;
+import org.apache.olingo.client.api.deserializer.Value;
+import org.apache.olingo.client.core.deserializer.JsonReader;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class JsonReaderPerformance {
+
+ private static final Logger LOG = LoggerFactory.getLogger(JsonReaderPerformance.class);
+
+ @Test
+ public void testComplexPropertyPerformance() throws Exception {
+ JsonReader consumer = new JsonReader();
+ int runs = 1000; // * 100;
+
+ InputStream in = JsonReaderPerformance.class.getResourceAsStream("/complexProperty.json");
+ String content = IOUtils.toString(in);
+
+ LOG.debug("Started...");
+ ComplexValue complex = null;
+ long startTime = System.currentTimeMillis();
+ for (int i = 0; i < runs; i++) {
+ Property property = consumer.readProperty(IOUtils.toInputStream(content));
+ complex = (ComplexValue) ((StructuralProperty) property).getValue();
+ }
+ long endTime = System.currentTimeMillis();
+
+ long duration = endTime - startTime;
+ LOG.debug("Duration: " + duration + " ms");
+ LOG.debug("Duration per run: " + (duration / (float) runs) + " ms");
+ testComplexProperty(complex);
+ }
+
+ private void testComplexProperty(final Value value) {
+ assertNotNull(value);
+ assertTrue(value.isComplex());
+
+ ComplexValue complex = (ComplexValue) value;
+
+ assertEquals("Obere Str. 57", complex.getValue("Street").getContent());
+ assertEquals("Berlin", complex.getValue("City").getContent());
+ assertNull(complex.getValue("Region").getContent());
+ assertEquals("D-12209", complex.getValue("PostalCode").getContent());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/deserializer/JsonReaderTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/deserializer/JsonReaderTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/deserializer/JsonReaderTest.java
new file mode 100644
index 0000000..0379ac8
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/deserializer/JsonReaderTest.java
@@ -0,0 +1,372 @@
+/*
+ * 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.deserializer;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.olingo.client.api.deserializer.ComplexValue;
+import org.apache.olingo.client.api.deserializer.Entity;
+import org.apache.olingo.client.api.deserializer.EntitySet;
+import org.apache.olingo.client.api.deserializer.Property;
+import org.apache.olingo.client.api.deserializer.Reader;
+import org.apache.olingo.client.api.deserializer.StructuralProperty;
+import org.apache.olingo.client.api.deserializer.Value;
+import org.apache.olingo.client.core.deserializer.JsonReader;
+import org.junit.Test;
+
+public class JsonReaderTest {
+
+ @Test
+ public void testEntitySet() throws Exception {
+ Reader consumer = new JsonReader();
+
+ EntitySet entitySet = consumer.readEntitySet(
+ JsonReaderTest.class.getResourceAsStream("/fullEntitySet.json"));
+
+ List<Entity> entities = entitySet.getEntities();
+ validateEntitySet(entitySet);
+ assertNotNull(entities);
+ Entity entity = entities.get(0);
+ assertNotNull(entity);
+ validateEntityAlfki(entity);
+
+ StructuralProperty structuralProperty = entity.getProperty("Address", StructuralProperty.class);
+ assertEquals("Address", structuralProperty.getName());
+
+ Value value = structuralProperty.getValue();
+ assertTrue(value.isComplex());
+ ComplexValue complexValue = (ComplexValue) value;
+ validateAddressBerlin(complexValue);
+ validateComplexValueNavigationLinks(complexValue);
+ }
+
+ @Test
+ public void testEntitySetWithTwoEntities() throws Exception {
+ Reader consumer = new JsonReader();
+
+ EntitySet entitySet = consumer.readEntitySet(getJson("/fullEntitySetWithTwoEntities.json"));
+
+ List<Entity> entities = entitySet.getEntities();
+ validateEntitySet(entitySet);
+ assertNotNull(entities);
+ assertEquals(2, entities.size());
+ //
+ Entity firstEntity = entities.get(0);
+ assertNotNull(firstEntity);
+ validateEntityAlfki(firstEntity);
+
+ StructuralProperty structuralProperty = firstEntity.getProperty("Address", StructuralProperty.class);
+ assertEquals("Address", structuralProperty.getName());
+
+ Value value = structuralProperty.getValue();
+ assertTrue(value.isComplex());
+ ComplexValue complexValue = (ComplexValue) value;
+ validateAddressBerlin(complexValue);
+ validateComplexValueNavigationLinks(complexValue);
+
+ //
+ Entity secondEntity = entities.get(1);
+ assertNotNull(secondEntity);
+ validateEntityMuski(secondEntity);
+
+ StructuralProperty addressMuster = secondEntity.getProperty("Address", StructuralProperty.class);
+ assertEquals("Address", addressMuster.getName());
+ validateAddressMuster((ComplexValue) addressMuster.getValue());
+ }
+
+ @Test
+ public void streamingTestForEntitySetWithTwoEntities() throws Exception {
+ Reader consumer = new JsonReader();
+
+ EntitySet entitySet = consumer.readEntitySet(getJson("/fullEntitySetWithTwoEntities.json"));
+ validateEntitySet(entitySet, false);
+
+ for (Entity entity : entitySet) {
+ if ("Customers('ALFKI')".equals(entity.getODataId())) {
+ validateEntityAlfki(entity);
+
+ StructuralProperty structuralProperty = entity.getProperty("Address", StructuralProperty.class);
+ assertEquals("Address", structuralProperty.getName());
+
+ Value value = structuralProperty.getValue();
+ assertTrue(value.isComplex());
+ ComplexValue complexValue = (ComplexValue) value;
+ validateAddressBerlin(complexValue);
+ validateComplexValueNavigationLinks(complexValue);
+ } else if ("Customers('MUSKI')".equals(entity.getODataId())) {
+ validateEntityMuski(entity);
+
+ StructuralProperty addressMuster = entity.getProperty("Address", StructuralProperty.class);
+ assertEquals("Address", addressMuster.getName());
+ validateAddressMuster((ComplexValue) addressMuster.getValue());
+ } else {
+ fail("Got unknown entity with id '" + entity.getODataId() + "'.");
+ }
+ }
+
+ validateEntitySet(entitySet, true);
+ }
+
+ @Test
+ public void iteratorTestForEntitySetWithTwoEntities() throws Exception {
+ Reader consumer = new JsonReader();
+
+ EntitySet entitySet = consumer.readEntitySet(getJson("/fullEntitySetWithTwoEntities.json"));
+ assertEquals(2, entitySet.getEntities().size());
+ validateEntitySet(entitySet, true);
+
+ for (Entity entity : entitySet) {
+ if ("Customers('ALFKI')".equals(entity.getODataId())) {
+ validateEntityAlfki(entity);
+
+ StructuralProperty structuralProperty = entity.getProperty("Address", StructuralProperty.class);
+ assertEquals("Address", structuralProperty.getName());
+
+ Value value = structuralProperty.getValue();
+ assertTrue(value.isComplex());
+ ComplexValue complexValue = (ComplexValue) value;
+ validateAddressBerlin(complexValue);
+ validateComplexValueNavigationLinks(complexValue);
+ } else if ("Customers('MUSKI')".equals(entity.getODataId())) {
+ validateEntityMuski(entity);
+
+ StructuralProperty addressMuster = entity.getProperty("Address", StructuralProperty.class);
+ assertEquals("Address", addressMuster.getName());
+ validateAddressMuster((ComplexValue) addressMuster.getValue());
+ } else {
+ fail("Got unknown entity with id '" + entity.getODataId() + "'.");
+ }
+ }
+ }
+
+ @Test
+ public void testEntity() throws Exception {
+ Reader consumer = new JsonReader();
+
+ Entity entity = consumer.readEntity(JsonReaderTest.class.getResourceAsStream("/fullEntity.json"));
+ validateEntityAlfki(entity);
+
+ StructuralProperty structuralProperty = entity.getProperty("Address", StructuralProperty.class);
+ assertEquals("Address", structuralProperty.getName());
+
+ Value value = structuralProperty.getValue();
+ assertTrue(value.isComplex());
+ ComplexValue complexValue = (ComplexValue) value;
+ validateAddressBerlin(complexValue);
+ validateComplexValueNavigationLinks(complexValue);
+ }
+
+ @Test
+ public void testComplexProperty() throws Exception {
+ Reader consumer = new JsonReader();
+
+ Property property = consumer.readProperty(getJson("/complexProperty.json"));
+ assertEquals("Address", property.getName());
+
+ assertTrue(property instanceof StructuralProperty);
+ StructuralProperty structuralProperty = (StructuralProperty) property;
+ Value value = structuralProperty.getValue();
+ assertTrue(value.isComplex());
+ ComplexValue complexValue = (ComplexValue) value;
+ validateAddressBerlin(complexValue);
+ validateAddressBerlin(complexValue);
+ }
+
+ @Test
+ public void testEntityWithCollectionOfComplexProperty() throws Exception {
+ Reader consumer = new JsonReader();
+
+ Entity entity = consumer.readEntity(getJson("/fullEntityWithCollectionOfComplexValues.json"));
+ StructuralProperty address = entity.getProperty("Address", StructuralProperty.class);
+ assertTrue(address.containsCollection());
+ assertEquals("Address", address.getName());
+
+ List<Value> values = address.getValues();
+ assertEquals(2, values.size());
+
+ Value value = values.get(0);
+ assertTrue(value.isComplex());
+ validateAddressBerlin((ComplexValue) value);
+ //
+ ComplexValue addressTwo = (ComplexValue) values.get(1);
+ validateAddressMuster(addressTwo);
+ }
+
+ @Test
+ public void testSetOfPrimitive() throws Exception {
+ Reader consumer = new JsonReader();
+
+ InputStream content = JsonReaderTest.class.getResourceAsStream("/setOfPrimitiveProperties.json");
+ Property property = consumer.readProperty(content);
+ assertEquals("EmailAddresses", property.getName());
+
+ assertTrue(property instanceof StructuralProperty);
+ StructuralProperty structuralProperty = (StructuralProperty) property;
+
+ assertTrue(structuralProperty.containsCollection());
+ Collection<Value> values = structuralProperty.getValues();
+ Iterator<Value> valueIt = values.iterator();
+ assertEquals("Julie@Swansworth.com", valueIt.next().getContent());
+ assertEquals("Julie.Swansworth@work.com", valueIt.next().getContent());
+ }
+
+ @Test
+ public void testSetOfComplex() throws Exception {
+ Reader consumer = new JsonReader();
+
+ InputStream content = JsonReaderTest.class.getResourceAsStream("/setOfComplexProperties.json");
+ Property property = consumer.readProperty(content);
+ assertEquals("PhoneNumbers", property.getName());
+ assertTrue(property instanceof StructuralProperty);
+
+ StructuralProperty structuralProperty = (StructuralProperty) property;
+ assertTrue(structuralProperty.containsCollection());
+ List<Value> values = structuralProperty.getValues();
+ assertEquals(2, values.size());
+
+ ComplexValue phoneNumberOne = (ComplexValue) values.get(0);
+ assertEquals("425-555-1212", phoneNumberOne.getValue("Number").getContent());
+ assertEquals("Home", phoneNumberOne.getValue("Type").getContent());
+ assertEquals(null, phoneNumberOne.getValue("Carrier"));
+ assertEquals(null, phoneNumberOne.getAnnotationProperties().get("odata.type"));
+
+ ComplexValue phoneNumberTwo = (ComplexValue) values.get(1);
+ assertEquals("425-555-0178", phoneNumberTwo.getValue("Number").getContent());
+ assertEquals("Cell", phoneNumberTwo.getValue("Type").getContent());
+ assertEquals("Sprint", phoneNumberTwo.getValue("Carrier").getContent());
+ assertEquals("#Model.CellPhoneNumber",
+ phoneNumberTwo.getAnnotationProperties().get("odata.type").getValue());
+
+ // ComplexValue complex = consumer.parseComplexValue(content);
+ //
+ // Value value = complex.getValue("PhoneNumbers");
+ // assertNotNull(value);
+ // assertTrue(value.isComplex());
+ // ComplexValue complexValue = (ComplexValue) value;
+ }
+
+ private void validateEntityAlfki(final Entity entity) {
+ assertNotNull(entity);
+
+ assertEquals("http://host/service/$metadata#Customers/$entity", entity.getODataContext());
+ assertEquals("Customers('ALFKI')", entity.getODataId());
+ assertEquals("W/\"MjAxMy0wNS0yN1QxMTo1OFo=\"", entity.getODataETag());
+ assertEquals("Customers('ALFKI')", entity.getODataEditLink());
+
+ assertNotNull(entity.getNavigationProperties());
+ assertTrue(entity.getNavigationProperties().containsKey("Orders"));
+ assertEquals("Customers('ALFKI')/Orders",
+ entity.getNavigationProperties().get("Orders").getNavigationLink());
+
+ assertNotNull(entity.getNavigationProperties());
+ assertTrue(entity.getNavigationProperties().containsKey("Orders"));
+ assertEquals("Customers('ALFKI')/Orders/$ref",
+ entity.getNavigationProperties().get("Orders").getAssociationLink());
+
+ assertNotNull(entity.getPropertyContent("ID"));
+ assertEquals("ALFKI", entity.getPropertyContent("ID"));
+ assertEquals("Alfreds Futterkiste", entity.getPropertyContent("CompanyName"));
+ assertEquals("Maria Anders", entity.getPropertyContent("ContactName"));
+ assertEquals("Sales Representative", entity.getPropertyContent("ContactTitle"));
+ assertEquals("030-0074321", entity.getPropertyContent("Phone"));
+ assertEquals("030-0076545", entity.getPropertyContent("Fax"));
+ }
+
+ private void validateEntityMuski(final Entity entity) {
+ assertNotNull(entity);
+
+ assertEquals("http://host/service/$metadata#Customers/$entity", entity.getODataContext());
+ assertEquals("Customers('MUSKI')", entity.getODataId());
+ assertEquals("W/\"MjAxMy0wNS0yN1QxMTo1OFo=\"", entity.getODataETag());
+ assertEquals("Customers('MUSKI')", entity.getODataEditLink());
+
+ assertNotNull(entity.getNavigationProperties());
+ assertTrue(entity.getNavigationProperties().containsKey("Orders"));
+ assertEquals("Customers('MUSKI')/Orders", entity.getNavigationProperties().get("Orders").getNavigationLink());
+
+ assertNotNull(entity.getNavigationProperties());
+ assertTrue(entity.getNavigationProperties().containsKey("Orders"));
+ assertEquals("Customers('MUSKI')/Orders/$ref",
+ entity.getNavigationProperties().get("Orders").getAssociationLink());
+
+ assertNotNull(entity.getPropertyContent("ID"));
+ assertEquals("MUSKI", entity.getPropertyContent("ID"));
+ assertEquals("Mustermanns Futterkiste", entity.getPropertyContent("CompanyName"));
+ assertEquals("Mustermann Max", entity.getPropertyContent("ContactName"));
+ assertEquals("Some Guy", entity.getPropertyContent("ContactTitle"));
+ assertEquals("030-002222", entity.getPropertyContent("Phone"));
+ assertEquals("030-004444", entity.getPropertyContent("Fax"));
+ }
+
+ private void validateAddressMuster(final ComplexValue addressTwo) {
+ assertEquals("Musterstrasse 42", addressTwo.getValue("Street").getContent());
+ assertEquals("Musterstadt", addressTwo.getValue("City").getContent());
+ assertEquals("SomeRegion", addressTwo.getValue("Region").getContent());
+ assertEquals("D-42042", addressTwo.getValue("PostalCode").getContent());
+ }
+
+ private void validateAddressBerlin(final ComplexValue complex) {
+ assertNotNull(complex);
+
+ assertEquals("Obere Str. 57", complex.getValue("Street").getContent());
+ assertEquals("Berlin", complex.getValue("City").getContent());
+ assertNull(complex.getValue("Region").getContent());
+ assertEquals("D-12209", complex.getValue("PostalCode").getContent());
+ }
+
+ private void validateComplexValueNavigationLinks(final ComplexValue complex) {
+ assertNotNull(complex.getNavigationProperties());
+ assertTrue(complex.getNavigationProperties().containsKey("Country"));
+ assertEquals("Customers('ALFKI')/Address/Country",
+ complex.getNavigationProperties().get("Country").getNavigationLink());
+
+ assertNotNull(complex.getNavigationProperties());
+ assertTrue(complex.getNavigationProperties().containsKey("Country"));
+ assertEquals("Customers('ALFKI')/Address/Country/$ref",
+ complex.getNavigationProperties().get("Country").getAssociationLink());
+ }
+
+ private void validateEntitySet(final EntitySet entitySet) {
+ validateEntitySet(entitySet, true);
+ }
+
+ private void validateEntitySet(final EntitySet entitySet, final boolean validateLinks) {
+ assertNotNull(entitySet);
+
+ assertEquals("http://host/service/$metadata#Customers/$entity", entitySet.getODataContext());
+ assertEquals(Long.valueOf(1), entitySet.getODataCount());
+ if (validateLinks) {
+ assertEquals("http://host/service/EntitySet?$skiptoken=342r89", entitySet.getODataNextLink());
+ assertNull(entitySet.getODataDeltaLink());
+ }
+ }
+
+ private InputStream getJson(final String filename) {
+ return JsonReaderTest.class.getResourceAsStream(filename);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/FilterFactoryTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/FilterFactoryTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/FilterFactoryTest.java
new file mode 100644
index 0000000..e56ffda
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/FilterFactoryTest.java
@@ -0,0 +1,167 @@
+/*
+ * 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.v3;
+
+import org.apache.olingo.client.api.ODataV3Client;
+import org.apache.olingo.client.api.uri.filter.URIFilter;
+import org.apache.olingo.client.api.uri.filter.V3FilterArgFactory;
+import org.apache.olingo.client.api.uri.filter.V3FilterFactory;
+import org.apache.olingo.client.core.AbstractTest;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class FilterFactoryTest extends AbstractTest {
+
+ @Override
+ protected ODataV3Client getClient() {
+ return v3Client;
+ }
+
+ private V3FilterFactory getFilterFactory() {
+ return getClient().getFilterFactory();
+ }
+
+ private V3FilterArgFactory getFilterArgFactory() {
+ return getFilterFactory().getArgFactory();
+ }
+
+ @Test
+ public void simple() {
+ final URIFilter filter = getFilterFactory().lt("VIN", 16);
+ assertEquals("(VIN lt 16)", filter.build());
+ }
+
+ @Test
+ public void _null() {
+ final URIFilter filter = getFilterFactory().eq(
+ getFilterArgFactory().property("NullValue"), getFilterArgFactory()._null());
+
+ assertEquals("(NullValue eq null)", filter.build());
+ }
+
+ @Test
+ public void and() {
+ final URIFilter filter = getFilterFactory().and(
+ getFilterFactory().lt("VIN", 16),
+ getFilterFactory().gt("VIN", 12));
+
+ assertEquals("((VIN lt 16) and (VIN gt 12))", filter.build());
+ }
+
+ @Test
+ public void not() {
+ final URIFilter filter = getFilterFactory().not(
+ getFilterFactory().or(
+ getFilterFactory().ge("VIN", 16),
+ getFilterFactory().le("VIN", 12)));
+
+ assertEquals("not (((VIN ge 16) or (VIN le 12)))", filter.build());
+ }
+
+ @Test
+ public void operator() {
+ URIFilter filter = getFilterFactory().eq(
+ getFilterArgFactory().add(
+ getFilterArgFactory().property("VIN"),
+ getFilterArgFactory().literal(1)),
+ getFilterArgFactory().literal(16));
+
+ assertEquals("((VIN add 1) eq 16)", filter.build());
+
+ filter = getFilterFactory().eq(
+ getFilterArgFactory().add(
+ getFilterArgFactory().literal(1),
+ getFilterArgFactory().property("VIN")),
+ getFilterArgFactory().literal(16));
+
+ assertEquals("((1 add VIN) eq 16)", filter.build());
+
+ filter = getFilterFactory().eq(
+ getFilterArgFactory().literal(16),
+ getFilterArgFactory().add(
+ getFilterArgFactory().literal(1),
+ getFilterArgFactory().property("VIN")));
+
+ assertEquals("(16 eq (1 add VIN))", filter.build());
+ }
+
+ @Test
+ public void function() {
+ final URIFilter filter = getFilterFactory().match(
+ getFilterArgFactory().startswith(
+ getFilterArgFactory().property("Description"),
+ getFilterArgFactory().literal("cen")));
+
+ assertEquals("startswith(Description,'cen')", filter.build());
+ }
+
+ @Test
+ public void composed() {
+ final URIFilter filter = getFilterFactory().gt(
+ getFilterArgFactory().length(
+ getFilterArgFactory().property("Description")),
+ getFilterArgFactory().add(
+ getFilterArgFactory().property("VIN"),
+ getFilterArgFactory().literal(10)));
+
+ assertEquals("(length(Description) gt (VIN add 10))", filter.build());
+ }
+
+ @Test
+ public void propertyPath() {
+ URIFilter filter = getFilterFactory().eq(
+ getFilterArgFactory().indexof(
+ getFilterArgFactory().property("PrimaryContactInfo/HomePhone/PhoneNumber"),
+ getFilterArgFactory().literal("ODataJClient")),
+ getFilterArgFactory().literal(1));
+
+ assertEquals("(indexof(PrimaryContactInfo/HomePhone/PhoneNumber,'ODataJClient') eq 1)", filter.build());
+
+ filter = getFilterFactory().ne(
+ getFilterArgFactory().indexof(
+ getFilterArgFactory().property("PrimaryContactInfo/HomePhone/PhoneNumber"),
+ getFilterArgFactory().literal("lccvussrv")),
+ getFilterArgFactory().literal(-1));
+
+ assertEquals("(indexof(PrimaryContactInfo/HomePhone/PhoneNumber,'lccvussrv') ne -1)", filter.build());
+ }
+
+ @Test
+ public void datetime() {
+ final URIFilter filter = getFilterFactory().eq(
+ getFilterArgFactory().month(
+ getFilterArgFactory().property("PurchaseDate")),
+ getFilterArgFactory().literal(12));
+
+ assertEquals("(month(PurchaseDate) eq 12)", filter.build());
+ }
+
+ @Test
+ public void isof() {
+ final URIFilter filter = getFilterFactory().match(
+ getFilterArgFactory().isof(
+ getFilterArgFactory().literal(
+ "Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee")));
+
+ assertEquals("isof('Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee')", filter.build());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java
new file mode 100644
index 0000000..6723d2b
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/MetadataTest.java
@@ -0,0 +1,224 @@
+/*
+ * 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.v3;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.olingo.client.api.ODataV3Client;
+import org.apache.olingo.client.api.edm.xml.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.EntityType;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.api.http.HttpMethod;
+import org.apache.olingo.client.core.AbstractTest;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmActionImport;
+import org.apache.olingo.commons.api.edm.EdmActionImportInfo;
+import org.apache.olingo.commons.api.edm.EdmBindingTarget;
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class MetadataTest extends AbstractTest {
+
+ @Override
+ protected ODataV3Client getClient() {
+ return v3Client;
+ }
+
+ @Test
+ public void parse() {
+ final XMLMetadata metadata = getClient().getDeserializer().
+ toMetadata(getClass().getResourceAsStream("metadata.xml"));
+ assertNotNull(metadata);
+
+ final EntityType order = metadata.getSchemas().get(0).getEntityType("Order");
+ assertNotNull(order);
+ assertEquals("Order", order.getName());
+
+ @SuppressWarnings("unchecked")
+ final List<FunctionImport> functionImports = (List<FunctionImport>) metadata.getSchemas().get(0).
+ getDefaultEntityContainer().getFunctionImports();
+ int legacyGetters = 0;
+ int legacyPosters = 0;
+ int actions = 0;
+ int functions = 0;
+ for (FunctionImport functionImport : functionImports) {
+ if (HttpMethod.GET.name().equals(functionImport.getHttpMethod())) {
+ legacyGetters++;
+ } else if (HttpMethod.POST.name().equals(functionImport.getHttpMethod())) {
+ legacyPosters++;
+ } else if (functionImport.getHttpMethod() == null) {
+ if (functionImport.isSideEffecting()) {
+ actions++;
+ } else {
+ functions++;
+ }
+ }
+ }
+ assertEquals(6, legacyGetters);
+ assertEquals(1, legacyPosters);
+ assertEquals(5, actions);
+ assertEquals(0, functions);
+ }
+
+ @Test
+ public void multipleSchemas() {
+ final XMLMetadata metadata = getClient().getDeserializer().
+ toMetadata(getClass().getResourceAsStream("northwind-metadata.xml"));
+ assertNotNull(metadata);
+
+ final Schema first = metadata.getSchema("NorthwindModel");
+ assertNotNull(first);
+
+ final Schema second = metadata.getSchema("ODataWebV3.Northwind.Model");
+ assertNotNull(second);
+
+ final EntityContainer entityContainer = second.getDefaultEntityContainer();
+ assertNotNull(entityContainer);
+ assertEquals("NorthwindEntities", entityContainer.getName());
+ }
+
+ @Test
+ public void complexAndEntityType() {
+ final Edm metadata = getClient().getReader().
+ readMetadata(getClass().getResourceAsStream("metadata.xml"));
+ assertNotNull(metadata);
+
+ final EdmEntityContainer container = metadata.getEntityContainer(
+ new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "DefaultContainer"));
+ assertNotNull(container);
+
+ final EdmComplexType complex = metadata.getComplexType(
+ new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "ContactDetails"));
+ assertNotNull(complex);
+ assertFalse(complex.getPropertyNames().isEmpty());
+ assertTrue(complex.getProperty("EmailBag").isCollection());
+
+ final EdmEntityType entity = metadata.getEntityType(
+ new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "ProductReview"));
+ assertNotNull(entity);
+ assertFalse(entity.getPropertyNames().isEmpty());
+ assertEquals(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance(),
+ entity.getProperty("ProductId").getType());
+
+ assertFalse(entity.getKeyPropertyRefs().isEmpty());
+ assertNotNull("ProductId", entity.getKeyPropertyRef("ProductId").getKeyPropertyName());
+ }
+
+ @Test
+ public void functionImport() {
+ final Edm metadata = getClient().getReader().
+ readMetadata(getClass().getResourceAsStream("metadata.xml"));
+ assertNotNull(metadata);
+
+ final Set<String> actionImports = new HashSet<String>();
+ for (EdmActionImportInfo info : metadata.getServiceMetadata().getActionImportInfos()) {
+ actionImports.add(info.getActionImportName());
+ }
+ final Set<String> expectedAI = new HashSet<String>(Arrays.asList(new String[]{
+ "ResetDataSource",
+ "IncreaseSalaries",
+ "Sack",
+ "GetComputer",
+ "ChangeProductDimensions",
+ "ResetComputerDetailsSpecifications"}));
+ assertEquals(expectedAI, actionImports);
+ final Set<String> functionImports = new HashSet<String>();
+ for (EdmFunctionImportInfo info : metadata.getServiceMetadata().getFunctionImportInfos()) {
+ functionImports.add(info.getFunctionImportName());
+ }
+ final Set<String> expectedFI = new HashSet<String>(Arrays.asList(new String[]{
+ "GetPrimitiveString",
+ "GetSpecificCustomer",
+ "GetCustomerCount",
+ "GetArgumentPlusOne",
+ "EntityProjectionReturnsCollectionOfComplexTypes",
+ "InStreamErrorGetCustomer"}));
+ assertEquals(expectedFI, functionImports);
+
+ final EdmEntityContainer container = metadata.getEntityContainer(
+ new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "DefaultContainer"));
+ assertNotNull(container);
+
+ final EdmFunctionImport getArgumentPlusOne = container.getFunctionImport("GetArgumentPlusOne");
+ assertNotNull(getArgumentPlusOne);
+ assertEquals(EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance(),
+ getArgumentPlusOne.getFunction(null).getReturnType().getType());
+
+ final EdmActionImport resetDataSource = container.getActionImport("ResetDataSource");
+ assertNotNull(resetDataSource);
+ assertTrue(resetDataSource.getAction().getParameterNames().isEmpty());
+ assertNull(resetDataSource.getAction().getReturnType());
+
+ final EdmEntityType computer = metadata.getEntityType(new FullQualifiedName(container.getNamespace(), "Computer"));
+ assertNotNull(computer);
+
+ final EdmFunction getComputer = metadata.getFunction(
+ new FullQualifiedName(container.getNamespace(), "GetComputer"),
+ new FullQualifiedName(container.getNamespace(), computer.getName()),
+ Boolean.FALSE, Arrays.asList(new String[]{"computer"}));
+ assertNotNull(getComputer);
+ assertEquals(computer, getComputer.getParameter("computer").getType());
+ assertEquals(computer, getComputer.getReturnType().getType());
+
+ final EdmAction resetDataSource2 = metadata.getAction(
+ new FullQualifiedName(container.getNamespace(), "ResetDataSource"), null, Boolean.FALSE);
+ assertNotNull(resetDataSource2);
+ }
+
+ @Test
+ public void navigation() {
+ final Edm metadata = getClient().getReader().
+ readMetadata(getClass().getResourceAsStream("metadata.xml"));
+ assertNotNull(metadata);
+
+ final EdmEntityContainer container = metadata.getEntityContainer(
+ new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService", "DefaultContainer"));
+ assertNotNull(container);
+
+ final EdmEntitySet customer = container.getEntitySet("Customer");
+ assertNotNull(customer);
+
+ final EdmBindingTarget order = customer.getRelatedBindingTarget("Orders");
+ assertNotNull(order);
+ assertTrue(order instanceof EdmEntitySet);
+
+ final EdmBindingTarget customerBindingTarget = ((EdmEntitySet) order).getRelatedBindingTarget("Customer");
+ assertEquals(customer.getEntityType().getName(), customerBindingTarget.getEntityType().getName());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ServiceDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ServiceDocumentTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ServiceDocumentTest.java
new file mode 100644
index 0000000..3aba0a8
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/ServiceDocumentTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.v3;
+
+import org.apache.olingo.client.api.ODataV3Client;
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.client.core.AbstractTest;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class ServiceDocumentTest extends AbstractTest {
+
+ @Override
+ protected ODataV3Client getClient() {
+ return v3Client;
+ }
+
+ private String getFileExtension(final ODataFormat format) {
+ return format == ODataFormat.XML ? "xml" : "json";
+ }
+
+ private void parse(final ODataFormat format) {
+ final ODataServiceDocument serviceDocument = getClient().getReader().readServiceDocument(
+ getClass().getResourceAsStream("serviceDocument." + getFileExtension(format)), format);
+ assertNotNull(serviceDocument);
+ assertTrue(serviceDocument.getEntitySetTitles().contains("Persons"));
+ }
+
+ @Test
+ public void json() {
+ parse(ODataFormat.JSON);
+ }
+
+ @Test
+ public void xml() {
+ parse(ODataFormat.XML);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/URIBuilderTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/URIBuilderTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/URIBuilderTest.java
new file mode 100644
index 0000000..b67bea9
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/URIBuilderTest.java
@@ -0,0 +1,131 @@
+/*
+ * 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.v3;
+
+import static org.junit.Assert.assertEquals;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.olingo.client.api.ODataV3Client;
+import org.apache.olingo.client.api.uri.V3URIBuilder;
+import org.apache.olingo.client.core.AbstractTest;
+import org.junit.Test;
+
+public class URIBuilderTest extends AbstractTest {
+
+ private static final String SERVICE_ROOT = "http://host/service";
+
+ @Override
+ protected ODataV3Client getClient() {
+ return v3Client;
+ }
+
+ @Test
+ public void metadata() throws URISyntaxException {
+ final URI uri = getClient().getURIBuilder(SERVICE_ROOT).appendMetadataSegment().build();
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/$metadata").build(), uri);
+ }
+
+ @Test
+ public void entity() throws URISyntaxException {
+ final URI uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("AnEntitySet").
+ appendKeySegment(11).build();
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/AnEntitySet(11)").build(), uri);
+
+ final Map<String, Object> multiKey = new HashMap<String, Object>();
+ multiKey.put("OrderId", -10);
+ multiKey.put("ProductId", -10);
+ V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("OrderLine").appendKeySegment(multiKey).
+ appendPropertySegment("Quantity").appendValueSegment();
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/OrderLine(OrderId=-10,ProductId=-10)/Quantity/$value").build(), uriBuilder.build());
+
+ uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("Customer").appendKeySegment(-10).
+ select("CustomerId", "Name", "Orders").expand("Orders");
+ assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Customer(-10)").
+ addParameter("$select", "CustomerId,Name,Orders").addParameter("$expand", "Orders").build(),
+ uriBuilder.build());
+
+ uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("Customer").appendKeySegment(-10).appendLinksSegment("Orders");
+ assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Customer(-10)/$links/Orders").build(),
+ uriBuilder.build());
+ }
+
+ @Test
+ public void count() throws URISyntaxException {
+ URI uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("Products").count().build();
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Products/$count").build(), uri);
+
+ uri = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("Products").
+ inlineCount(V3URIBuilder.InlineCount.allpages).build();
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/Products").
+ addParameter("$inlinecount", "allpages").build(), uri);
+ }
+
+ @Test
+ public void filter() throws URISyntaxException {
+ final V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).appendEntitySetSegment("AnEntitySet").
+ filter(getClient().getFilterFactory().lt("VIN", 16));
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(SERVICE_ROOT + "/AnEntitySet").
+ addParameter("$filter", "(VIN lt 16)").build(),
+ uriBuilder.build());
+ }
+
+ @Test
+ public void unboundAction() throws URISyntaxException {
+ final V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendOperationCallSegment("ProductsByCategoryId",
+ Collections.<String, Object>singletonMap("categoryId", 2));
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/ProductsByCategoryId(categoryId=2)").build(), uriBuilder.build());
+ }
+
+ @Test
+ public void boundAction() throws URISyntaxException {
+ final V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("Products").appendOperationCallSegment("MostExpensive", null);
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/Products/MostExpensive").build(), uriBuilder.build());
+ }
+
+ @Test
+ public void derived() throws URISyntaxException {
+ final V3URIBuilder uriBuilder = getClient().getURIBuilder(SERVICE_ROOT).
+ appendEntitySetSegment("Customers").appendNavigationSegment("Model").
+ appendDerivedEntityTypeSegment("Namespace.VipCustomer").appendKeySegment(1);
+
+ assertEquals(new org.apache.http.client.utils.URIBuilder(
+ SERVICE_ROOT + "/Customers/Model/Namespace.VipCustomer(1)").build(), uriBuilder.build());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/FilterFactoryTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/FilterFactoryTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/FilterFactoryTest.java
new file mode 100644
index 0000000..1a48be4
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/FilterFactoryTest.java
@@ -0,0 +1,85 @@
+/*
+ * 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.v4;
+
+import org.apache.olingo.client.api.ODataV4Client;
+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.client.core.AbstractTest;
+import org.apache.olingo.client.core.edm.EdmEnumTypeImpl;
+import org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class FilterFactoryTest extends AbstractTest {
+
+ @Override
+ protected ODataV4Client getClient() {
+ return v4Client;
+ }
+
+ private V4FilterFactory getFilterFactory() {
+ return getClient().getFilterFactory();
+ }
+
+ private V4FilterArgFactory getFilterArgFactory() {
+ return getFilterFactory().getArgFactory();
+ }
+
+ @Test
+ public void has() {
+ final EdmEnumType pattern = new EdmEnumTypeImpl(
+ null, new FullQualifiedName("Sales", "Pattern"), new EnumTypeImpl());
+ final URIFilter filter = getFilterFactory().has(getFilterArgFactory().property("style"), pattern, "Yellow");
+
+ assertEquals("(style has Sales.Pattern'Yellow')", filter.build());
+ }
+
+ @Test
+ public void contains() {
+ final URIFilter filter = getFilterFactory().match(
+ getFilterArgFactory().contains(
+ getFilterArgFactory().property("CompanyName"), getFilterArgFactory().literal("Alfreds")));
+
+ assertEquals("contains(CompanyName,'Alfreds')", filter.build());
+ }
+
+ @Test
+ public void maxdatetime() {
+ final URIFilter filter = getFilterFactory().eq(
+ getFilterArgFactory().property("EndTime"),
+ getFilterArgFactory().maxdatetime());
+
+ assertEquals("(EndTime eq maxdatetime())", filter.build());
+ }
+
+ @Test
+ public void any() {
+ final URIFilter filter = getFilterFactory().match(
+ getFilterArgFactory().any(getFilterArgFactory().property("Items"),
+ getFilterFactory().gt("d:d/Quantity", 100)));
+
+ assertEquals("Items/any(d:d/Quantity gt 100)", filter.build());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java
new file mode 100644
index 0000000..f183ff3
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java
@@ -0,0 +1,286 @@
+/*
+ * 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.v4;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.olingo.client.api.ODataV4Client;
+import org.apache.olingo.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.client.api.edm.xml.v4.Annotations;
+import org.apache.olingo.client.api.edm.xml.v4.ComplexType;
+import org.apache.olingo.client.api.edm.xml.v4.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.v4.EntityType;
+import org.apache.olingo.client.api.edm.xml.v4.Function;
+import org.apache.olingo.client.api.edm.xml.v4.FunctionImport;
+import org.apache.olingo.client.api.edm.xml.v4.Schema;
+import org.apache.olingo.client.api.edm.xml.v4.Singleton;
+import org.apache.olingo.client.api.edm.xml.v4.XMLMetadata;
+import org.apache.olingo.client.core.AbstractTest;
+import org.apache.olingo.client.core.edm.xml.v4.annotation.Apply;
+import org.apache.olingo.client.core.edm.xml.v4.annotation.Collection;
+import org.apache.olingo.client.core.edm.xml.v4.annotation.ConstExprConstructImpl;
+import org.apache.olingo.client.core.edm.xml.v4.annotation.Path;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.commons.api.edm.constants.StoreGeneratedPattern;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.junit.Test;
+
+public class MetadataTest extends AbstractTest {
+
+ @Override
+ protected ODataV4Client getClient() {
+ return v4Client;
+ }
+
+ @Test
+ public void parse() {
+ final Edm edm = getClient().getReader().
+ readMetadata(getClass().getResourceAsStream("metadata.xml"));
+ assertNotNull(edm);
+
+ // 1. Enum
+ final EdmEnumType responseEnumType = edm.getEnumType(
+ new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "ResponseType"));
+ assertNotNull(responseEnumType);
+ assertEquals(6, responseEnumType.getMemberNames().size());
+ assertEquals("3", responseEnumType.getMember("Accepted").getValue());
+ assertEquals(EdmTypeKind.ENUM, responseEnumType.getKind());
+
+ // 2. Complex
+ final EdmComplexType responseStatus = edm.getComplexType(
+ new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "ResponseStatus"));
+ assertNotNull(responseStatus);
+ assertTrue(responseStatus.getNavigationPropertyNames().isEmpty());
+ assertEquals("Recipient", responseStatus.getBaseType().getName());
+ assertEquals(EdmPrimitiveTypeKind.DateTimeOffset.getEdmPrimitiveTypeInstance(),
+ responseStatus.getProperty("Time").getType());
+
+ // 3. Entity
+ final EdmEntityType user = edm.getEntityType(
+ new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "User"));
+ assertNotNull(user);
+ final EdmEntityType entity = edm.getEntityType(
+ new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "Entity"));
+ assertEquals(entity, user.getBaseType());
+ assertFalse(user.getPropertyNames().isEmpty());
+ assertFalse(user.getNavigationPropertyNames().isEmpty());
+ final EdmEntityType folder = edm.getEntityType(
+ new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "Folder"));
+ assertEquals(folder, user.getNavigationProperty("Inbox").getType());
+
+ // 4. Action
+ final EdmAction move = edm.getAction(
+ new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "Move"),
+ new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "Folder"),
+ false);
+ assertNotNull(move);
+ assertTrue(move.isBound());
+ assertEquals(2, move.getParameterNames().size());
+ assertEquals(
+ EdmPrimitiveTypeKind.String.getEdmPrimitiveTypeInstance(), move.getParameter("DestinationId").getType());
+
+ // 5. EntityContainer
+ final EdmEntityContainer container = edm.getEntityContainer(
+ new FullQualifiedName("Microsoft.Exchange.Services.OData.Model", "EntityContainer"));
+ assertNotNull(container);
+ final EdmEntitySet users = container.getEntitySet("Users");
+ assertNotNull(users);
+ assertEquals(edm.getEntityType(new FullQualifiedName(container.getNamespace(), "User")),
+ users.getEntityType());
+ assertEquals(container.getEntitySet("Folders"), users.getRelatedBindingTarget("Folders"));
+ }
+
+ @Test
+ public void demo() {
+ final XMLMetadata metadata = getClient().getDeserializer().
+ toMetadata(getClass().getResourceAsStream("demo-metadata.xml"));
+ assertNotNull(metadata);
+
+ assertFalse(metadata.getSchema(0).getAnnotationsList().isEmpty());
+ final Annotations annots = metadata.getSchema(0).getAnnotationsList("ODataDemo.DemoService/Suppliers");
+ assertNotNull(annots);
+ assertFalse(annots.getAnnotations().isEmpty());
+ assertEquals(ConstExprConstructImpl.Type.String,
+ annots.getAnnotation("Org.OData.Publication.V1.PrivacyPolicyUrl").getConstExpr().getType());
+ assertEquals("http://www.odata.org/",
+ annots.getAnnotation("Org.OData.Publication.V1.PrivacyPolicyUrl").getConstExpr().getValue());
+ }
+
+ @Test
+ public void multipleSchemas() {
+ final XMLMetadata metadata = getClient().getDeserializer().
+ toMetadata(getClass().getResourceAsStream("northwind-metadata.xml"));
+ assertNotNull(metadata);
+
+ final Schema first = metadata.getSchema("NorthwindModel");
+ assertNotNull(first);
+
+ final Schema second = metadata.getSchema("ODataWebExperimental.Northwind.Model");
+ assertNotNull(second);
+
+ assertEquals(StoreGeneratedPattern.Identity,
+ first.getEntityType("Category").getProperty("CategoryID").getStoreGeneratedPattern());
+
+ final EntityContainer entityContainer = second.getEntityContainer();
+ assertNotNull(entityContainer);
+ assertEquals("NorthwindEntities", entityContainer.getName());
+ assertTrue(entityContainer.isLazyLoadingEnabled());
+ }
+
+ /**
+ * Tests Example 85 from CSDL specification.
+ */
+ @Test
+ public void fromdoc1() {
+ final XMLMetadata metadata = getClient().getDeserializer().
+ toMetadata(getClass().getResourceAsStream("fromdoc1-metadata.xml"));
+ assertNotNull(metadata);
+
+ assertFalse(metadata.getReferences().isEmpty());
+ assertEquals("Org.OData.Measures.V1", metadata.getReferences().get(1).getIncludes().get(0).getNamespace());
+
+ final EntityType product = metadata.getSchema(0).getEntityType("Product");
+ assertTrue(product.isHasStream());
+ assertEquals("UoM.ISOCurrency", product.getProperty("Price").getAnnotation().getTerm());
+ assertEquals("Products", product.getNavigationProperty("Supplier").getPartner());
+
+ final EntityType category = metadata.getSchema(0).getEntityType("Category");
+ assertNotNull(category);
+
+ final ComplexType address = metadata.getSchema(0).getComplexType("Address");
+ assertFalse(address.getNavigationProperty("Country").getReferentialConstraints().isEmpty());
+ assertEquals("Name",
+ address.getNavigationProperty("Country").getReferentialConstraints().get(0).getReferencedProperty());
+
+ final Function productsByRating = metadata.getSchema(0).getFunctions("ProductsByRating").get(0);
+ assertNotNull(productsByRating.getParameter("Rating"));
+ assertEquals("Edm.Int32", productsByRating.getParameter("Rating").getType());
+ assertEquals("Collection(ODataDemo.Product)", productsByRating.getReturnType().getType());
+
+ final Singleton contoso = metadata.getSchema(0).getEntityContainer().getSingleton("Contoso");
+ assertNotNull(contoso);
+ assertFalse(contoso.getNavigationPropertyBindings().isEmpty());
+ assertEquals("Products", contoso.getNavigationPropertyBindings().get(0).getPath());
+
+ final FunctionImport functionImport = metadata.getSchema(0).getEntityContainer().
+ getFunctionImport("ProductsByRating");
+ assertNotNull(functionImport);
+ assertEquals(metadata.getSchema(0).getNamespace() + "." + productsByRating.getName(),
+ functionImport.getFunction());
+
+ // Now let's go high-level
+ final Edm edm = getClient().getReader().
+ readMetadata(getClass().getResourceAsStream("fromdoc1-metadata.xml"));
+ assertNotNull(edm);
+
+ final EdmFunctionImportInfo fiInfo = edm.getServiceMetadata().getFunctionImportInfos().get(0);
+ final EdmEntityContainer demoService = edm.getEntityContainer(
+ new FullQualifiedName(metadata.getSchema(0).getNamespace(), fiInfo.getEntityContainerName()));
+ assertNotNull(demoService);
+ final EdmFunctionImport fi = demoService.getFunctionImport(fiInfo.getFunctionImportName());
+ assertNotNull(fi);
+ assertEquals(demoService.getEntitySet("Products"), fi.getReturnedEntitySet());
+
+ final EdmFunction function = edm.getFunction(
+ new FullQualifiedName(metadata.getSchema(0).getNamespace(), "ProductsByRating"),
+ null, Boolean.FALSE, null);
+ assertNotNull(function);
+ assertEquals(function.getName(), fi.getFunction(null).getName());
+ assertEquals(function.getNamespace(), fi.getFunction(null).getNamespace());
+ assertEquals(function.getParameterNames(), fi.getFunction(null).getParameterNames());
+ assertEquals(function.getReturnType().getType().getName(),
+ fi.getFunction(null).getReturnType().getType().getName());
+ assertEquals(function.getReturnType().getType().getNamespace(),
+ fi.getFunction(null).getReturnType().getType().getNamespace());
+ }
+
+ /**
+ * Tests Example 86 from CSDL specification.
+ */
+ @Test
+ public void fromdoc2() {
+ final XMLMetadata metadata = getClient().getDeserializer().
+ toMetadata(getClass().getResourceAsStream("fromdoc2-metadata.xml"));
+ assertNotNull(metadata);
+
+ // Check displayName
+ final Annotation displayName = metadata.getSchema(0).getAnnotationsList("ODataDemo.Supplier").
+ getAnnotation("Vocabulary1.DisplayName");
+ assertNotNull(displayName);
+ assertNull(displayName.getConstExpr());
+ assertNotNull(displayName.getDynExpr());
+
+ assertTrue(displayName.getDynExpr() instanceof Apply);
+ final Apply apply = (Apply) displayName.getDynExpr();
+ assertEquals(Apply.CANONICAL_FUNCTION_CONCAT, apply.getFunction());
+ assertEquals(3, apply.getParameters().size());
+
+ final Path firstArg = new Path();
+ firstArg.setValue("Name");
+ assertEquals(firstArg, apply.getParameters().get(0));
+
+ final ConstExprConstructImpl secondArg = new ConstExprConstructImpl();
+ secondArg.setType(ConstExprConstructImpl.Type.String);
+ secondArg.setValue(" in ");
+ assertEquals(secondArg, apply.getParameters().get(1));
+
+ final Path thirdArg = new Path();
+ thirdArg.setValue("Address/CountryName");
+ assertEquals(thirdArg, apply.getParameters().get(2));
+
+ // Check Tags
+ final Annotation tags = metadata.getSchema(0).getAnnotationsList("ODataDemo.Product").
+ getAnnotation("Vocabulary1.Tags");
+ assertNotNull(tags);
+ assertNull(tags.getConstExpr());
+ assertNotNull(tags.getDynExpr());
+
+ assertTrue(tags.getDynExpr() instanceof Collection);
+ final Collection collection = (Collection) tags.getDynExpr();
+ assertEquals(1, collection.getItems().size());
+ assertEquals(ConstExprConstructImpl.Type.String, ((ConstExprConstructImpl) collection.getItems().get(0)).getType());
+ assertEquals("MasterData", ((ConstExprConstructImpl) collection.getItems().get(0)).getValue());
+ }
+
+ /**
+ * Various annotation examples taken from CSDL specification.
+ */
+ @Test
+ public void fromdoc3() {
+ final Edm metadata = getClient().getReader().
+ readMetadata(getClass().getResourceAsStream("fromdoc3-metadata.xml"));
+ assertNotNull(metadata);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java
new file mode 100644
index 0000000..b26bb31
--- /dev/null
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/ServiceDocumentTest.java
@@ -0,0 +1,68 @@
+/*
+ * 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.v4;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URI;
+
+import org.apache.olingo.client.api.ODataV4Client;
+import org.apache.olingo.client.api.domain.ODataServiceDocument;
+import org.apache.olingo.client.api.format.ODataFormat;
+import org.apache.olingo.client.core.AbstractTest;
+import org.junit.Test;
+
+public class ServiceDocumentTest extends AbstractTest {
+
+ @Override
+ protected ODataV4Client getClient() {
+ return v4Client;
+ }
+
+ private String getFileExtension(final ODataFormat format) {
+ return format == ODataFormat.XML ? "xml" : "json";
+ }
+
+ private ODataServiceDocument parse(final ODataFormat format) {
+ final ODataServiceDocument serviceDocument = getClient().getReader().readServiceDocument(
+ getClass().getResourceAsStream("serviceDocument." + getFileExtension(format)), format);
+ assertNotNull(serviceDocument);
+ assertEquals(URI.create("http://host/service/$metadata"), serviceDocument.getMetadataContext());
+ assertTrue(serviceDocument.getEntitySetTitles().contains("Order Details"));
+ assertEquals(URI.create("http://host/service/TopProducts"),
+ serviceDocument.getFunctionImportURI("Best-Selling Products"));
+ assertEquals(URI.create("http://host/HR/"),
+ serviceDocument.getRelatedServiceDocumentsURIs().iterator().next());
+
+ return serviceDocument;
+ }
+
+ @Test
+ public void json() {
+ parse(ODataFormat.JSON);
+ }
+
+ @Test
+ public void xml() {
+ final ODataServiceDocument serviceDocument = parse(ODataFormat.XML);
+ assertEquals("W/\"MjAxMy0wNS0xM1QxNDo1NFo=\"", serviceDocument.getMetadataETag());
+ }
+}
[41/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntitySetImpl.java
new file mode 100644
index 0000000..f344a21
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/EntitySetImpl.java
@@ -0,0 +1,120 @@
+/*
+ * 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.deserializer;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.olingo.client.api.deserializer.Entity;
+import org.apache.olingo.client.api.deserializer.EntitySet;
+
+import com.fasterxml.jackson.core.JsonParseException;
+
+public class EntitySetImpl implements EntitySet, Iterator<Entity> {
+
+ private String odataContext;
+
+ private Long odataCount;
+
+ private String odataNextLink;
+
+ private String odataDeltaLink;
+
+ private List<Entity> entities = null;
+
+ private PropertyCollectionBuilder propertyCollectionsBuilder;
+
+ @Override
+ public String getODataContext() {
+ return odataContext;
+ }
+
+ @Override
+ public Long getODataCount() {
+ return odataCount;
+ }
+
+ @Override
+ public String getODataNextLink() {
+ return odataNextLink;
+ }
+
+ @Override
+ public String getODataDeltaLink() {
+ return odataDeltaLink;
+ }
+
+ public void addAnnotation(final String name, final String value) {
+ if ("odata.context".equalsIgnoreCase(name)) {
+ odataContext = value;
+ } else if ("odata.deltaLink".equalsIgnoreCase(name)) {
+ odataDeltaLink = value;
+ } else if ("odata.count".equalsIgnoreCase(name)) {
+ odataCount = Long.parseLong(value);
+ } else if ("odata.nextLink".equalsIgnoreCase(name)) {
+ odataNextLink = value;
+ }
+ }
+
+ @Override
+ public List<Entity> getEntities() {
+ if (entities == null) {
+ entities = new ArrayList<Entity>();
+
+ while (propertyCollectionsBuilder.parseNext()) {
+ entities.add(propertyCollectionsBuilder.buildEntity());
+ }
+ }
+
+ return entities;
+ }
+
+ public void setPropertyCollectionBuilder(final PropertyCollectionBuilder builder) {
+ propertyCollectionsBuilder = builder;
+ }
+
+ @Override
+ public boolean hasNext() {
+ try {
+ return propertyCollectionsBuilder.hasNext();
+ } catch (JsonParseException e) {
+ } catch (IOException e) {
+ }
+ return false;
+ }
+
+ @Override
+ public Entity next() {
+ if (propertyCollectionsBuilder.parseNext()) {
+ return propertyCollectionsBuilder.buildEntity();
+ }
+ return null;
+ }
+
+ @Override
+ public void remove() {
+ }
+
+ @Override
+ public Iterator<Entity> iterator() {
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/JsonReader.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/JsonReader.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/JsonReader.java
new file mode 100644
index 0000000..105065c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/JsonReader.java
@@ -0,0 +1,89 @@
+/*
+ * 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.deserializer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import org.apache.olingo.client.api.deserializer.ClientException;
+import org.apache.olingo.client.api.deserializer.Entity;
+import org.apache.olingo.client.api.deserializer.EntitySet;
+import org.apache.olingo.client.api.deserializer.Property;
+import org.apache.olingo.client.api.deserializer.Reader;
+import org.apache.olingo.client.api.deserializer.StructuralProperty;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+
+public class JsonReader implements Reader {
+
+ @Override
+ public EntitySet readEntitySet(final InputStream in) throws ClientException {
+
+ final JsonFactory jsonFactory = new JsonFactory();
+ // or, for data binding, org.codehaus.jackson.mapper.MappingJsonFactory
+ try {
+ JsonParser jp = jsonFactory.createParser(in);
+ EntitySetBuilder entitySet = new EntitySetBuilder(jp);
+ return entitySet.buildEntitySet();
+ } catch (JsonParseException e) {
+ throw new ClientException("JSON Parsing failed.", e);
+ } catch (IOException e) {
+ throw new ClientException("JSON Parsing failed.", e);
+ }
+ }
+
+ @Override
+ public Entity readEntity(final InputStream in) throws ClientException {
+ Entity entity = null;
+
+ final JsonFactory jsonFactory = new JsonFactory();
+ // or, for data binding, org.codehaus.jackson.mapper.MappingJsonFactory
+ try {
+ final JsonParser jp = jsonFactory.createParser(in);
+ final PropertyCollectionBuilder builder = new PropertyCollectionBuilder(jp);
+ builder.parseNext();
+ entity = builder.buildEntity();
+ } catch (JsonParseException e) {
+ throw new ClientException("JSON Parsing failed.", e);
+ } catch (IOException e) {
+ throw new ClientException("JSON Parsing failed.", e);
+ }
+
+ return entity;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.olingo.core.consumer.Reader#parseProperty(java.io.InputStream)
+ */
+ @Override
+ public Property readProperty(final InputStream in) throws ClientException {
+ final Entity entity = readEntity(in);
+
+ final Map<String, StructuralProperty> properties = entity.getStructuralProperties();
+ if (properties.size() == 1) {
+ return properties.values().iterator().next();
+ }
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/NavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/NavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/NavigationPropertyImpl.java
new file mode 100644
index 0000000..1c09a90
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/NavigationPropertyImpl.java
@@ -0,0 +1,89 @@
+/*
+ * 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.deserializer;
+
+import org.apache.olingo.client.api.deserializer.NavigationProperty;
+
+public class NavigationPropertyImpl implements NavigationProperty {
+
+ private final String name;
+
+ private String associationLink;
+
+ private String navigationLink;
+
+ public NavigationPropertyImpl(final String name) {
+ this.name = parseName(name);
+ }
+
+ public NavigationPropertyImpl(final String name, final String link) {
+ this(name);
+ updateLink(name, link);
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String getAssociationLink() {
+ return associationLink;
+ }
+
+ @Override
+ public String getNavigationLink() {
+ return navigationLink;
+ }
+
+ public void updateLink(final String name, final String link) {
+ final String regexNavigationLink = ".*@odata.navigationLink$";
+ final String regexAssociationLink = ".*@odata.associationLink$";
+ if (name.matches(regexNavigationLink)) {
+ navigationLink = link;
+ } else if (name.matches(regexAssociationLink)) {
+ associationLink = link;
+ }
+ }
+
+ private String parseName(final String nameToParse) {
+ final String[] split = nameToParse.split("@");
+ if (split.length == 2) {
+ return split[0];
+ } else {
+ throw new IllegalArgumentException("Got OData Navigation with unparseable format '"
+ + nameToParse + "'.");
+ }
+ }
+
+ public void updateLink(final NavigationProperty navigationProperty) {
+ if (navigationProperty.getAssociationLink() != null) {
+ associationLink = navigationProperty.getAssociationLink();
+ }
+ if (navigationProperty.getNavigationLink() != null) {
+ navigationLink = navigationProperty.getNavigationLink();
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "NavigationPropertyImpl [name=" + name + ", associationLink=" + associationLink
+ + ", navigationLink=" + navigationLink + "]";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PrimitiveValue.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PrimitiveValue.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PrimitiveValue.java
new file mode 100644
index 0000000..c28bffa
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PrimitiveValue.java
@@ -0,0 +1,51 @@
+/*
+ * 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.deserializer;
+
+import org.apache.olingo.client.api.deserializer.Value;
+
+public class PrimitiveValue implements Value {
+
+ private final Object content;
+
+ public PrimitiveValue(final Object content) {
+ this.content = content;
+ }
+
+ @Override
+ public boolean isComplex() {
+ return false;
+ }
+
+ @Override
+ public Object getContent() {
+ return content;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getContentAs(final T type) {
+ return (T) content;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(content);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PropertyCollection.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PropertyCollection.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PropertyCollection.java
new file mode 100644
index 0000000..8b10213
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PropertyCollection.java
@@ -0,0 +1,96 @@
+/*
+ * 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.deserializer;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.client.api.deserializer.AnnotationProperty;
+import org.apache.olingo.client.api.deserializer.NavigationProperty;
+import org.apache.olingo.client.api.deserializer.Property;
+import org.apache.olingo.client.api.deserializer.StructuralProperty;
+
+abstract class PropertyCollection {
+
+ protected Map<String, AnnotationProperty> annotationProperties = new HashMap<String, AnnotationProperty>();
+
+ protected Map<String, NavigationProperty> navigationProperties = new HashMap<String, NavigationProperty>();
+
+ protected Map<String, StructuralProperty> structuralProperties = new HashMap<String, StructuralProperty>();
+
+ public PropertyCollection() {
+ }
+
+ protected PropertyCollection(final Map<String, AnnotationProperty> annotationProperties,
+ final Map<String, NavigationProperty> navigationProperties,
+ final Map<String, StructuralProperty> structuralProperties) {
+
+ this.annotationProperties = annotationProperties;
+ this.navigationProperties = navigationProperties;
+ this.structuralProperties = structuralProperties;
+ }
+
+ public List<Property> getProperties() {
+ final int initialCapacity = annotationProperties.size() + navigationProperties.size() + structuralProperties.size();
+
+ final List<Property> properties = new ArrayList<Property>(initialCapacity);
+ properties.addAll(annotationProperties.values());
+ properties.addAll(navigationProperties.values());
+ properties.addAll(structuralProperties.values());
+
+ return properties;
+ }
+
+ public Map<String, AnnotationProperty> getAnnotationProperties() {
+ return Collections.unmodifiableMap(annotationProperties);
+ }
+
+ public Map<String, NavigationProperty> getNavigationProperties() {
+ return Collections.unmodifiableMap(navigationProperties);
+ }
+
+ public Map<String, StructuralProperty> getStructuralProperties() {
+ return Collections.unmodifiableMap(structuralProperties);
+ }
+
+ public void addProperty(final Property property) {
+ if (property == null) {
+ throw new IllegalArgumentException("Property parameter MUST NOT be NULL.");
+ }
+
+ if (property instanceof NavigationPropertyImpl) {
+ final NavigationPropertyImpl navProperty = (NavigationPropertyImpl) navigationProperties.get(property.getName());
+ if (navProperty == null) {
+ navigationProperties.put(property.getName(), (NavigationPropertyImpl) property);
+ } else {
+ final NavigationProperty temp = (NavigationProperty) property;
+ navProperty.updateLink(temp);
+ }
+ } else if (property instanceof AnnotationPropertyImpl) {
+ annotationProperties.put(property.getName(), (AnnotationPropertyImpl) property);
+ } else if (property instanceof StructuralProperty) {
+ structuralProperties.put(property.getName(), (StructuralProperty) property);
+ } else {
+ throw new IllegalArgumentException("Unknown class '" + property.getClass() + "'.");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PropertyCollectionBuilder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PropertyCollectionBuilder.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PropertyCollectionBuilder.java
new file mode 100644
index 0000000..7643e49
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/PropertyCollectionBuilder.java
@@ -0,0 +1,221 @@
+/*
+ * 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.deserializer;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.olingo.client.api.deserializer.AnnotationProperty;
+import org.apache.olingo.client.api.deserializer.ComplexValue;
+import org.apache.olingo.client.api.deserializer.Entity;
+import org.apache.olingo.client.api.deserializer.NavigationProperty;
+import org.apache.olingo.client.api.deserializer.Property;
+import org.apache.olingo.client.api.deserializer.StructuralProperty;
+import org.apache.olingo.client.api.deserializer.Value;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class PropertyCollectionBuilder extends PropertyCollection {
+
+ private static final Logger LOG = LoggerFactory.getLogger(PropertyCollectionBuilder.class);
+
+ private JsonParser parser;
+
+ private EntitySetImpl enclosingEntitySet;
+
+ private PropertyCollectionBuilder next = null;
+
+ public PropertyCollectionBuilder(final JsonParser parser) {
+ this.parser = parser;
+ }
+
+ private PropertyCollectionBuilder() {
+ }
+
+ public PropertyCollectionBuilder(final JsonParser jp, final EntitySetImpl entitySet) {
+ this(jp);
+ enclosingEntitySet = entitySet;
+ }
+
+ public Entity buildEntity() {
+ final Entity entity = new EntityImpl(annotationProperties, navigationProperties, structuralProperties);
+ resetProperties();
+ return entity;
+ }
+
+ public ComplexValue buildComplexValue() {
+ final ComplexValue value = new ComplexValueImpl(annotationProperties, navigationProperties, structuralProperties);
+ resetProperties();
+ return value;
+ }
+
+ private void resetProperties() {
+ annotationProperties = new HashMap<String, AnnotationProperty>();
+ navigationProperties = new HashMap<String, NavigationProperty>();
+ structuralProperties = new HashMap<String, StructuralProperty>();
+ }
+
+ public boolean hasNext() throws JsonParseException, IOException {
+ if (parser.isClosed()) {
+ return false;
+ }
+ next = parseNextObject(parser, this);
+ return (next != null);
+ }
+
+ public boolean parseNext() {
+ try {
+ if (hasNext()) {
+ if (next != null) {
+ return true;
+ }
+
+ if (next == null) {
+ parser.close();
+ return false;
+ }
+ return true;
+ }
+ } catch (JsonParseException e) {
+ LOG.error("While parsing", e);
+ } catch (IOException e) {
+ LOG.error("While parsing", e);
+ }
+ return false;
+
+ }
+
+ /**
+ *
+ * @param jp
+ * @param builder
+ * @return
+ * @throws IOException
+ * @throws JsonParseException
+ */
+ private PropertyCollectionBuilder parseNextObject(final JsonParser jp, final PropertyCollectionBuilder builder)
+ throws JsonParseException, IOException {
+
+ boolean endReached = readToStartObjectOrEnd(jp);
+ if (endReached) {
+ return null;
+ }
+
+ //
+ String currentFieldName = null;
+ List<Value> values = null;
+
+ while (jp.nextToken() != null) {
+ final JsonToken token = jp.getCurrentToken();
+ switch (token) {
+ case START_OBJECT:
+ if (currentFieldName != null) {
+ final ComplexValue cvp = parseNextObject(jp, new PropertyCollectionBuilder()).buildComplexValue();
+ if (values == null) {
+ builder.addProperty(new StructuralPropertyImpl(currentFieldName, cvp));
+ } else {
+ values.add(cvp);
+ }
+ }
+ break;
+ case END_OBJECT:
+ return builder;
+ case START_ARRAY:
+ values = new ArrayList<Value>();
+ break;
+ case END_ARRAY:
+ if (values != null) {
+ builder.addProperty(new StructuralPropertyImpl(currentFieldName, values));
+ values = null;
+ }
+ break;
+ case FIELD_NAME:
+ currentFieldName = jp.getCurrentName();
+ break;
+ case NOT_AVAILABLE:
+ break;
+ case VALUE_EMBEDDED_OBJECT:
+ break;
+ case VALUE_NULL:
+ Property nullProperty = createProperty(jp.getCurrentName(), null);
+ builder.addProperty(nullProperty);
+ break;
+ case VALUE_FALSE:
+ case VALUE_NUMBER_FLOAT:
+ case VALUE_NUMBER_INT:
+ case VALUE_STRING:
+ case VALUE_TRUE:
+ if (values == null) {
+ Property property = createProperty(jp.getCurrentName(), jp.getValueAsString());
+ builder.addProperty(property);
+ } else {
+ PrimitiveValue value = new PrimitiveValue(jp.getValueAsString());
+ values.add(value);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ private boolean readToStartObjectOrEnd(final JsonParser jp) throws IOException, JsonParseException {
+ final JsonToken endToken = JsonToken.START_OBJECT;
+ JsonToken token = jp.getCurrentToken() == null ? jp.nextToken() : jp.getCurrentToken();
+ while (token != null && token != endToken) {
+ if (enclosingEntitySet != null) {
+ switch (token) {
+ case VALUE_FALSE:
+ case VALUE_NUMBER_FLOAT:
+ case VALUE_NUMBER_INT:
+ case VALUE_TRUE:
+ case VALUE_STRING:
+ enclosingEntitySet.addAnnotation(jp.getCurrentName(), jp.getValueAsString());
+ break;
+
+ default:
+ break;
+ }
+ }
+ //
+ token = jp.nextToken();
+ }
+
+ return token == null;
+ }
+
+ private Property createProperty(final String name, final String value) {
+ if (name.contains("@")) {
+ return new NavigationPropertyImpl(name, value);
+ } else if (name.contains(".")) {
+ return new AnnotationPropertyImpl(name, value);
+ } else {
+ return new StructuralPropertyImpl(name, new PrimitiveValue(value));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/StructuralPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/StructuralPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/StructuralPropertyImpl.java
new file mode 100644
index 0000000..59ba264
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/deserializer/StructuralPropertyImpl.java
@@ -0,0 +1,83 @@
+/*
+ * 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.deserializer;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.olingo.client.api.deserializer.StructuralProperty;
+import org.apache.olingo.client.api.deserializer.Value;
+
+public class StructuralPropertyImpl implements StructuralProperty {
+
+ private final List<Value> values;
+
+ private final String name;
+
+ private final boolean containsCollection;
+
+ public StructuralPropertyImpl(final String name, final Value value) {
+ this(name, false, value);
+ }
+
+ public StructuralPropertyImpl(final String name, final List<Value> values) {
+ // XXX: ugly -> refactor
+ this(name, true, values.toArray(new Value[0]));
+ }
+
+ public StructuralPropertyImpl(final String name, final boolean asCollection, final Value... value) {
+ if (value == null || value.length == 0) {
+ throw new IllegalArgumentException("Missing or NULL value argument.");
+ }
+
+ containsCollection = asCollection;
+ this.name = name;
+ values = new ArrayList<Value>(value.length);
+ for (Value v : value) {
+ values.add(v);
+ }
+ }
+
+ @Override
+ public Value getValue() {
+ return values.get(0);
+ }
+
+ @Override
+ public List<Value> getValues() {
+ return Collections.unmodifiableList(values);
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public boolean containsCollection() {
+ return containsCollection;
+ }
+
+ @Override
+ public String toString() {
+ return "StructuralPropertyImpl [name=" + name + ", containsCollection=" + containsCollection
+ + ", values=" + values + "]";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/AbstractEdmServiceMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/AbstractEdmServiceMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/AbstractEdmServiceMetadataImpl.java
new file mode 100644
index 0000000..6508224
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/AbstractEdmServiceMetadataImpl.java
@@ -0,0 +1,99 @@
+/*
+ * 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.edm;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+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.client.api.edm.xml.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.EntitySet;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+import org.apache.olingo.commons.api.edm.EdmActionImportInfo;
+import org.apache.olingo.commons.api.edm.EdmEntitySetInfo;
+import org.apache.olingo.commons.api.edm.EdmFunctionImportInfo;
+import org.apache.olingo.commons.api.edm.EdmServiceMetadata;
+import org.apache.olingo.commons.core.edm.EdmEntitySetInfoImpl;
+
+public abstract class AbstractEdmServiceMetadataImpl implements EdmServiceMetadata {
+
+ protected final XMLMetadata xmlMetadata;
+
+ private List<EdmEntitySetInfo> entitySetInfos;
+
+ protected List<EdmFunctionImportInfo> functionImportInfos;
+
+ protected List<EdmActionImportInfo> actionImportInfos;
+
+ public static EdmServiceMetadata getInstance(final XMLMetadata xmlMetadata) {
+ return xmlMetadata instanceof org.apache.olingo.client.core.edm.xml.v3.XMLMetadataImpl
+ ? new org.apache.olingo.client.core.edm.v3.EdmServiceMetadataImpl(
+ (org.apache.olingo.client.core.edm.xml.v3.XMLMetadataImpl) xmlMetadata)
+ : new org.apache.olingo.client.core.edm.v4.EdmServiceMetadataImpl(
+ (org.apache.olingo.client.core.edm.xml.v4.XMLMetadataImpl) xmlMetadata);
+
+ }
+
+ public AbstractEdmServiceMetadataImpl(final XMLMetadata xmlMetadata) {
+ this.xmlMetadata = xmlMetadata;
+ }
+
+ @Override
+ public InputStream getMetadata() {
+ throw new UnsupportedOperationException("Not supported in client code.");
+ }
+
+ @Override
+ public List<EdmEntitySetInfo> getEntitySetInfos() {
+ synchronized (this) {
+ if (entitySetInfos == null) {
+ entitySetInfos = new ArrayList<EdmEntitySetInfo>();
+ for (Schema schema : xmlMetadata.getSchemas()) {
+ for (EntityContainer entityContainer : schema.getEntityContainers()) {
+ for (EntitySet entitySet : entityContainer.getEntitySets()) {
+ entitySetInfos.add(
+ new EdmEntitySetInfoImpl(entityContainer.getName(), entitySet.getName()));
+ }
+ }
+ }
+ }
+ return entitySetInfos;
+ }
+ }
+
+ @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/client/core/edm/EdmActionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImpl.java
new file mode 100644
index 0000000..acbfce9
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImpl.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.edm;
+
+import org.apache.olingo.client.api.edm.xml.v4.Action;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public class EdmActionImpl extends EdmOperationImpl implements EdmAction {
+
+ public static EdmActionImpl getInstance(final Edm edm, final FullQualifiedName name, final Action action) {
+ return EdmOperationImpl.getInstance(new EdmActionImpl(edm, name, action));
+ }
+
+ private EdmActionImpl(final Edm edm, final FullQualifiedName name, final Action action) {
+ super(edm, name, action, EdmTypeKind.ACTION);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImportImpl.java
new file mode 100644
index 0000000..ad1fb68
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmActionImportImpl.java
@@ -0,0 +1,45 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.v4.ActionImport;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmActionImport;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+
+public class EdmActionImportImpl extends EdmOperationImportImpl implements EdmActionImport {
+
+ private final ActionImport actionImport;
+
+ public EdmActionImportImpl(final Edm edm, final EdmEntityContainer container, final String name,
+ final ActionImport actionImport) {
+
+ super(edm, container, name, actionImport.getEntitySet());
+ this.actionImport = actionImport;
+ }
+
+ @Override
+ public EdmAction getAction() {
+ return edm.getAction(
+ new EdmTypeInfo(actionImport.getAction(), container.getNamespace()).getFullQualifiedName(), null, null);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmBindingTargetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmBindingTargetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmBindingTargetImpl.java
new file mode 100644
index 0000000..6f1990e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmBindingTargetImpl.java
@@ -0,0 +1,79 @@
+/*
+ * 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.edm;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.BindingTarget;
+import org.apache.olingo.client.api.edm.xml.v4.NavigationPropertyBinding;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmBindingTarget;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.Target;
+import org.apache.olingo.commons.core.edm.AbstractEdmBindingTarget;
+
+public abstract class EdmBindingTargetImpl extends AbstractEdmBindingTarget {
+
+ private final BindingTarget target;
+
+ public EdmBindingTargetImpl(final Edm edm, final EdmEntityContainer container,
+ final String name, final FullQualifiedName type, final BindingTarget target) {
+
+ super(edm, container, name, type);
+ this.target = target;
+ }
+
+ @Override
+ public EdmBindingTarget getRelatedBindingTarget(final String path) {
+ EdmBindingTarget bindingTarget = null;
+
+ final List<? extends NavigationPropertyBinding> navigationPropertyBindings = target.getNavigationPropertyBindings();
+ boolean found = false;
+ for (final Iterator<? extends NavigationPropertyBinding> itor = navigationPropertyBindings.iterator();
+ itor.hasNext() && !found;) {
+
+ final NavigationPropertyBinding binding = itor.next();
+ if (binding.getPath().equals(path)) {
+ final Target edmTarget = new Target.Builder(binding.getTarget(), container).build();
+
+ final EdmEntityContainer entityContainer = edm.getEntityContainer(edmTarget.getEntityContainer());
+ if (entityContainer == null) {
+ throw new EdmException("Cannot find entity container with name: " + edmTarget.getEntityContainer());
+ }
+ bindingTarget = entityContainer.getEntitySet(edmTarget.getTargetName());
+ if (bindingTarget == null) {
+ bindingTarget = entityContainer.getSingleton(edmTarget.getTargetName());
+ if (bindingTarget == null) {
+ throw new EdmException("Cannot find target with name: " + edmTarget.getTargetName());
+ }
+
+ found = true;
+ } else {
+ found = true;
+ }
+ }
+ }
+
+ return bindingTarget;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java
new file mode 100644
index 0000000..332e673
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmClientImpl.java
@@ -0,0 +1,371 @@
+/*
+ * 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.edm;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.lang3.StringUtils;
+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.client.api.UnsupportedInV3Exception;
+import org.apache.olingo.client.api.edm.xml.CommonParameter;
+import org.apache.olingo.client.api.edm.xml.ComplexType;
+import org.apache.olingo.client.api.edm.xml.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.EntityType;
+import org.apache.olingo.client.api.edm.xml.EnumType;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.api.edm.xml.v4.Action;
+import org.apache.olingo.client.api.edm.xml.v4.Function;
+import org.apache.olingo.client.api.edm.xml.v4.TypeDefinition;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.client.core.edm.v3.EdmActionProxy;
+import org.apache.olingo.client.core.edm.v3.EdmFunctionProxy;
+import org.apache.olingo.client.core.edm.v3.V3FunctionImportUtils;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmServiceMetadata;
+import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmImpl;
+
+public class EdmClientImpl extends AbstractEdmImpl {
+
+ private final XMLMetadata xmlMetadata;
+
+ private final EdmServiceMetadata serviceMetadata;
+
+ public EdmClientImpl(final XMLMetadata xmlMetadata) {
+ this.xmlMetadata = xmlMetadata;
+ this.serviceMetadata = AbstractEdmServiceMetadataImpl.getInstance(xmlMetadata);
+ }
+
+ public XMLMetadata getXMLMetadata() {
+ return xmlMetadata;
+ }
+
+ @Override
+ protected EdmServiceMetadata createServiceMetadata() {
+ return serviceMetadata;
+ }
+
+ @Override
+ protected Map<String, String> createAliasToNamespaceInfo() {
+ final Map<String, String> aliasToNamespace = new HashMap<String, String>();
+
+ for (Schema schema : xmlMetadata.getSchemas()) {
+ aliasToNamespace.put(null, schema.getNamespace());
+ if (StringUtils.isNotBlank(schema.getAlias())) {
+ aliasToNamespace.put(schema.getAlias(), schema.getNamespace());
+ }
+ }
+
+ return aliasToNamespace;
+ }
+
+ @Override
+ protected EdmEntityContainer createEntityContainer(final FullQualifiedName containerName) {
+ EdmEntityContainer result = null;
+
+ final Schema schema = xmlMetadata.getSchema(containerName.getNamespace());
+ if (schema != null) {
+ final EntityContainer xmlEntityContainer = schema.getDefaultEntityContainer();
+ if (xmlEntityContainer != null) {
+ result = new EdmEntityContainerImpl(this, containerName, xmlEntityContainer, xmlMetadata);
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ protected EdmEnumType createEnumType(final FullQualifiedName enumName) {
+ EdmEnumType result = null;
+
+ final Schema schema = xmlMetadata.getSchema(enumName.getNamespace());
+ if (schema != null) {
+ final EnumType xmlEnumType = schema.getEnumType(enumName.getName());
+ if (xmlEnumType != null) {
+ result = new EdmEnumTypeImpl(this, enumName, xmlEnumType);
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ protected EdmTypeDefinition createTypeDefinition(final FullQualifiedName typeDefinitionName) {
+ EdmTypeDefinition result = null;
+
+ final Schema schema = xmlMetadata.getSchema(typeDefinitionName.getNamespace());
+ if (schema instanceof org.apache.olingo.client.api.edm.xml.v4.Schema) {
+ final TypeDefinition xmlTypeDefinition = ((org.apache.olingo.client.api.edm.xml.v4.Schema) schema).
+ getTypeDefinition(typeDefinitionName.getName());
+ if (xmlTypeDefinition != null) {
+ result = new EdmTypeDefinitionImpl(this, typeDefinitionName, xmlTypeDefinition);
+ }
+ } else {
+ throw new UnsupportedInV3Exception();
+ }
+
+ return result;
+ }
+
+ @Override
+ protected EdmEntityType createEntityType(final FullQualifiedName entityTypeName) {
+ EdmEntityType result = null;
+
+ final Schema schema = xmlMetadata.getSchema(entityTypeName.getNamespace());
+ final EntityType xmlEntityType = schema.getEntityType(entityTypeName.getName());
+ if (xmlEntityType != null) {
+ result = EdmEntityTypeImpl.getInstance(this, entityTypeName, xmlEntityType);
+ }
+
+ return result;
+ }
+
+ @Override
+ protected EdmComplexType createComplexType(final FullQualifiedName complexTypeName) {
+ EdmComplexType result = null;
+
+ final Schema schema = xmlMetadata.getSchema(complexTypeName.getNamespace());
+ final ComplexType xmlComplexType = schema.getComplexType(complexTypeName.getName());
+ if (xmlComplexType != null) {
+ result = EdmComplexTypeImpl.getInstance(this, complexTypeName, xmlComplexType);
+ }
+
+ return result;
+ }
+
+ @Override
+ protected EdmAction createUnboundAction(final FullQualifiedName actionName) {
+ EdmAction result = null;
+
+ final Schema schema = xmlMetadata.getSchema(actionName.getNamespace());
+ if (schema instanceof org.apache.olingo.client.api.edm.xml.v4.Schema) {
+ final List<Action> actions = ((org.apache.olingo.client.api.edm.xml.v4.Schema) schema).
+ getActions(actionName.getName());
+ boolean found = false;
+ for (final Iterator<Action> itor = actions.iterator(); itor.hasNext() && !found;) {
+ final Action action = itor.next();
+ if (!action.isBound()) {
+ found = true;
+ result = EdmActionImpl.getInstance(this, actionName, action);
+ }
+ }
+ } else {
+ for (EntityContainer entityContainer : schema.getEntityContainers()) {
+ @SuppressWarnings("unchecked")
+ final List<FunctionImport> functionImports = (List<FunctionImport>) entityContainer.
+ getFunctionImports(actionName.getName());
+ boolean found = false;
+ for (final Iterator<FunctionImport> itor = functionImports.iterator(); itor.hasNext() && !found;) {
+ final FunctionImport functionImport = itor.next();
+ if (!V3FunctionImportUtils.canProxyFunction(functionImport) && !functionImport.isBindable()) {
+ found = functionImport.getParameters().isEmpty();
+ result = EdmActionProxy.getInstance(this, actionName, functionImport);
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ protected EdmFunction createUnboundFunction(final FullQualifiedName functionName, final List<String> parameterNames) {
+ EdmFunction result = null;
+
+ final Schema schema = xmlMetadata.getSchema(functionName.getNamespace());
+ if (schema instanceof org.apache.olingo.client.api.edm.xml.v4.Schema) {
+ final List<Function> functions = ((org.apache.olingo.client.api.edm.xml.v4.Schema) schema).
+ getFunctions(functionName.getName());
+ boolean found = false;
+ for (final Iterator<Function> itor = functions.iterator(); itor.hasNext() && !found;) {
+ final Function function = itor.next();
+ if (!function.isBound()) {
+ final Set<String> functionParamNames = new HashSet<String>();
+ for (CommonParameter param : function.getParameters()) {
+ functionParamNames.add(param.getName());
+ }
+ found = parameterNames == null
+ ? functionParamNames.isEmpty()
+ : functionParamNames.containsAll(parameterNames);
+ result = EdmFunctionImpl.getInstance(this, functionName, function);
+ }
+ }
+ } else {
+ for (EntityContainer entityContainer : schema.getEntityContainers()) {
+ @SuppressWarnings("unchecked")
+ final List<FunctionImport> functionImports = (List<FunctionImport>) entityContainer.
+ getFunctionImports(functionName.getName());
+ boolean found = false;
+ for (final Iterator<FunctionImport> itor = functionImports.iterator(); itor.hasNext() && !found;) {
+ final FunctionImport functionImport = itor.next();
+ if (V3FunctionImportUtils.canProxyFunction(functionImport) && !functionImport.isBindable()) {
+ final Set<String> functionParamNames = new HashSet<String>();
+ for (CommonParameter param : functionImport.getParameters()) {
+ functionParamNames.add(param.getName());
+ }
+ found = parameterNames == null
+ ? functionParamNames.isEmpty()
+ : functionParamNames.containsAll(parameterNames);
+ result = EdmFunctionProxy.getInstance(this, functionName, functionImport);
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ protected EdmAction createBoundAction(final FullQualifiedName actionName,
+ final FullQualifiedName bindingParameterTypeName, final Boolean isBindingParameterCollection) {
+
+ EdmAction result = null;
+
+ final Schema schema = xmlMetadata.getSchema(actionName.getNamespace());
+ if (schema instanceof org.apache.olingo.client.api.edm.xml.v4.Schema) {
+ final List<Action> actions = ((org.apache.olingo.client.api.edm.xml.v4.Schema) schema).
+ getActions(actionName.getName());
+ boolean found = false;
+ for (final Iterator<Action> itor = actions.iterator(); itor.hasNext() && !found;) {
+ final Action action = itor.next();
+ if (action.isBound()) {
+ final EdmTypeInfo boundParam = new EdmTypeInfo(action.getParameters().get(0).getType());
+ if (bindingParameterTypeName.equals(boundParam.getFullQualifiedName())
+ && isBindingParameterCollection.booleanValue() == boundParam.isCollection()) {
+
+ found = true;
+ result = EdmActionImpl.getInstance(this, actionName, action);
+ }
+ }
+ }
+ } else {
+ for (EntityContainer entityContainer : schema.getEntityContainers()) {
+ @SuppressWarnings("unchecked")
+ final List<FunctionImport> functionImports = (List<FunctionImport>) entityContainer.
+ getFunctionImports(actionName.getName());
+ boolean found = false;
+ for (final Iterator<FunctionImport> itor = functionImports.iterator(); itor.hasNext() && !found;) {
+ final FunctionImport functionImport = itor.next();
+ if (!V3FunctionImportUtils.canProxyFunction(functionImport) && functionImport.isBindable()) {
+ final EdmTypeInfo boundParam = new EdmTypeInfo(functionImport.getParameters().get(0).getType());
+ if (bindingParameterTypeName.equals(boundParam.getFullQualifiedName())
+ && isBindingParameterCollection.booleanValue() == boundParam.isCollection()) {
+
+ found = true;
+ result = EdmActionProxy.getInstance(this, actionName, functionImport);
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ protected EdmFunction createBoundFunction(final FullQualifiedName functionName,
+ final FullQualifiedName bindingParameterTypeName, final Boolean isBindingParameterCollection,
+ final List<String> parameterNames) {
+
+ EdmFunction result = null;
+
+ final Schema schema = xmlMetadata.getSchema(functionName.getNamespace());
+ if (schema instanceof org.apache.olingo.client.api.edm.xml.v4.Schema) {
+ final List<Function> functions = ((org.apache.olingo.client.api.edm.xml.v4.Schema) schema).
+ getFunctions(functionName.getName());
+ boolean found = false;
+ for (final Iterator<Function> itor = functions.iterator(); itor.hasNext() && !found;) {
+ final Function function = itor.next();
+ if (function.isBound()) {
+ final EdmTypeInfo boundParam = new EdmTypeInfo(function.getParameters().get(0).getType());
+ if (bindingParameterTypeName.equals(boundParam.getFullQualifiedName())
+ && isBindingParameterCollection.booleanValue() == boundParam.isCollection()) {
+
+ final Set<String> functionParamNames = new HashSet<String>();
+ for (CommonParameter param : function.getParameters()) {
+ functionParamNames.add(param.getName());
+ }
+ found = parameterNames == null
+ ? functionParamNames.isEmpty()
+ : functionParamNames.containsAll(parameterNames);
+ result = EdmFunctionImpl.getInstance(this, functionName, function);
+ }
+ }
+ }
+ } else {
+ for (EntityContainer entityContainer : schema.getEntityContainers()) {
+ @SuppressWarnings("unchecked")
+ final List<FunctionImport> functionImports = (List<FunctionImport>) entityContainer.
+ getFunctionImports(functionName.getName());
+ boolean found = false;
+ for (final Iterator<FunctionImport> itor = functionImports.iterator(); itor.hasNext() && !found;) {
+ final FunctionImport functionImport = itor.next();
+ if (!V3FunctionImportUtils.canProxyFunction(functionImport) && functionImport.isBindable()) {
+ final EdmTypeInfo boundParam = new EdmTypeInfo(functionImport.getParameters().get(0).getType());
+ if (bindingParameterTypeName.equals(boundParam.getFullQualifiedName())
+ && isBindingParameterCollection.booleanValue() == boundParam.isCollection()) {
+
+ final Set<String> functionParamNames = new HashSet<String>();
+ for (CommonParameter param : functionImport.getParameters()) {
+ functionParamNames.add(param.getName());
+ }
+ found = parameterNames == null
+ ? functionParamNames.isEmpty()
+ : functionParamNames.containsAll(parameterNames);
+ result = EdmFunctionProxy.getInstance(this, functionName, functionImport);
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @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/client/core/edm/EdmComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmComplexTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmComplexTypeImpl.java
new file mode 100644
index 0000000..7f126f9
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmComplexTypeImpl.java
@@ -0,0 +1,68 @@
+/*
+ * 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.edm;
+
+import java.util.Map;
+
+import org.apache.olingo.client.api.edm.xml.ComplexType;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmComplexType;
+import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper;
+
+public class EdmComplexTypeImpl extends AbstractEdmComplexType {
+
+ private final EdmStructuredTypeHelper helper;
+
+ public static EdmComplexTypeImpl getInstance(final Edm edm, final FullQualifiedName fqn,
+ final ComplexType complexType) {
+
+ FullQualifiedName baseTypeName = null;
+ if (complexType instanceof org.apache.olingo.client.api.edm.xml.v4.ComplexType) {
+ final String baseType = ((org.apache.olingo.client.api.edm.xml.v4.ComplexType) complexType).getBaseType();
+ baseTypeName = baseType == null
+ ? null : new EdmTypeInfo(baseType).getFullQualifiedName();
+ }
+ final EdmComplexTypeImpl instance = new EdmComplexTypeImpl(edm, fqn, baseTypeName, complexType);
+ instance.baseType = instance.buildBaseType(baseTypeName);
+
+ return instance;
+ }
+
+ private EdmComplexTypeImpl(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName,
+ final ComplexType complexType) {
+
+ super(edm, fqn, baseTypeName);
+ this.helper = new EdmStructuredTypeHelperImpl(edm, complexType);
+ }
+
+ @Override
+ protected Map<String, EdmProperty> getProperties() {
+ return helper.getProperties();
+ }
+
+ @Override
+ protected Map<String, EdmNavigationProperty> getNavigationProperties() {
+ return helper.getNavigationProperties();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityContainerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityContainerImpl.java
new file mode 100644
index 0000000..fdbbed2
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityContainerImpl.java
@@ -0,0 +1,125 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.UnsupportedInV3Exception;
+import org.apache.olingo.client.api.edm.xml.CommonFunctionImport;
+import org.apache.olingo.client.api.edm.xml.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.EntitySet;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+import org.apache.olingo.client.api.edm.xml.v3.FunctionImport;
+import org.apache.olingo.client.api.edm.xml.v4.ActionImport;
+import org.apache.olingo.client.api.edm.xml.v4.Singleton;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.client.core.edm.v3.EdmActionImportProxy;
+import org.apache.olingo.client.core.edm.v3.EdmEntitySetProxy;
+import org.apache.olingo.client.core.edm.v3.EdmFunctionImportProxy;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmActionImport;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmException;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+import org.apache.olingo.commons.api.edm.EdmSingleton;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmEntityContainer;
+
+public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
+
+ private final EntityContainer xmlEntityContainer;
+
+ private final XMLMetadata xmlMetadata;
+
+ public EdmEntityContainerImpl(final Edm edm, final FullQualifiedName entityContainerName,
+ final EntityContainer xmlEntityContainer, final XMLMetadata xmlMetadata) {
+
+ super(edm, entityContainerName);
+
+ this.xmlEntityContainer = xmlEntityContainer;
+ this.xmlMetadata = xmlMetadata;
+ }
+
+ @Override
+ protected EdmSingleton createSingleton(final String singletonName) {
+ if (!(xmlEntityContainer instanceof org.apache.olingo.client.api.edm.xml.v4.EntityContainer)) {
+ throw new UnsupportedInV3Exception();
+ }
+
+ final Singleton singleton = ((org.apache.olingo.client.api.edm.xml.v4.EntityContainer) xmlEntityContainer).
+ getSingleton(singletonName);
+ if (singleton == null) {
+ throw new EdmException("Singleton named '" + singletonName + "' not found in " + entityContainerName);
+ }
+ return new EdmSingletonImpl(edm, this, singletonName,
+ new EdmTypeInfo(singleton.getEntityType(), entityContainerName.getNamespace()).getFullQualifiedName(),
+ singleton);
+ }
+
+ @Override
+ protected EdmEntitySet createEntitySet(final String entitySetName) {
+ final EntitySet entitySet = xmlEntityContainer.getEntitySet(entitySetName);
+ if (entitySet == null) {
+ throw new EdmException("EntitySet named '" + entitySetName + "' not found in " + entityContainerName);
+ }
+
+ if (entitySet instanceof org.apache.olingo.client.api.edm.xml.v4.EntitySet) {
+ return new EdmEntitySetImpl(edm, this, entitySetName,
+ new EdmTypeInfo(entitySet.getEntityType(), entityContainerName.getNamespace()).getFullQualifiedName(),
+ (org.apache.olingo.client.api.edm.xml.v4.EntitySet) entitySet);
+ } else {
+ return new EdmEntitySetProxy(edm, this, entitySetName,
+ new EdmTypeInfo(entitySet.getEntityType(), entityContainerName.getNamespace()).getFullQualifiedName(),
+ xmlMetadata);
+ }
+ }
+
+ @Override
+ protected EdmActionImport createActionImport(final String actionImportName) {
+ if (xmlEntityContainer instanceof org.apache.olingo.client.api.edm.xml.v4.EntityContainer) {
+ final ActionImport actionImport
+ = ((org.apache.olingo.client.api.edm.xml.v4.EntityContainer) xmlEntityContainer).
+ getActionImport(actionImportName);
+ if (actionImport == null) {
+ throw new EdmException("ActionImport named '" + actionImportName + "' not found in " + entityContainerName);
+ }
+ return new EdmActionImportImpl(edm, this, actionImportName, actionImport);
+ } else {
+ final FunctionImport functionImport = (FunctionImport) xmlEntityContainer.getFunctionImport(actionImportName);
+ if (functionImport == null) {
+ throw new EdmException("FunctionImport named '" + actionImportName + "' not found in " + entityContainerName);
+ }
+ return new EdmActionImportProxy(edm, this, actionImportName, functionImport);
+ }
+ }
+
+ @Override
+ protected EdmFunctionImport createFunctionImport(final String functionImportName) {
+ final CommonFunctionImport functionImport = xmlEntityContainer.getFunctionImport(functionImportName);
+ if (functionImport == null) {
+ throw new EdmException("FunctionImport named '" + functionImportName + "' not found in " + entityContainerName);
+ }
+
+ if (functionImport instanceof org.apache.olingo.client.api.edm.xml.v4.FunctionImport) {
+ return new EdmFunctionImportImpl(edm, this, functionImportName,
+ (org.apache.olingo.client.api.edm.xml.v4.FunctionImport) functionImport);
+ } else {
+ return new EdmFunctionImportProxy(edm, this, functionImportName,
+ (org.apache.olingo.client.api.edm.xml.v3.FunctionImport) functionImport);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntitySetImpl.java
new file mode 100644
index 0000000..3708a45
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntitySetImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.v4.EntitySet;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+
+public class EdmEntitySetImpl extends EdmBindingTargetImpl implements EdmEntitySet {
+
+ public EdmEntitySetImpl(final Edm edm, final EdmEntityContainer container, final String name,
+ final FullQualifiedName type, final EntitySet entitySet) {
+
+ super(edm, container, name, type, entitySet);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityTypeImpl.java
new file mode 100644
index 0000000..218c5cb
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEntityTypeImpl.java
@@ -0,0 +1,80 @@
+/*
+ * 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.edm;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.client.api.edm.xml.EntityType;
+import org.apache.olingo.client.api.edm.xml.PropertyRef;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmEntityType;
+import org.apache.olingo.commons.core.edm.EdmStructuredTypeHelper;
+
+public class EdmEntityTypeImpl extends AbstractEdmEntityType {
+
+ private final EdmStructuredTypeHelper helper;
+
+ public static EdmEntityTypeImpl getInstance(final Edm edm, final FullQualifiedName fqn, final EntityType entityType) {
+ final FullQualifiedName baseTypeName = entityType.getBaseType() == null
+ ? null : new EdmTypeInfo(entityType.getBaseType()).getFullQualifiedName();
+ final EdmEntityTypeImpl instance = new EdmEntityTypeImpl(edm, fqn, baseTypeName, entityType);
+ instance.baseType = instance.buildBaseType(baseTypeName);
+
+ if (instance.baseType == null) {
+ instance.entityBaseType = null;
+
+ final List<EdmKeyPropertyRef> edmKey = new ArrayList<EdmKeyPropertyRef>(
+ entityType.getKey().getPropertyRefs().size());
+ for (PropertyRef ref : entityType.getKey().getPropertyRefs()) {
+ edmKey.add(new EdmKeyPropertyRefImpl(instance, ref));
+ }
+ instance.setEdmKeyPropertyRef(edmKey);
+ } else {
+ instance.entityBaseType = (EdmEntityType) instance.baseType;
+ }
+
+ return instance;
+ }
+
+ private EdmEntityTypeImpl(final Edm edm, final FullQualifiedName fqn, final FullQualifiedName baseTypeName,
+ final EntityType entityType) {
+
+ super(edm, fqn, baseTypeName, entityType.isHasStream());
+ this.helper = new EdmStructuredTypeHelperImpl(edm, entityType);
+ }
+
+ @Override
+ protected Map<String, EdmProperty> getProperties() {
+ return helper.getProperties();
+ }
+
+ @Override
+ protected Map<String, EdmNavigationProperty> getNavigationProperties() {
+ return helper.getNavigationProperties();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEnumTypeImpl.java
new file mode 100644
index 0000000..3260802
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmEnumTypeImpl.java
@@ -0,0 +1,84 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.EnumType;
+import org.apache.olingo.client.api.edm.xml.Member;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmMember;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmEnumType;
+import org.apache.olingo.commons.core.edm.EdmMemberImpl;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+public class EdmEnumTypeImpl extends AbstractEdmEnumType implements EdmEnumType {
+
+ private final EdmPrimitiveType underlyingType;
+
+ private final List<String> memberNames;
+
+ private final Map<String, EdmMember> members;
+
+ public EdmEnumTypeImpl(final Edm edm, final FullQualifiedName fqn, final EnumType xmlEnumType) {
+ super(edm, fqn, xmlEnumType.isFlags());
+
+ if (xmlEnumType.getUnderlyingType() == null) {
+ this.underlyingType = EdmPrimitiveTypeKind.Int32.getEdmPrimitiveTypeInstance();
+ } else {
+ this.underlyingType = EdmPrimitiveTypeKind.fromString(
+ xmlEnumType.getUnderlyingType()).getEdmPrimitiveTypeInstance();
+ // TODO: Should we validate that the underlying type is of byte, sbyte, in16, int32 or int64?
+ }
+
+ final List<? extends Member> xmlMembers = xmlEnumType.getMembers();
+ final List<String> _memberNames = new ArrayList<String>();
+ final Map<String, EdmMember> _members = new LinkedHashMap<String, EdmMember>(xmlMembers.size());
+ for (Member xmlMember : xmlMembers) {
+ _memberNames.add(xmlMember.getName());
+ _members.put(xmlMember.getName(), new EdmMemberImpl(edm, xmlMember.getName(), xmlMember.getValue()));
+ }
+ this.memberNames = Collections.unmodifiableList(_memberNames);
+ this.members = Collections.unmodifiableMap(_members);
+ }
+
+ @Override
+ public EdmPrimitiveType getUnderlyingType() {
+ return underlyingType;
+ }
+
+ @Override
+ public List<String> getMemberNames() {
+ return memberNames;
+ }
+
+ @Override
+ protected Collection<? extends EdmMember> getMembers() {
+ return members.values();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImpl.java
new file mode 100644
index 0000000..d2831fc
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImpl.java
@@ -0,0 +1,44 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.v4.Function;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+public class EdmFunctionImpl extends EdmOperationImpl implements EdmFunction {
+
+ private final Function function;
+
+ public static EdmFunctionImpl getInstance(final Edm edm, final FullQualifiedName name, final Function function) {
+ return EdmOperationImpl.getInstance(new EdmFunctionImpl(edm, name, function));
+ }
+
+ private EdmFunctionImpl(final Edm edm, final FullQualifiedName name, final Function function) {
+ super(edm, name, function, EdmTypeKind.FUNCTION);
+ this.function = function;
+ }
+
+ @Override
+ public boolean isComposable() {
+ return function.isComposable();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImportImpl.java
new file mode 100644
index 0000000..d3004cb
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmFunctionImportImpl.java
@@ -0,0 +1,48 @@
+/*
+ * 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.edm;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.FunctionImport;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+
+public class EdmFunctionImportImpl extends EdmOperationImportImpl implements EdmFunctionImport {
+
+ private final FunctionImport functionImport;
+
+ public EdmFunctionImportImpl(final Edm edm, final EdmEntityContainer container, final String name,
+ final FunctionImport functionImport) {
+
+ super(edm, container, name, functionImport.getEntitySet());
+ this.functionImport = functionImport;
+ }
+
+ @Override
+ public EdmFunction getFunction(final List<String> parameterNames) {
+ return edm.getFunction(
+ new EdmTypeInfo(functionImport.getFunction(), container.getNamespace()).getFullQualifiedName(),
+ null, null, parameterNames);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmKeyPropertyRefImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmKeyPropertyRefImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmKeyPropertyRefImpl.java
new file mode 100644
index 0000000..a44b4c5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmKeyPropertyRefImpl.java
@@ -0,0 +1,49 @@
+/*
+ * 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.edm;
+
+import org.apache.olingo.client.api.edm.xml.PropertyRef;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.core.edm.AbstractEdmKeyPropertyRef;
+
+public class EdmKeyPropertyRefImpl extends AbstractEdmKeyPropertyRef {
+
+ private final PropertyRef propertyRef;
+
+ public EdmKeyPropertyRefImpl(final EdmEntityType edmEntityType, final PropertyRef propertyRef) {
+ super(edmEntityType);
+ this.propertyRef = propertyRef;
+ }
+
+ @Override
+ public String getKeyPropertyName() {
+ return propertyRef.getName();
+ }
+
+ @Override
+ public String getAlias() {
+ return propertyRef.getAlias();
+ }
+
+ @Override
+ public String getPath() {
+ throw new UnsupportedOperationException("Not supported in client code.");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmNavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmNavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmNavigationPropertyImpl.java
new file mode 100644
index 0000000..cab0297
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/EdmNavigationPropertyImpl.java
@@ -0,0 +1,75 @@
+/*
+ * 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.edm;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.v4.NavigationProperty;
+import org.apache.olingo.client.api.edm.xml.v4.ReferentialConstraint;
+import org.apache.olingo.client.api.utils.EdmTypeInfo;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.core.edm.AbstractEdmNavigationProperty;
+
+public class EdmNavigationPropertyImpl extends AbstractEdmNavigationProperty {
+
+ private final NavigationProperty navigationProperty;
+
+ private final EdmTypeInfo edmTypeInfo;
+
+ public EdmNavigationPropertyImpl(final Edm edm, final NavigationProperty navigationProperty) {
+ super(edm, navigationProperty.getName());
+ this.navigationProperty = navigationProperty;
+ this.edmTypeInfo = new EdmTypeInfo(navigationProperty.getType());
+ }
+
+ @Override
+ protected FullQualifiedName getTypeFQN() {
+ return edmTypeInfo.getFullQualifiedName();
+ }
+
+ @Override
+ protected String internatGetPartner() {
+ return navigationProperty.getPartner();
+ }
+
+ @Override
+ public boolean isCollection() {
+ return edmTypeInfo.isCollection();
+ }
+
+ @Override
+ public Boolean isNullable() {
+ return navigationProperty.isNullable();
+ }
+
+ @Override
+ public String getReferencingPropertyName(final String referencedPropertyName) {
+ final List<? extends ReferentialConstraint> referentialConstraints = navigationProperty.getReferentialConstraints();
+ if (referentialConstraints != null) {
+ for (ReferentialConstraint constraint : referentialConstraints) {
+ if (constraint.getReferencedProperty().equals(referencedPropertyName)) {
+ return constraint.getProperty();
+ }
+ }
+ }
+ return null;
+ }
+
+}
[06/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceCount.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceCount.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceCount.java
deleted file mode 100644
index 96dc65a..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceCount.java
+++ /dev/null
@@ -1,27 +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.server.api.uri;
-
-/**
- * Used to describe an $count used within an resource path
- * For example: http://.../serviceroot/entityset(1)/$count
- */
-public interface UriResourceCount extends UriResource {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceEntitySet.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceEntitySet.java
deleted file mode 100644
index 8521e06..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceEntitySet.java
+++ /dev/null
@@ -1,58 +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.server.api.uri;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-
-/**
- * Used to describe an entity set used within an resource path
- * For example: http://.../serviceroot/entityset(1)
- */
-public interface UriResourceEntitySet extends UriResourcePartTyped {
-
- /**
- * @return Entity set used in the resource path
- */
- EdmEntitySet getEntitySet();
-
- /**
- * @return Type of the entity set
- */
- EdmEntityType getEntityType();
-
- /**
- * @return Key predicates if used, otherwise null
- */
- List<UriParameter> getKeyPredicates();
-
- /**
- * @return Type filter before key predicates if used, otherwise null
- */
- EdmType getTypeFilterOnCollection();
-
- /**
- * @return Type filter behind key predicates if used, otherwise null
- */
- EdmType getTypeFilterOnEntry();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceFunction.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceFunction.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceFunction.java
deleted file mode 100644
index 12df004..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceFunction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.server.api.uri;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
-import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-
-/**
- * Used to describe an function import or bound function used within an resource path
- * For example: http://.../serviceroot/functionImport(P1=1,P2='A')
- */
-public interface UriResourceFunction extends UriResourcePartTyped {
-
- /**
- * @return Function used in the resource path
- */
- EdmFunction getFunction();
-
- /**
- * Convenience method which returns the {@link EdmFunctionImport} which was used in
- * the resource path to define the {@link EdmFunction}.
- * @return
- */
- EdmFunctionImport getFunctionImport();
-
- /**
- * @return Key predicates if used, otherwise null
- */
- List<UriParameter> getKeyPredicates();
-
-
- /**
- * @return List of function parameters
- */
- List<UriParameter> getParameters();
-
- /**
- * @return Type filter before key predicates if used, otherwise null
- */
- EdmType getTypeFilterOnCollection();
-
- /**
- * @return Type filter behind key predicates if used, otherwise null
- */
- EdmType getTypeFilterOnEntry();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceIt.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceIt.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceIt.java
deleted file mode 100644
index 55a1dec..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceIt.java
+++ /dev/null
@@ -1,38 +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.server.api.uri;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-
-/**
- * Class indicating the $it reference. $it may be used within expression to
- * refer to the last EDM object referenced in the resource path.
- */
-public interface UriResourceIt extends UriResourcePartTyped {
-
- /**
- * @return Type filter if $it refers to a collection
- */
- EdmType getTypeFilterOnCollection();
-
- /**
- * @return Type filter if $it refers to a single entry
- */
- EdmType getTypeFilterOnEntry();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceKind.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceKind.java
deleted file mode 100644
index ff25808..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceKind.java
+++ /dev/null
@@ -1,115 +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.server.api.uri;
-
-/**
- * Defining the various resource part types
- */
-public enum UriResourceKind {
-
- /**
- * Class: {@link UriResourceAction}<br>
- * URI: http://.../serviceroot/action()
- */
- action,
-
- /**
- * Class: {@link UriResourceComplexProperty}<br>
- * URI: http://.../serviceroot/entityset(1)/complexproperty()
- */
- complexProperty,
-
- /**
- * Class: {@link UriResourceCount}<br>
- * URI: http://.../serviceroot/entityset/$count
- */
- count,
-
- /**
- * Class: {@link UriResourceEntitySet}<br>
- * URI: http://.../serviceroot/entityset
- */
- entitySet,
-
- /**
- * Class: {@link UriResourceFunction}<br>
- * URI: http://.../serviceroot/functionimport(P1=1,P2='a')
- */
- function,
-
- /**
- * Class: {@link UriResourceIt}<br>
- * URI: http://.../serviceroot/entityset?$filter=$it/property
- */
- it,
-
- /**
- * Class: {@link UriResourceLambdaAll}<br>
- * URI: http://.../serviceroot/entityset/all(...)
- */
- lambdaAll,
-
- /**
- * Class: {@link UriResourceLambdaAny}<br>
- * URI: http://.../serviceroot/entityset/any(...)
- */
- lambdaAny,
-
- /**
- * Class: {@link UriResourceLambdaVariable}<br>
- * URI: http://.../serviceroot/entityset/listofstring/any(d: 'string' eq d)
- */
- lambdaVariable,
-
- /**
- * Class: {@link UriResourceNavigation}<br>
- * URI: http://.../serviceroot/entityset(1)/navProperty
- */
- navigationProperty,
-
- /**
- * Class: {@link UriResourceRef}<br>
- * URI: http://.../serviceroot/entityset/$ref
- */
- ref,
-
- /**
- * Class: {@link UriResourceRoot}<br>
- * URI: http://.../serviceroot/entityset(1)?$filter=property eq $root/singleton/configstring
- */
- root,
-
- /**
- * Class: {@link UriResourceProperty}<br>
- * URI: http://.../serviceroot/entityset(1)/property
- */
- primitiveProperty,
-
- /**
- * Class: {@link UriResourceSingleton}<br>
- * URI: http://.../serviceroot/singleton
- */
- singleton,
-
- /**
- * Class: {@link UriResourceValue}<br>
- * URI: http://.../serviceroot/entityset(1)/property/$value
- */
- value,
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaAll.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaAll.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaAll.java
deleted file mode 100644
index 5630b37..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaAll.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.server.api.uri;
-
-import org.apache.olingo.odata4.server.api.uri.queryoption.expression.Expression;
-
-/**
- * Used to describe an all lambda expression used within an resource path
- * For example: http://.../serviceroot/entityset/all(...)
- */
-public interface UriResourceLambdaAll extends UriResourcePartTyped {
-
- /**
- * @return Name of the lambda variable
- */
- public String getLambdaVariable();
-
- /**
- * @return Lambda expression
- */
- public Expression getExpression();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaAny.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaAny.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaAny.java
deleted file mode 100644
index 007cc7b..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaAny.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.server.api.uri;
-
-import org.apache.olingo.odata4.server.api.uri.queryoption.expression.Expression;
-
-/**
- * Used to describe an any lambda expression used within an resource path
- * For example: http://.../serviceroot/entityset/any(...)
- */
-public interface UriResourceLambdaAny extends UriResourcePartTyped {
-
- /**
- * @return Name of the lambda variable
- */
- public String getLamdaVariable();
-
- /**
- * @return Lambda expression
- */
- public Expression getExpression();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaVariable.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaVariable.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaVariable.java
deleted file mode 100644
index dd71877..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceLambdaVariable.java
+++ /dev/null
@@ -1,33 +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.server.api.uri;
-
-/**
- * Used to describe an lambda variable used within an resource path
- * For example: http://.../serviceroot/entityset/listofstring/any(d: 'string' eq d)
- */
-public interface UriResourceLambdaVariable extends UriResourcePartTyped {
-
-
- /**
- * @return Name of the lambda variable
- */
- public String getVariableName();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceNavigation.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceNavigation.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceNavigation.java
deleted file mode 100644
index 0d349f5..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceNavigation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.server.api.uri;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-
-/**
- * Used to describe an navigation property used within an resource path
- * For example: http://.../serviceroot/entityset(1)/navProperty
- */
-public interface UriResourceNavigation extends UriResourcePartTyped {
-
- /**
- * @return Navigation property
- */
- EdmNavigationProperty getProperty();
-
- /**
- * @return Key predicates if used, otherwise null
- */
- List<UriParameter> getKeyPredicates();
-
- /**
- * @return Type filter before key predicates if used, otherwise null
- */
- EdmType getTypeFilterOnCollection();
-
- /**
- * @return Type filter behind key predicates if used, otherwise null
- */
- EdmType getTypeFilterOnEntry();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourcePartTyped.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourcePartTyped.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourcePartTyped.java
deleted file mode 100644
index c43e8c6..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourcePartTyped.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.server.api.uri;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-
-/**
- * Used to describe an typed resource part (super interface)
- */
-public interface UriResourcePartTyped extends UriResource {
-
- /**
- * @return Type of the resource part
- */
- EdmType getType();
-
- /**
- * @return True if the resource part is a collection, otherwise false
- */
- boolean isCollection();
-
- /**
- * @return String representation of the type
- */
- String toString(boolean includeFilters);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourcePrimitiveProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourcePrimitiveProperty.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourcePrimitiveProperty.java
deleted file mode 100644
index ce35335..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourcePrimitiveProperty.java
+++ /dev/null
@@ -1,27 +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.server.api.uri;
-
-/**
- * Used to describe an primitive property used within an resource path
- * For example: http://.../serviceroot/entityset(1)/property
- */
-public interface UriResourcePrimitiveProperty extends UriResourceProperty {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceProperty.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceProperty.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceProperty.java
deleted file mode 100644
index c73f979..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceProperty.java
+++ /dev/null
@@ -1,33 +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.server.api.uri;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
-
-/**
- * Used to describe an resource part which is an property (super interface)
- */
-public interface UriResourceProperty extends UriResourcePartTyped {
-
- /**
- * @return Property used in the resource path
- */
- EdmProperty getProperty();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceRef.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceRef.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceRef.java
deleted file mode 100644
index 2d7a5ea..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceRef.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.server.api.uri;
-
-
-/**
- * Used to describe an $ref used within an resource path
- * For example: http://.../serviceroot/entityset/$ref
- */
-public interface UriResourceRef extends UriResource {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceRoot.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceRoot.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceRoot.java
deleted file mode 100644
index 3962824..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceRoot.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.server.api.uri;
-
-/**
- * Class indicating the $root reference. $root may be used within expressions to
- * refer to the current OData service
- * For example: http://.../serviceroot/entityset(1)?$filter=property eq $root/singleton/configstring
- */
-public interface UriResourceRoot extends UriResource {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceSingleton.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceSingleton.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceSingleton.java
deleted file mode 100644
index 0cbdb49..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceSingleton.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.server.api.uri;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
-import org.apache.olingo.odata4.commons.api.edm.EdmSingleton;
-
-/**
- * Used to describe an entity set used within an resource path
- * For example: http://.../serviceroot/singleton
- */
-public interface UriResourceSingleton extends UriResourcePartTyped {
-
- /**
- * @return Singleton used in the resource path
- */
- EdmSingleton getSingleton();
-
- /**
- * @return Type of the Singleton
- */
- EdmEntityType getEntityType();
-
-
- /**
- * @return Type filter
- */
- EdmEntityType getEntityTypeFilter();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceValue.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceValue.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceValue.java
deleted file mode 100644
index 4a6ede6..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceValue.java
+++ /dev/null
@@ -1,27 +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.server.api.uri;
-
-/**
- * Used to describe an $value used within an resource path
- * For example: http://.../serviceroot/entityset(1)/property/$value
- */
-public interface UriResourceValue extends UriResource {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/AliasQueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/AliasQueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/AliasQueryOption.java
deleted file mode 100644
index 4788b18..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/AliasQueryOption.java
+++ /dev/null
@@ -1,27 +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.server.api.uri.queryoption;
-
-import org.apache.olingo.odata4.server.api.uri.queryoption.expression.Expression;
-
-public interface AliasQueryOption extends QueryOption {
-
- public Expression getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CountOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CountOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CountOption.java
deleted file mode 100644
index 5223070..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CountOption.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption;
-
-public interface CountOption extends SystemQueryOption {
-
- boolean getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CustomQueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CustomQueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CustomQueryOption.java
deleted file mode 100644
index 16e4e15..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CustomQueryOption.java
+++ /dev/null
@@ -1,23 +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.server.api.uri.queryoption;
-
-public interface CustomQueryOption extends QueryOption {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExceptionVisitExpand.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExceptionVisitExpand.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExceptionVisitExpand.java
deleted file mode 100644
index d41c5d6..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExceptionVisitExpand.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption;
-
-public class ExceptionVisitExpand extends Exception {
-
- private static final long serialVersionUID = 1L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandItem.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandItem.java
deleted file mode 100644
index cb1b720..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandItem.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.server.api.uri.queryoption;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.server.api.uri.UriInfoResource;
-
-public interface ExpandItem {
-
- LevelsExpandOption getLevelsOption();
-
- FilterOption getFilterOption();
-
- SearchOption getSearchOption();
-
- OrderByOption getOrderByOption();
-
- SkipOption getSkipOption();
-
- TopOption getTopOption();
-
- CountOption getInlineCountOption();
-
- SelectOption getSelectOption();
-
- ExpandOption getExpandOption();
-
- UriInfoResource getResourcePath();
-
- boolean isStar();
-
- boolean isRef();
-
- EdmType getStartTypeFilter();
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandOption.java
deleted file mode 100644
index f1544c8..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandOption.java
+++ /dev/null
@@ -1,27 +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.server.api.uri.queryoption;
-
-import java.util.List;
-
-public interface ExpandOption extends SystemQueryOption {
-
- List<ExpandItem> getExpandItems();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/FilterOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/FilterOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/FilterOption.java
deleted file mode 100644
index 6b5186d..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/FilterOption.java
+++ /dev/null
@@ -1,26 +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.server.api.uri.queryoption;
-
-import org.apache.olingo.odata4.server.api.uri.queryoption.expression.Expression;
-
-public interface FilterOption extends SystemQueryOption {
-
- Expression getExpression();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/FormatOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/FormatOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/FormatOption.java
deleted file mode 100644
index 84ba04f..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/FormatOption.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption;
-
-public interface FormatOption extends SystemQueryOption {
-
- // TODO planned: define best representation for format to enable plugging in custom formats
- String getFormat();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/IdOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/IdOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/IdOption.java
deleted file mode 100644
index a7b3ac0..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/IdOption.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption;
-
-public interface IdOption extends SystemQueryOption {
-
- String getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/LevelsExpandOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/LevelsExpandOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/LevelsExpandOption.java
deleted file mode 100644
index b52d93b..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/LevelsExpandOption.java
+++ /dev/null
@@ -1,27 +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.server.api.uri.queryoption;
-
-public interface LevelsExpandOption {
-
- boolean isMax();
-
- int getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/OrderByItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/OrderByItem.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/OrderByItem.java
deleted file mode 100644
index b4e6bdf..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/OrderByItem.java
+++ /dev/null
@@ -1,33 +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.server.api.uri.queryoption;
-
-import org.apache.olingo.odata4.server.api.uri.queryoption.expression.Expression;
-
-public interface OrderByItem {
-
- /**
- * Returns the sort order of the orderBy item
- * @return if false (default) the sort order is ascending, if true the sort order is descending
- */
- boolean isDescending();
-
- Expression getExpression();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/OrderByOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/OrderByOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/OrderByOption.java
deleted file mode 100644
index 667c2f4..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/OrderByOption.java
+++ /dev/null
@@ -1,27 +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.server.api.uri.queryoption;
-
-import java.util.List;
-
-public interface OrderByOption extends SystemQueryOption {
-
- List<OrderByItem> getOrders();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/QueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/QueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/QueryOption.java
deleted file mode 100644
index d8771a5..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/QueryOption.java
+++ /dev/null
@@ -1,27 +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.server.api.uri.queryoption;
-
-public interface QueryOption {
-
- public String getName();
-
- public String getText();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SearchOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SearchOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SearchOption.java
deleted file mode 100644
index c1be7be..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SearchOption.java
+++ /dev/null
@@ -1,27 +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.server.api.uri.queryoption;
-
-import org.apache.olingo.odata4.server.api.uri.queryoption.search.SearchExpression;
-
-public interface SearchOption extends SystemQueryOption {
-
- SearchExpression getSearchExpression();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectItem.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectItem.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectItem.java
deleted file mode 100644
index 196fa39..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectItem.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.server.api.uri.queryoption;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.odata4.server.api.uri.UriInfoResource;
-
-public interface SelectItem {
-
- boolean isStar();
-
- boolean isAllOperationsInSchema();
-
- FullQualifiedName getAllOperationsInSchemaNameSpace();
-
- UriInfoResource getResourcePath();
-
- EdmType getStartTypeFilter();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectOption.java
deleted file mode 100644
index b8b5d12..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectOption.java
+++ /dev/null
@@ -1,27 +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.server.api.uri.queryoption;
-
-import java.util.List;
-
-public interface SelectOption extends SystemQueryOption {
-
- List<SelectItem> getSelectItems();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SkipOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SkipOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SkipOption.java
deleted file mode 100644
index 14745ad..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SkipOption.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption;
-
-public interface SkipOption extends SystemQueryOption {
-
- String getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SkipTokenOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SkipTokenOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SkipTokenOption.java
deleted file mode 100644
index 057f5c5..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SkipTokenOption.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption;
-
-public interface SkipTokenOption extends SystemQueryOption {
-
- String getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SupportedQueryOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SupportedQueryOptions.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SupportedQueryOptions.java
deleted file mode 100644
index 63ddf11..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SupportedQueryOptions.java
+++ /dev/null
@@ -1,45 +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.server.api.uri.queryoption;
-
-public enum SupportedQueryOptions {
- FILTER("$filter"),
- FORMAT("$format"),
- EXPAND("$expand"),
- ID("$id"),
- COUNT("$count"),
- ORDERBY("$orderby"),
- SEARCH("$search"),
- SELECT("$select"),
- SKIP("$skip"),
- SKIPTOKEN("$skiptoken"),
- TOP("$top"),
- LEVELS("$level");
-
- String syntax;
-
- private SupportedQueryOptions(final String syntax) {
- this.syntax = syntax;
- }
-
- @Override
- public String toString() {
- return syntax;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SystemQueryOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SystemQueryOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SystemQueryOption.java
deleted file mode 100644
index 8ce1a90..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SystemQueryOption.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption;
-
-public interface SystemQueryOption extends QueryOption {
-
- SupportedQueryOptions getKind();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/TopOption.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/TopOption.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/TopOption.java
deleted file mode 100644
index df3e257..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/TopOption.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption;
-
-public interface TopOption extends SystemQueryOption {
-
- String getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/AliasExpression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/AliasExpression.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/AliasExpression.java
deleted file mode 100644
index 665f7b1..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/AliasExpression.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption.expression;
-
-public interface AliasExpression extends Expression {
-
- public String getParameterName();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/BinaryExpression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/BinaryExpression.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/BinaryExpression.java
deleted file mode 100644
index ae1f1ac..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/BinaryExpression.java
+++ /dev/null
@@ -1,29 +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.server.api.uri.queryoption.expression;
-
-public interface BinaryExpression extends Expression {
-
- public BinaryOperatorKind getOperator();
-
- public Expression getLeftOperand();
-
- public Expression getRightOperand();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/BinaryOperatorKind.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/BinaryOperatorKind.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/BinaryOperatorKind.java
deleted file mode 100644
index 8ec781c..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/BinaryOperatorKind.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.server.api.uri.queryoption.expression;
-
-
-public enum BinaryOperatorKind {
-
- // enum
- HAS("has"),
- // multiplicative
- MUL("mul"), DIV("div"), MOD("mod"),
- // additive
- ADD("add"), SUB("sub"),
- // comparism
- GT("gt"), GE("ge"), LT("lt"), LE("le"),
- // equality
- EQ("eq"), NE("ne"),
- // and/or
- AND("and"), OR("or");
-
- private String syntax;
-
- private BinaryOperatorKind(final String syntax) {
- this.syntax = syntax;
- }
-
- public static BinaryOperatorKind get(final String operator) {
- for (BinaryOperatorKind op : BinaryOperatorKind.values()) {
- if (op.toString().equals(operator)) {
- return op;
- }
- }
- return null;
- }
-
- @Override
- public String toString() {
- return syntax;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Enumeration.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Enumeration.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Enumeration.java
deleted file mode 100644
index eebf14d..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Enumeration.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.server.api.uri.queryoption.expression;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-
-public interface Enumeration extends Expression {
-
- public List<String> getValues();
-
- public EdmEnumType getType();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Expression.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Expression.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Expression.java
deleted file mode 100644
index 7f5ee2e..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Expression.java
+++ /dev/null
@@ -1,23 +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.server.api.uri.queryoption.expression;
-
-public interface Expression extends VisitableExression {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/ExpressionVisitException.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/ExpressionVisitException.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/ExpressionVisitException.java
deleted file mode 100644
index 34926a7..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/ExpressionVisitException.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption.expression;
-
-public class ExpressionVisitException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/ExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/ExpressionVisitor.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/ExpressionVisitor.java
deleted file mode 100644
index d4bfc9f..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/ExpressionVisitor.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.server.api.uri.queryoption.expression;
-
-import java.util.List;
-
-import org.apache.olingo.odata4.commons.api.ODataApplicationException;
-import org.apache.olingo.odata4.commons.api.edm.EdmEnumType;
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.server.api.uri.UriInfoResource;
-
-public interface ExpressionVisitor<T> {
-
- T visitBinaryOperator(BinaryOperatorKind operator, T left, T right)
- throws ExpressionVisitException, ODataApplicationException;
-
- T visitUnaryOperator(UnaryOperatorKind operator, T operand)
- throws ExpressionVisitException, ODataApplicationException;
-
-
- T visitMethodCall(MethodCallKind methodCall, List<T> parameters)
- throws ExpressionVisitException, ODataApplicationException;
-
-
- T visitLambdaExpression(String functionText, String variableText, Expression expression)
- throws ExpressionVisitException, ODataApplicationException;
-
- T visitLiteral(String literal) throws ExpressionVisitException, ODataApplicationException;
-
- T visitMember(UriInfoResource member) throws ExpressionVisitException, ODataApplicationException;
-
- T visitAlias(String referenceName) throws ExpressionVisitException, ODataApplicationException;
-
- T visitTypeLiteral(EdmType type) throws ExpressionVisitException, ODataApplicationException;
-
- T visitLambdaReference(String variableText) throws ExpressionVisitException, ODataApplicationException;
-
- T visitEnum(EdmEnumType type, List<String> enumValues) throws ExpressionVisitException, ODataApplicationException;
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/LambdaRef.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/LambdaRef.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/LambdaRef.java
deleted file mode 100644
index cfeeaab..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/LambdaRef.java
+++ /dev/null
@@ -1,25 +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.server.api.uri.queryoption.expression;
-
-public interface LambdaRef extends Expression {
-
- public String getVariableName();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Literal.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Literal.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Literal.java
deleted file mode 100644
index e83e375..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Literal.java
+++ /dev/null
@@ -1,29 +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.server.api.uri.queryoption.expression;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-
-public interface Literal extends Expression {
-
- public String getText();
-
- public EdmType getType();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Member.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Member.java b/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Member.java
deleted file mode 100644
index f0f0423..0000000
--- a/lib/server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Member.java
+++ /dev/null
@@ -1,36 +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.server.api.uri.queryoption.expression;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-import org.apache.olingo.odata4.server.api.uri.UriInfoResource;
-
-public interface Member extends Expression {
-
- public UriInfoResource getResourcePath();
-
- public EdmType getType();
- public EdmType getStartTypeFilter();
-
- public boolean isCollection();
-
-
-
-
-}
[45/51] [abbrv] [partial] [OLINGO-192] rename java packages
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataGeospatialValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataGeospatialValue.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataGeospatialValue.java
deleted file mode 100644
index 2115b8a..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataGeospatialValue.java
+++ /dev/null
@@ -1,486 +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.api.domain;
-
-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.apache.olingo.odata4.client.api.Constants;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.domain.geospatial.Geospatial;
-import org.apache.olingo.odata4.client.api.domain.geospatial.GeospatialCollection;
-import org.apache.olingo.odata4.client.api.domain.geospatial.LineString;
-import org.apache.olingo.odata4.client.api.domain.geospatial.MultiLineString;
-import org.apache.olingo.odata4.client.api.domain.geospatial.MultiPoint;
-import org.apache.olingo.odata4.client.api.domain.geospatial.MultiPolygon;
-import org.apache.olingo.odata4.client.api.domain.geospatial.Point;
-import org.apache.olingo.odata4.client.api.domain.geospatial.Polygon;
-import org.apache.olingo.odata4.client.api.utils.XMLUtils;
-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(Constants.ELEM_POS)));
- }
-
- private Polygon parsePolygon(final Element element) {
- List<Point> extPoints = null;
- final Element exterior
- = (Element) element.getElementsByTagName(Constants.ELEM_POLYGON_EXTERIOR).item(0);
- if (exterior != null) {
- extPoints = parsePoints(
- ((Element) exterior.getElementsByTagName(Constants.ELEM_POLYGON_LINEARRING).item(0)).
- getElementsByTagName(Constants.ELEM_POS));
- }
- List<Point> intPoints = null;
- final Element interior
- = (Element) element.getElementsByTagName(Constants.ELEM_POLYGON_INTERIOR).item(0);
- if (interior != null) {
- intPoints = parsePoints(
- ((Element) interior.getElementsByTagName(Constants.ELEM_POLYGON_LINEARRING).item(0)).
- getElementsByTagName(Constants.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(Constants.ELEM_POS)).get(0);
- break;
-
- case GeographyMultiPoint:
- case GeometryMultiPoint:
- final Element pMembs
- = (Element) tree.getElementsByTagName(Constants.ELEM_POINTMEMBERS).item(0);
- final List<Point> points = pMembs == null
- ? Collections.<Point>emptyList()
- : parsePoints(pMembs.getElementsByTagName(Constants.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(Constants.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(Constants.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(Constants.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(Constants.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(Constants.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(Constants.NS_GML, Constants.ELEM_POS);
- pos.appendChild(parent.getOwnerDocument().createTextNode(
- Double.toString(point.getX()) + " " + point.getY()));
-
- final Element appendable;
- if (wrap) {
- final Element epoint = parent.getOwnerDocument().
- createElementNS(Constants.NS_GML, Constants.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(Constants.NS_GML, Constants.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(
- Constants.NS_GML, Constants.ELEM_POLYGON);
- parent.appendChild(ePolygon);
- appendable = ePolygon;
- } else {
- appendable = parent;
- }
-
- if (!polygon.getExterior().isEmpty()) {
- final Element exterior = parent.getOwnerDocument().createElementNS(
- Constants.NS_GML, Constants.ELEM_POLYGON_EXTERIOR);
- appendable.appendChild(exterior);
- final Element linearRing = parent.getOwnerDocument().createElementNS(
- Constants.NS_GML, Constants.ELEM_POLYGON_LINEARRING);
- exterior.appendChild(linearRing);
-
- parsePoints(linearRing, polygon.getExterior().iterator(), false);
- }
- if (!polygon.getInterior().isEmpty()) {
- final Element interior = parent.getOwnerDocument().createElementNS(
- Constants.NS_GML, Constants.ELEM_POLYGON_INTERIOR);
- appendable.appendChild(interior);
- final Element linearRing = parent.getOwnerDocument().createElementNS(
- Constants.NS_GML, Constants.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(Constants.NS_GML, Constants.ELEM_POINT);
-
- parsePoints(tree, Collections.singleton((Point) value).iterator(), false);
- break;
-
- case GeometryMultiPoint:
- case GeographyMultiPoint:
- tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_MULTIPOINT);
-
- final Element pMembs = doc.createElementNS(Constants.NS_GML, Constants.ELEM_POINTMEMBERS);
- tree.appendChild(pMembs);
-
- parsePoints(pMembs, ((MultiPoint) value).iterator(), true);
- break;
-
- case GeometryLineString:
- case GeographyLineString:
- tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_LINESTRING);
-
- parseLineStrings(tree, Collections.singleton((LineString) value).iterator(), false);
- break;
-
- case GeometryMultiLineString:
- case GeographyMultiLineString:
- tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_MULTILINESTRING);
-
- final Element mlMembs
- = doc.createElementNS(Constants.NS_GML, Constants.ELEM_LINESTRINGMEMBERS);
- tree.appendChild(mlMembs);
-
- parseLineStrings(mlMembs, ((MultiLineString) value).iterator(), true);
- break;
-
- case GeographyPolygon:
- case GeometryPolygon:
- tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_POLYGON);
- parsePolygons(tree, Collections.singleton(((Polygon) value)).iterator(), false);
- break;
-
- case GeographyMultiPolygon:
- case GeometryMultiPolygon:
- tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_MULTIPOLYGON);
-
- final Element mpMembs
- = doc.createElementNS(Constants.NS_GML, Constants.ELEM_SURFACEMEMBERS);
- tree.appendChild(mpMembs);
-
- parsePolygons(mpMembs, ((MultiPolygon) value).iterator(), true);
- break;
-
- case GeographyCollection:
- case GeometryCollection:
- tree = doc.createElementNS(Constants.NS_GML, Constants.ELEM_GEOCOLLECTION);
-
- final Element gMembs
- = doc.createElementNS(Constants.NS_GML, Constants.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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataInvokeResult.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataInvokeResult.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataInvokeResult.java
deleted file mode 100644
index f28e5dd..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/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 org.apache.olingo.odata4.client.api.domain;
-
-/**
- * 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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataPrimitiveValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataPrimitiveValue.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataPrimitiveValue.java
deleted file mode 100644
index 05da80a..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataPrimitiveValue.java
+++ /dev/null
@@ -1,376 +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.api.domain;
-
-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;
-import org.apache.olingo.odata4.client.api.ODataClient;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-import org.apache.olingo.odata4.client.api.domain.ODataDuration;
-import org.apache.olingo.odata4.client.api.domain.ODataTimestamp;
-import org.apache.olingo.odata4.client.api.domain.ODataValue;
-
-/**
- * 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.getServiceVersion())) {
- 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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataProperty.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataProperty.java
deleted file mode 100644
index 5aa9acd..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/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 org.apache.olingo.odata4.client.api.domain;
-
-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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataServiceDocument.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataServiceDocument.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataServiceDocument.java
deleted file mode 100644
index f16852b..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/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 org.apache.olingo.odata4.client.api.domain;
-
-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);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataTimestamp.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataTimestamp.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataTimestamp.java
deleted file mode 100644
index 32ef10e..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataTimestamp.java
+++ /dev/null
@@ -1,138 +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.api.domain;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-
-/**
- * Helper class for handling datetime and datetime-offset primitive values.
- */
-public final class ODataTimestamp implements Serializable {
-
- private static final long serialVersionUID = 4053990618660356004L;
-
- private final SimpleDateFormat sdf;
-
- private final Timestamp timestamp;
-
- private String timezone;
-
- private final boolean offset;
-
- public static ODataTimestamp getInstance(final EdmSimpleType type, final Timestamp timestamp) {
- return new ODataTimestamp(new SimpleDateFormat(type.pattern()),
- new Date(timestamp.getTime()), timestamp.getNanos(), type == EdmSimpleType.DateTimeOffset);
- }
-
- public static ODataTimestamp parse(final EdmSimpleType type, final String input) {
- final ODataTimestamp instance;
-
- final String[] dateParts = input.split("\\.");
- final SimpleDateFormat sdf = new SimpleDateFormat(type.pattern());
- final boolean isOffset = type == EdmSimpleType.DateTimeOffset;
-
- try {
- final Date date = sdf.parse(dateParts[0]);
- if (dateParts.length > 1) {
- int idx = dateParts[1].indexOf('+');
- if (idx == -1) {
- idx = dateParts[1].indexOf('-');
- }
- if (idx == -1) {
- instance = new ODataTimestamp(sdf, date, Integer.parseInt(dateParts[1]), isOffset);
- } else {
- instance = new ODataTimestamp(sdf, date,
- Integer.parseInt(dateParts[1].substring(0, idx)), dateParts[1].substring(idx), isOffset);
- }
- } else {
- instance = new ODataTimestamp(sdf, date, isOffset);
- }
- } catch (Exception e) {
- throw new IllegalArgumentException("Cannot parse " + type.pattern(), e);
- }
-
- return instance;
- }
-
- private ODataTimestamp(final SimpleDateFormat sdf, final Date date, final boolean offset) {
- this.sdf = sdf;
- this.timestamp = new Timestamp(date.getTime());
- this.offset = offset;
- }
-
- private ODataTimestamp(final SimpleDateFormat sdf, final Date date, final int nanos, final boolean offset) {
- this(sdf, date, offset);
- this.timestamp.setNanos(nanos);
- }
-
- private ODataTimestamp(
- final SimpleDateFormat sdf, final Date date, final int nanos, final String timezone, final boolean offset) {
- this(sdf, date, nanos, offset);
- this.timezone = timezone;
- }
-
- public Timestamp getTimestamp() {
- return timestamp;
- }
-
- public String getTimezone() {
- return timezone;
- }
-
- public boolean isOffset() {
- return offset;
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public boolean equals(final Object obj) {
- return EqualsBuilder.reflectionEquals(this, obj, "sdf");
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this, "sdf");
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public String toString() {
- final StringBuilder formatted = new StringBuilder().append(sdf.format(timestamp));
- if (timestamp.getNanos() > 0) {
- formatted.append('.').append(String.valueOf(timestamp.getNanos()));
- }
- if (StringUtils.isNotBlank(timezone)) {
- formatted.append(timezone);
- }
- return formatted.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataValue.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataValue.java
deleted file mode 100644
index 2978ffa..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/ODataValue.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 org.apache.olingo.odata4.client.api.domain;
-
-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;
-
-/**
- * Abstract representation of an OData entity property value.
- */
-public abstract class ODataValue implements Serializable {
-
- private static final long serialVersionUID = 7445422004232581877L;
-
- /**
- * Check is is a primitive value.
- *
- * @return 'TRUE' if primitive; 'FALSE' otherwise.
- */
- public boolean isPrimitive() {
- return (this instanceof ODataPrimitiveValue);
- }
-
- /**
- * Casts to primitive value.
- *
- * @return primitive value.
- */
- public ODataPrimitiveValue asPrimitive() {
- return isPrimitive() ? (ODataPrimitiveValue) this : null;
- }
-
- /**
- * Check is is a complex value.
- *
- * @return 'TRUE' if complex; 'FALSE' otherwise.
- */
- public boolean isComplex() {
- return (this instanceof ODataComplexValue);
- }
-
- /**
- * Casts to complex value.
- *
- * @return complex value.
- */
- public ODataComplexValue asComplex() {
- return isComplex() ? (ODataComplexValue) this : null;
- }
-
- /**
- * Check is is a collection value.
- *
- * @return 'TRUE' if collection; 'FALSE' otherwise.
- */
- public boolean isCollection() {
- return (this instanceof ODataCollectionValue);
- }
-
- /**
- * Casts to collection value.
- *
- * @return collection value.
- */
- public ODataCollectionValue asCollection() {
- return isCollection() ? (ODataCollectionValue) this : 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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/ComposedGeospatial.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/ComposedGeospatial.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/ComposedGeospatial.java
deleted file mode 100644
index bdff17c..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/ComposedGeospatial.java
+++ /dev/null
@@ -1,75 +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.api.domain.geospatial;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Abstract base class for all Geometries that are composed out of other geospatial elements.
- */
-public abstract class ComposedGeospatial<T extends Geospatial> extends Geospatial implements Iterable<T> {
-
- private static final long serialVersionUID = 8796254901098541307L;
-
- protected final List<T> geospatials;
-
- /**
- * Constructor.
- *
- * @param dimension dimension.
- * @param type type.
- * @param geospatials geospatials info.
- */
- protected ComposedGeospatial(final Dimension dimension, final Type type, final List<T> geospatials) {
- super(dimension, type);
- this.geospatials = new ArrayList<T>();
- if (geospatials != null) {
- this.geospatials.addAll(geospatials);
- }
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public Iterator<T> iterator() {
- return this.geospatials.iterator();
- }
-
- /**
- * Checks if is empty.
- *
- * @return 'TRUE' if is empty; 'FALSE' otherwise.
- */
- public boolean isEmpty() {
- return geospatials.isEmpty();
- }
-
- /**
- * {@inheritDoc }
- */
- @Override
- public void setSrid(final Integer srid) {
- for (Geospatial geospatial : this.geospatials) {
- geospatial.setSrid(srid);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Geospatial.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Geospatial.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Geospatial.java
deleted file mode 100644
index 47f830b..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Geospatial.java
+++ /dev/null
@@ -1,156 +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.api.domain.geospatial;
-
-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;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-
-/**
- * Base class for all geospatial info.
- */
-public abstract class Geospatial implements Serializable {
-
- public enum Dimension {
-
- GEOMETRY,
- GEOGRAPHY;
-
- }
-
- public enum Type {
-
- /**
- * The OGIS geometry type number for points.
- */
- POINT,
- /**
- * The OGIS geometry type number for lines.
- */
- LINESTRING,
- /**
- * The OGIS geometry type number for polygons.
- */
- POLYGON,
- /**
- * The OGIS geometry type number for aggregate points.
- */
- MULTIPOINT,
- /**
- * The OGIS geometry type number for aggregate lines.
- */
- MULTILINESTRING,
- /**
- * The OGIS geometry type number for aggregate polygons.
- */
- MULTIPOLYGON,
- /**
- * The OGIS geometry type number for feature collections.
- */
- GEOSPATIALCOLLECTION;
-
- }
-
- protected final Dimension dimension;
-
- protected final Type type;
-
- /**
- * Null value means it is expected to vary per instance.
- */
- protected Integer srid;
-
- /**
- * Constructor.
- *
- * @param dimension dimension.
- * @param type type.
- */
- protected Geospatial(final Dimension dimension, final Type type) {
- this.dimension = dimension;
- this.type = type;
- }
-
- /**
- * Gets dimension.
- *
- * @return dimension.
- * @see Dimension
- */
- public Dimension getDimension() {
- return dimension;
- }
-
- /**
- * Gets type.
- *
- * @return type.
- * @see Type
- */
- public Type getType() {
- return type;
- }
-
- /**
- * Gets s-rid.
- *
- * @return s-rid.
- */
- public Integer getSrid() {
- return srid;
- }
-
- /**
- * Sets s-rid.
- *
- * @param srid s-rid.
- */
- public void setSrid(final Integer srid) {
- this.srid = srid;
- }
-
- public abstract EdmSimpleType getEdmSimpleType();
-
- /**
- * {@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/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/GeospatialCollection.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/GeospatialCollection.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/GeospatialCollection.java
deleted file mode 100644
index 732d5a2..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/GeospatialCollection.java
+++ /dev/null
@@ -1,47 +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.api.domain.geospatial;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-
-/**
- * Wrapper for a collection of geospatials info.
- */
-public class GeospatialCollection extends ComposedGeospatial<Geospatial> {
-
- private static final long serialVersionUID = -9181547636133878977L;
-
- /**
- * Constructor.
- *
- * @param dimension dimension.
- * @param geospatials geospatials info.
- */
- public GeospatialCollection(final Dimension dimension, final List<Geospatial> geospatials) {
- super(dimension, Type.GEOSPATIALCOLLECTION, geospatials);
- }
-
- @Override
- public EdmSimpleType getEdmSimpleType() {
- return dimension == Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyCollection
- : EdmSimpleType.GeometryCollection;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/LineString.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/LineString.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/LineString.java
deleted file mode 100644
index 8b8c6ac..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/LineString.java
+++ /dev/null
@@ -1,38 +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.api.domain.geospatial;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-
-public class LineString extends ComposedGeospatial<Point> {
-
- private static final long serialVersionUID = 3207958185407535907L;
-
- public LineString(final Dimension dimension, final List<Point> points) {
- super(dimension, Type.LINESTRING, points);
- }
-
- @Override
- public EdmSimpleType getEdmSimpleType() {
- return dimension == Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyLineString
- : EdmSimpleType.GeometryLineString;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiLineString.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiLineString.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiLineString.java
deleted file mode 100644
index b849ecb..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiLineString.java
+++ /dev/null
@@ -1,38 +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.api.domain.geospatial;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-
-public class MultiLineString extends ComposedGeospatial<LineString> {
-
- private static final long serialVersionUID = -5042414471218124125L;
-
- public MultiLineString(final Dimension dimension, final List<LineString> lineStrings) {
- super(dimension, Type.MULTILINESTRING, lineStrings);
- }
-
- @Override
- public EdmSimpleType getEdmSimpleType() {
- return dimension == Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyMultiLineString
- : EdmSimpleType.GeometryMultiLineString;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiPoint.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiPoint.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiPoint.java
deleted file mode 100644
index 6b68aea..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiPoint.java
+++ /dev/null
@@ -1,38 +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.api.domain.geospatial;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-
-public class MultiPoint extends ComposedGeospatial<Point> {
-
- private static final long serialVersionUID = 4951011255142116129L;
-
- public MultiPoint(final Dimension dimension, final List<Point> points) {
- super(dimension, Type.MULTIPOINT, points);
- }
-
- @Override
- public EdmSimpleType getEdmSimpleType() {
- return dimension == Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyMultiPoint
- : EdmSimpleType.GeometryMultiPoint;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiPolygon.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiPolygon.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiPolygon.java
deleted file mode 100644
index a20286b..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/MultiPolygon.java
+++ /dev/null
@@ -1,38 +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.api.domain.geospatial;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-
-public class MultiPolygon extends ComposedGeospatial<Polygon> {
-
- private static final long serialVersionUID = -160184788048512883L;
-
- public MultiPolygon(final Dimension dimension, final List<Polygon> polygons) {
- super(dimension, Type.MULTIPOLYGON, polygons);
- }
-
- @Override
- public EdmSimpleType getEdmSimpleType() {
- return dimension == Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyMultiPolygon
- : EdmSimpleType.GeometryMultiPolygon;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Point.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Point.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Point.java
deleted file mode 100644
index 13948fb..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Point.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.domain.geospatial;
-
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-
-public class Point extends Geospatial {
-
- private static final long serialVersionUID = 4917380107331557828L;
-
- /**
- * The X coordinate of the point. In most long/lat systems, this is the longitude.
- */
- private double x;
-
- /**
- * The Y coordinate of the point. In most long/lat systems, this is the latitude.
- */
- private double y;
-
- /**
- * The Z coordinate of the point. In most long/lat systems, this is a radius from the center of the earth, or the
- * height / elevation over the ground.
- */
- private double z;
-
- public Point(final Dimension dimension) {
- super(dimension, Type.POINT);
- }
-
- public double getX() {
- return x;
- }
-
- public void setX(double x) {
- this.x = x;
- }
-
- public double getY() {
- return y;
- }
-
- public void setY(double y) {
- this.y = y;
- }
-
- public double getZ() {
- return z;
- }
-
- public void setZ(double z) {
- this.z = z;
- }
-
- @Override
- public EdmSimpleType getEdmSimpleType() {
- return dimension == Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyPoint
- : EdmSimpleType.GeometryPoint;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Polygon.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Polygon.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Polygon.java
deleted file mode 100644
index 87159cb..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/domain/geospatial/Polygon.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 org.apache.olingo.odata4.client.api.domain.geospatial;
-
-import java.util.List;
-import org.apache.olingo.odata4.client.api.domain.EdmSimpleType;
-
-/**
- * Polygon.
- */
-public class Polygon extends Geospatial {
-
- private static final long serialVersionUID = 7797602503445391678L;
-
- final ComposedGeospatial<Point> interior;
-
- final ComposedGeospatial<Point> exterior;
-
- /**
- * Constructor.
- *
- * @param dimension dimension.
- * @param interior interior points.
- * @param exterior exterior points.
- */
- public Polygon(final Dimension dimension, final List<Point> interior, final List<Point> exterior) {
- super(dimension, Type.POLYGON);
- this.interior = new MultiPoint(dimension, interior);
- this.exterior = new MultiPoint(dimension, exterior);
- }
-
- /**
- * Gest interior points.
- *
- * @return interior points.
- */
- public ComposedGeospatial<Point> getInterior() {
- return interior;
- }
-
- /**
- * Gets exterior points.
- *
- * @return exterior points.I
- */
- public ComposedGeospatial<Point> getExterior() {
- return exterior;
- }
-
- @Override
- public EdmSimpleType getEdmSimpleType() {
- return dimension == Dimension.GEOGRAPHY
- ? EdmSimpleType.GeographyPolygon
- : EdmSimpleType.GeometryPolygon;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonAnnotations.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonAnnotations.java
deleted file mode 100644
index ddee303..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonAnnotations.java
+++ /dev/null
@@ -1,26 +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.api.edm.xml;
-
-public abstract interface CommonAnnotations {
-
- String getTarget();
-
- String getQualifier();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonFunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonFunctionImport.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonFunctionImport.java
deleted file mode 100644
index dcbd325..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonFunctionImport.java
+++ /dev/null
@@ -1,22 +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.api.edm.xml;
-
-public interface CommonFunctionImport extends Named {
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonNavigationProperty.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonNavigationProperty.java
deleted file mode 100644
index 9e6dd99..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonNavigationProperty.java
+++ /dev/null
@@ -1,22 +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.api.edm.xml;
-
-public interface CommonNavigationProperty extends Named {
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonParameter.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonParameter.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonParameter.java
deleted file mode 100644
index 30aef72..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonParameter.java
+++ /dev/null
@@ -1,33 +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.api.edm.xml;
-
-public interface CommonParameter extends Named {
-
- String getType();
-
- boolean isNullable();
-
- Integer getMaxLength();
-
- Integer getPrecision();
-
- Integer getScale();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonProperty.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonProperty.java
deleted file mode 100644
index 7f51af7..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/CommonProperty.java
+++ /dev/null
@@ -1,49 +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.api.edm.xml;
-
-import org.apache.olingo.odata4.commons.api.edm.constants.ConcurrencyMode;
-import org.apache.olingo.odata4.commons.api.edm.constants.StoreGeneratedPattern;
-
-public interface CommonProperty extends Named {
-
- String getType();
-
- boolean isNullable();
-
- String getDefaultValue();
-
- Integer getMaxLength();
-
- boolean isFixedLength();
-
- Integer getPrecision();
-
- Integer getScale();
-
- boolean isUnicode();
-
- String getCollation();
-
- String getSrid();
-
- ConcurrencyMode getConcurrencyMode();
-
- StoreGeneratedPattern getStoreGeneratedPattern();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/ComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/ComplexType.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/ComplexType.java
deleted file mode 100644
index 0c67599..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/ComplexType.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.api.edm.xml;
-
-import java.util.List;
-
-public interface ComplexType extends Named {
-
- CommonProperty getProperty(String name);
-
- List<? extends CommonProperty> getProperties();
-
- CommonNavigationProperty getNavigationProperty(String name);
-
- List<? extends CommonNavigationProperty> getNavigationProperties();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/DataServices.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/DataServices.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/DataServices.java
deleted file mode 100644
index f05c352..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/DataServices.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 org.apache.olingo.odata4.client.api.edm.xml;
-
-import java.util.List;
-
-public interface DataServices {
-
- String getDataServiceVersion();
-
- String getMaxDataServiceVersion();
-
- List<? extends Schema> getSchemas();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Edmx.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Edmx.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Edmx.java
deleted file mode 100644
index 0ab3d7a..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/Edmx.java
+++ /dev/null
@@ -1,26 +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.api.edm.xml;
-
-public interface Edmx {
-
- String getVersion();
-
- DataServices getDataServices();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityContainer.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityContainer.java
deleted file mode 100644
index 53f7e09..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityContainer.java
+++ /dev/null
@@ -1,40 +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.api.edm.xml;
-
-import java.util.List;
-
-public interface EntityContainer extends Named {
-
- String getExtends();
-
- boolean isLazyLoadingEnabled();
-
- boolean isDefaultEntityContainer();
-
- EntitySet getEntitySet(String name);
-
- List<? extends EntitySet> getEntitySets();
-
- CommonFunctionImport getFunctionImport(String name);
-
- List<? extends CommonFunctionImport> getFunctionImports(String name);
-
- List<? extends CommonFunctionImport> getFunctionImports();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityKey.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityKey.java b/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityKey.java
deleted file mode 100644
index cc3ab6e..0000000
--- a/lib/client-api/src/main/java/org/apache/olingo/odata4/client/api/edm/xml/EntityKey.java
+++ /dev/null
@@ -1,26 +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.api.edm.xml;
-
-import java.util.List;
-
-public interface EntityKey {
-
- List<PropertyRef> getPropertyRefs();
-}