You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/03/07 10:08:52 UTC
[03/57] [abbrv] [OLINGO-169] First huge import from ODataJClient: for
the moment,
it just build (no tests yet) and dummy Edm interfaces are used instead of the
ones from commons-api
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AbstractAnnotatedEdmItem.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AbstractAnnotatedEdmItem.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AbstractAnnotatedEdmItem.java
new file mode 100644
index 0000000..365cdeb
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AbstractAnnotatedEdmItem.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractEdmItem;
+
+public abstract class AbstractAnnotatedEdmItem extends AbstractEdmItem implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = -8859729466090997718L;
+
+ @JsonProperty("Annotation")
+ private Annotation annotation;
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionDeserializer.java
new file mode 100644
index 0000000..d106aba
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionDeserializer.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.odata4.client.core.edm.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.data.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.getCodec().readValue(jp, ParameterImpl.class));
+ } else if ("ReturnType".equals(jp.getCurrentName())) {
+ action.setReturnType(parseReturnType(jp, "Action"));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ action.setAnnotation(jp.getCodec().readValue(jp, AnnotationImpl.class));
+ }
+ }
+ }
+
+ return action;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionImpl.java
new file mode 100644
index 0000000..0bfe85c
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.v4.Action;
+
+@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<ParameterImpl> parameters = new ArrayList<ParameterImpl>();
+
+ private ReturnTypeImpl returnType;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public boolean isBound() {
+ return bound;
+ }
+
+ public void setBound(final boolean bound) {
+ this.bound = bound;
+ }
+
+ public String getEntitySetPath() {
+ return entitySetPath;
+ }
+
+ public void setEntitySetPath(final String entitySetPath) {
+ this.entitySetPath = entitySetPath;
+ }
+
+ public List<ParameterImpl> getParameters() {
+ return parameters;
+ }
+
+ public ParameterImpl getParameter(final String name) {
+ ParameterImpl result = null;
+ for (ParameterImpl parameter : getParameters()) {
+ if (name.equals(parameter.getName())) {
+ result = parameter;
+ }
+ }
+ return result;
+ }
+
+ public ReturnTypeImpl getReturnType() {
+ return returnType;
+ }
+
+ public void setReturnType(final ReturnTypeImpl returnType) {
+ this.returnType = returnType;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionImportImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionImportImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionImportImpl.java
new file mode 100644
index 0000000..3d4f496
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ActionImportImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ActionImportImpl extends AbstractAnnotatedEdmItem {
+
+ 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;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public String getAction() {
+ return action;
+ }
+
+ public void setAction(final String action) {
+ this.action = action;
+ }
+
+ 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/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotatedEdmItem.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotatedEdmItem.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotatedEdmItem.java
new file mode 100644
index 0000000..c0b64b7
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotatedEdmItem.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.odata4.client.core.edm.v4;
+
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+
+public interface AnnotatedEdmItem {
+
+ Annotation getAnnotation();
+
+ void setAnnotation(Annotation annotation);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationDeserializer.java
new file mode 100644
index 0000000..a5399ab
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationDeserializer.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.odata4.client.core.edm.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.data.impl.AbstractEdmDeserializer;
+import org.apache.olingo.odata4.client.core.edm.v4.annotation.DynExprConstruct;
+
+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.getCodec().readValue(jp, DynExprConstruct.class));
+ }
+ }
+ }
+
+ return annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationImpl.java
new file mode 100644
index 0000000..21d94f5
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractEdmItem;
+import org.apache.olingo.odata4.client.core.edm.v4.annotation.ConstExprConstruct;
+import org.apache.olingo.odata4.client.core.edm.v4.annotation.DynExprConstruct;
+
+@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;
+
+ public String getTerm() {
+ return term;
+ }
+
+ public void setTerm(final String term) {
+ this.term = term;
+ }
+
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public void setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ }
+
+ public ConstExprConstruct getConstExpr() {
+ return constExpr;
+ }
+
+ public void setConstExpr(final ConstExprConstruct constExpr) {
+ this.constExpr = constExpr;
+ }
+
+ 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/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationsDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationsDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationsDeserializer.java
new file mode 100644
index 0000000..49dc359
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationsDeserializer.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.odata4.client.core.edm.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.data.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.getCodec().readValue(jp, AnnotationImpl.class));
+ }
+ }
+ }
+
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationsImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationsImpl.java
new file mode 100644
index 0000000..186b5d4
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/AnnotationsImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotations;
+import org.apache.olingo.odata4.client.core.edm.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>();
+
+ public List<AnnotationImpl> getAnnotations() {
+ return annotations;
+ }
+
+ 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/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ComplexTypeImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ComplexTypeImpl.java
new file mode 100644
index 0000000..2066c80
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ComplexTypeImpl.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.odata4.client.core.edm.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.Property;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractComplexType;
+
+public class ComplexTypeImpl extends AbstractComplexType implements AnnotatedEdmItem {
+
+ 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<NavigationPropertyImpl> navigationProperties = new ArrayList<NavigationPropertyImpl>();
+
+ private Annotation annotation;
+
+ public boolean isAbstractEntityType() {
+ return abstractEntityType;
+ }
+
+ public void setAbstractEntityType(final boolean abstractEntityType) {
+ this.abstractEntityType = abstractEntityType;
+ }
+
+ public String getBaseType() {
+ return baseType;
+ }
+
+ public void setBaseType(final String baseType) {
+ this.baseType = baseType;
+ }
+
+ public boolean isOpenType() {
+ return openType;
+ }
+
+ public void setOpenType(final boolean openType) {
+ this.openType = openType;
+ }
+
+ @Override
+ public List<Property> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public Property getProperty(final String name) {
+ Property result = null;
+ for (Property property : getProperties()) {
+ if (name.equals(property.getName())) {
+ result = property;
+ }
+ }
+ return result;
+ }
+
+ public List<NavigationPropertyImpl> getNavigationProperties() {
+ return navigationProperties;
+ }
+
+ public NavigationPropertyImpl getNavigationProperty(final String name) {
+ NavigationPropertyImpl result = null;
+ for (NavigationPropertyImpl property : getNavigationProperties()) {
+ if (name.equals(property.getName())) {
+ result = property;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/DataServicesImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/DataServicesImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/DataServicesImpl.java
new file mode 100644
index 0000000..33423a1
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/DataServicesImpl.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.odata4.client.core.edm.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.core.edm.AbstractDataServices;
+
+public class DataServicesImpl extends AbstractDataServices<
+ SchemaImpl, EntityContainerImpl, EntityTypeImpl, ComplexTypeImpl, FunctionImportImpl> {
+
+ private static final long serialVersionUID = -7954360771258897632L;
+
+ private final List<SchemaImpl> schemas = new ArrayList<SchemaImpl>();
+
+ @Override
+ public List<SchemaImpl> getSchemas() {
+ return schemas;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmMetadataImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmMetadataImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmMetadataImpl.java
new file mode 100644
index 0000000..b8fc847
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmMetadataImpl.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.odata4.client.core.edm.v4;
+
+import java.io.InputStream;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.ODataClient;
+import org.apache.olingo.odata4.client.core.edm.AbstractEdmMetadata;
+
+public class EdmMetadataImpl extends AbstractEdmMetadata<
+ EdmxImpl, DataServicesImpl, SchemaImpl, EntityContainerImpl, EntityTypeImpl, ComplexTypeImpl,
+ FunctionImportImpl> {
+
+ private static final long serialVersionUID = -7765327879691528010L;
+
+ public EdmMetadataImpl(final ODataClient client, final InputStream inputStream) {
+ super(client, inputStream);
+ }
+
+ public List<ReferenceImpl> getReferences() {
+ return this.edmx.getReferences();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmxImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmxImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmxImpl.java
new file mode 100644
index 0000000..2663b78
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EdmxImpl.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.odata4.client.core.edm.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.core.edm.AbstractEdmx;
+
+public class EdmxImpl extends AbstractEdmx<
+ DataServicesImpl, SchemaImpl, EntityContainerImpl, EntityTypeImpl, ComplexTypeImpl, FunctionImportImpl> {
+
+ private static final long serialVersionUID = -8031883176876401375L;
+
+ private final List<ReferenceImpl> references = new ArrayList<ReferenceImpl>();
+
+ public List<ReferenceImpl> getReferences() {
+ return references;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntityContainerImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntityContainerImpl.java
new file mode 100644
index 0000000..7eb6ea8
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntityContainerImpl.java
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either 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.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractEntityContainer;
+
+public class EntityContainerImpl extends AbstractEntityContainer<FunctionImportImpl> implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = 2526002525927260320L;
+
+ private final List<EntitySetImpl> entitySets = new ArrayList<EntitySetImpl>();
+
+ private final List<SingletonImpl> singletons = new ArrayList<SingletonImpl>();
+
+ private final List<ActionImportImpl> actionImports = new ArrayList<ActionImportImpl>();
+
+ private final List<FunctionImportImpl> functionImports = new ArrayList<FunctionImportImpl>();
+
+ 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 List<EntitySetImpl> getEntitySets() {
+ return entitySets;
+ }
+
+ @Override
+ public EntitySetImpl getEntitySet(final String name) {
+ EntitySetImpl result = null;
+ for (EntitySetImpl entitySet : getEntitySets()) {
+ if (name.equals(entitySet.getName())) {
+ result = entitySet;
+ }
+ }
+ return result;
+ }
+
+ public List<SingletonImpl> getSingletons() {
+ return singletons;
+ }
+
+ public SingletonImpl getSingleton(final String name) {
+ SingletonImpl result = null;
+ for (SingletonImpl singleton : getSingletons()) {
+ if (name.equals(singleton.getName())) {
+ result = singleton;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Gets the first action import with given name.
+ *
+ * @param name name.
+ * @return action import.
+ */
+ public ActionImportImpl getActionImport(final String name) {
+ final List<ActionImportImpl> actImps = getActionImports(name);
+ return actImps.isEmpty()
+ ? null
+ : actImps.get(0);
+ }
+
+ /**
+ * Gets all action imports with given name.
+ *
+ * @param name name.
+ * @return action imports.
+ */
+ public List<ActionImportImpl> getActionImports(final String name) {
+ final List<ActionImportImpl> result = new ArrayList<ActionImportImpl>();
+ for (ActionImportImpl actionImport : getActionImports()) {
+ if (name.equals(actionImport.getName())) {
+ result.add(actionImport);
+ }
+ }
+ return result;
+ }
+
+ public List<ActionImportImpl> getActionImports() {
+ return actionImports;
+ }
+
+ @Override
+ public List<FunctionImportImpl> getFunctionImports() {
+ return functionImports;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntitySetImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntitySetImpl.java
new file mode 100644
index 0000000..33bbe0b
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntitySetImpl.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.odata4.client.core.edm.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.NavigationPropertyBinding;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractEntitySet;
+
+public class EntitySetImpl extends AbstractEntitySet implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = 5570833733884884012L;
+
+ private boolean includeInServiceDocument = true;
+
+ private Annotation annotation;
+
+ private final List<NavigationPropertyBinding> navigationPropertyBindings
+ = new ArrayList<NavigationPropertyBinding>();
+
+ public boolean isIncludeInServiceDocument() {
+ return includeInServiceDocument;
+ }
+
+ public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
+ this.includeInServiceDocument = includeInServiceDocument;
+ }
+
+ public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
+ return navigationPropertyBindings;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntityTypeImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntityTypeImpl.java
new file mode 100644
index 0000000..125f63d
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EntityTypeImpl.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.odata4.client.core.edm.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractEntityType;
+
+public class EntityTypeImpl extends AbstractEntityType implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = 8727765036150269547L;
+
+ private final List<PropertyImpl> properties = new ArrayList<PropertyImpl>();
+
+ private final List<NavigationPropertyImpl> navigationProperties = new ArrayList<NavigationPropertyImpl>();
+
+ private Annotation annotation;
+
+ @Override
+ public List<PropertyImpl> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public PropertyImpl getProperty(final String name) {
+ PropertyImpl result = null;
+ for (PropertyImpl property : getProperties()) {
+ if (name.equals(property.getName())) {
+ result = property;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public List<NavigationPropertyImpl> getNavigationProperties() {
+ return navigationProperties;
+ }
+
+ @Override
+ public NavigationPropertyImpl getNavigationProperty(final String name) {
+ NavigationPropertyImpl result = null;
+ for (NavigationPropertyImpl property : getNavigationProperties()) {
+ if (name.equals(property.getName())) {
+ result = property;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EnumTypeImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EnumTypeImpl.java
new file mode 100644
index 0000000..8df0239
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/EnumTypeImpl.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.odata4.client.core.edm.v4;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractEnumType;
+
+public class EnumTypeImpl extends AbstractEnumType implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = -3329664331877556957L;
+
+ private Annotation annotation;
+
+ private final List<MemberImpl> members = new ArrayList<MemberImpl>();
+
+ @Override
+ public List<MemberImpl> getMembers() {
+ return members;
+ }
+
+ @Override
+ public MemberImpl getMember(final String name) {
+ MemberImpl result = null;
+ for (MemberImpl member : getMembers()) {
+ if (name.equals(member.getName())) {
+ result = member;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public MemberImpl getMember(final Integer value) {
+ MemberImpl result = null;
+ for (MemberImpl member : getMembers()) {
+ if (value.equals(member.getValue())) {
+ result = member;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionDeserializer.java
new file mode 100644
index 0000000..eb942f7
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionDeserializer.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.odata4.client.core.edm.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.data.impl.AbstractEdmDeserializer;
+
+public class FunctionDeserializer extends AbstractEdmDeserializer<FunctionImpl> {
+
+ @Override
+ protected FunctionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final FunctionImpl function = 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())) {
+ function.setName(jp.nextTextValue());
+ } else if ("IsBound".equals(jp.getCurrentName())) {
+ function.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("IsComposable".equals(jp.getCurrentName())) {
+ function.setComposable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("EntitySetPath".equals(jp.getCurrentName())) {
+ function.setEntitySetPath(jp.nextTextValue());
+ } else if ("Parameter".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ function.getParameters().add(jp.getCodec().readValue(jp, ParameterImpl.class));
+ } else if ("ReturnType".equals(jp.getCurrentName())) {
+ function.setReturnType(parseReturnType(jp, "Function"));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ function.setAnnotation(jp.getCodec().readValue(jp, AnnotationImpl.class));
+ }
+ }
+ }
+
+ return function;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionImpl.java
new file mode 100644
index 0000000..5e22a7a
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = FunctionDeserializer.class)
+public class FunctionImpl extends ActionImpl {
+
+ private static final long serialVersionUID = -5888231162358116515L;
+
+ private boolean composable = false;
+
+ 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/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionImportImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionImportImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionImportImpl.java
new file mode 100644
index 0000000..bf9ad53
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/FunctionImportImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractFunctionImport;
+
+public class FunctionImportImpl extends AbstractFunctionImport implements AnnotatedEdmItem {
+
+ 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;
+ }
+
+ public String getFunction() {
+ return function;
+ }
+
+ public void setFunction(final String function) {
+ this.function = function;
+ }
+
+ @Override
+ public String getEntitySet() {
+ return entitySet;
+ }
+
+ public void setEntitySet(final String entitySet) {
+ this.entitySet = entitySet;
+ }
+
+ public boolean isIncludeInServiceDocument() {
+ return includeInServiceDocument;
+ }
+
+ public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
+ this.includeInServiceDocument = includeInServiceDocument;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/IncludeAnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/IncludeAnnotationsImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/IncludeAnnotationsImpl.java
new file mode 100644
index 0000000..29a930c
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/IncludeAnnotationsImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.olingo.odata4.client.api.edm.v4.IncludeAnnotations;
+import org.apache.olingo.odata4.client.core.edm.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;
+
+ public String getTermNamespace() {
+ return termNamespace;
+ }
+
+ public void setTermNamespace(final String termNamespace) {
+ this.termNamespace = termNamespace;
+ }
+
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public void setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ }
+
+ 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/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/IncludeImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/IncludeImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/IncludeImpl.java
new file mode 100644
index 0000000..8bda525
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/IncludeImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.olingo.odata4.client.api.edm.v4.Include;
+import org.apache.olingo.odata4.client.core.edm.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;
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(final String namespace) {
+ this.namespace = namespace;
+ }
+
+ 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/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/MemberImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/MemberImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/MemberImpl.java
new file mode 100644
index 0000000..15e8533
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/MemberImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.olingo.odata4.client.api.edm.Member;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractMember;
+
+public class MemberImpl extends AbstractMember implements Member, AnnotatedEdmItem {
+
+ private static final long serialVersionUID = -344920557183058824L;
+
+ @JsonProperty("Annotation")
+ private Annotation annotation;
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyBindingImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyBindingImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyBindingImpl.java
new file mode 100644
index 0000000..c39340b
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyBindingImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.olingo.odata4.client.api.edm.NavigationPropertyBinding;
+import org.apache.olingo.odata4.client.core.edm.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;
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(final String path) {
+ this.path = path;
+ }
+
+ 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/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyDeserializer.java
new file mode 100644
index 0000000..ed5767c
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyDeserializer.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.odata4.client.core.edm.v4;
+
+import org.apache.olingo.odata4.client.core.edm.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.data.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.getCodec().readValue(jp, ReferentialConstraintImpl.class));
+ } else if ("OnDelete".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ property.setOnDelete(jp.getCodec().readValue(jp, OnDeleteImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ property.setAnnotation(jp.getCodec().readValue(jp, AnnotationImpl.class));
+ }
+ }
+ }
+
+ return property;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyImpl.java
new file mode 100644
index 0000000..c84a659
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/NavigationPropertyImpl.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.odata4.client.core.edm.v4;
+
+import org.apache.olingo.odata4.client.core.edm.OnDeleteImpl;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.api.edm.v4.ReferentialConstraint;
+import org.apache.olingo.odata4.client.core.edm.AbstractNavigationProperty;
+
+@JsonDeserialize(using = NavigationPropertyDeserializer.class)
+public class NavigationPropertyImpl extends AbstractNavigationProperty implements AnnotatedEdmItem {
+
+ 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 OnDeleteImpl onDelete;
+
+ private Annotation annotation;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public boolean isNullable() {
+ return nullable;
+ }
+
+ public void setNullable(final boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ public String getPartner() {
+ return partner;
+ }
+
+ public void setPartner(final String partner) {
+ this.partner = partner;
+ }
+
+ public boolean isContainsTarget() {
+ return containsTarget;
+ }
+
+ public void setContainsTarget(final boolean containsTarget) {
+ this.containsTarget = containsTarget;
+ }
+
+ public List<ReferentialConstraint> getReferentialConstraints() {
+ return referentialConstraints;
+ }
+
+ public OnDeleteImpl getOnDelete() {
+ return onDelete;
+ }
+
+ public void setOnDelete(final OnDeleteImpl onDelete) {
+ this.onDelete = onDelete;
+ }
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ParameterImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ParameterImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ParameterImpl.java
new file mode 100644
index 0000000..cda9315
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.olingo.odata4.client.core.edm.AbstractParameter;
+
+public class ParameterImpl extends AbstractParameter {
+
+ private static final long serialVersionUID = -1067642515116697747L;
+
+ @JsonProperty(value = "SRID")
+ private String srid;
+
+ 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/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/PropertyImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/PropertyImpl.java
new file mode 100644
index 0000000..00c4567
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/PropertyImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.olingo.odata4.client.api.edm.v4.Annotation;
+import org.apache.olingo.odata4.client.core.edm.AbstractProperty;
+
+public class PropertyImpl extends AbstractProperty implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = -5541908235094985412L;
+
+ @JsonProperty("Annotation")
+ private Annotation annotation;
+
+ @Override
+ public Annotation getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = annotation;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferenceDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferenceDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferenceDeserializer.java
new file mode 100644
index 0000000..2fd0ef9
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferenceDeserializer.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.odata4.client.core.edm.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.data.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.getCodec().readValue(jp, IncludeImpl.class));
+ } else if ("IncludeAnnotations".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ reference.getIncludeAnnotations().add(jp.getCodec().readValue(jp, IncludeAnnotationsImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ reference.getAnnotations().add(jp.getCodec().readValue(jp, AnnotationImpl.class));
+ }
+ }
+ }
+
+ return reference;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferenceImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferenceImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferenceImpl.java
new file mode 100644
index 0000000..369ce8f
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferenceImpl.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.odata4.client.core.edm.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.v4.Annotation;
+import org.apache.olingo.odata4.client.api.edm.v4.Reference;
+import org.apache.olingo.odata4.client.core.edm.AbstractEdmItem;
+
+@JsonDeserialize(using = ReferenceDeserializer.class)
+public class ReferenceImpl extends AbstractEdmItem implements Reference {
+
+ private static final long serialVersionUID = -5600031479702563436L;
+
+ private URI uri;
+
+ private final List<IncludeImpl> includes = new ArrayList<IncludeImpl>();
+
+ private final List<IncludeAnnotationsImpl> includeAnnotations = new ArrayList<IncludeAnnotationsImpl>();
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(final URI uri) {
+ this.uri = uri;
+ }
+
+ public List<IncludeImpl> getIncludes() {
+ return includes;
+ }
+
+ public List<IncludeAnnotationsImpl> getIncludeAnnotations() {
+ return includeAnnotations;
+ }
+
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferentialConstraintImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferentialConstraintImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferentialConstraintImpl.java
new file mode 100644
index 0000000..7234e5d
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReferentialConstraintImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.olingo.odata4.client.api.edm.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;
+
+ public String getProperty() {
+ return property;
+ }
+
+ public void setProperty(final String property) {
+ this.property = property;
+ }
+
+ 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/4f927e76/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReturnTypeImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReturnTypeImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReturnTypeImpl.java
new file mode 100644
index 0000000..9e9751e
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/ReturnTypeImpl.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.odata4.client.core.edm.v4;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.math.BigInteger;
+import org.apache.olingo.odata4.client.api.edm.v4.ReturnType;
+import org.apache.olingo.odata4.client.core.edm.AbstractEdmItem;
+
+public class ReturnTypeImpl extends AbstractEdmItem implements ReturnType {
+
+ private static final long serialVersionUID = -5888231162358116515L;
+
+ @JsonProperty(value = "Type")
+ private String type;
+
+ @JsonProperty(value = "Nullable")
+ private boolean nullable = true;
+
+ @JsonProperty(value = "MaxLength")
+ private String maxLength;
+
+ @JsonProperty(value = "Precision")
+ private BigInteger precision;
+
+ @JsonProperty(value = "Scale")
+ private BigInteger scale;
+
+ @JsonProperty(value = "SRID")
+ private String srid;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public boolean isNullable() {
+ return nullable;
+ }
+
+ public void setNullable(final boolean nullable) {
+ this.nullable = nullable;
+ }
+
+ 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;
+ }
+
+}