You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2015/02/18 17:29:17 UTC
[06/17] olingo-odata4 git commit: [OLINGO-575] Move v4 package
content one package up
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeImpl.java
new file mode 100644
index 0000000..6906257
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeImpl.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 org.apache.olingo.client.api.edm.xml.Include;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class IncludeImpl extends AbstractEdmItem implements Include {
+
+ private static final long serialVersionUID = -5450008299655584221L;
+
+ @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/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java
new file mode 100644
index 0000000..bc48e9f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotatable;
+import org.apache.olingo.client.api.edm.xml.Annotation;
+
+public class MemberImpl extends AbstractMember implements Annotatable {
+
+ private static final long serialVersionUID = -6138606817225829791L;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyBindingImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyBindingImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyBindingImpl.java
new file mode 100644
index 0000000..283b0d5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyBindingImpl.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 org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class NavigationPropertyBindingImpl extends AbstractEdmItem implements NavigationPropertyBinding {
+
+ private static final long serialVersionUID = -7056978592235483660L;
+
+ @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/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyDeserializer.java
new file mode 100644
index 0000000..a422c53
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/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.client.core.edm.xml;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+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.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return property;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java
new file mode 100644
index 0000000..deb20e5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.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.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.NavigationProperty;
+import org.apache.olingo.client.api.edm.xml.OnDelete;
+import org.apache.olingo.client.api.edm.xml.ReferentialConstraint;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = NavigationPropertyDeserializer.class)
+public class NavigationPropertyImpl extends AbstractNavigationProperty implements NavigationProperty {
+
+ private static final long serialVersionUID = 4503112988794432940L;
+
+ private String type;
+
+ private boolean nullable = true;
+
+ private String partner;
+
+ private final List<ReferentialConstraint> referentialConstraints = new ArrayList<ReferentialConstraint>();
+
+ private OnDelete onDelete;
+
+ private final List<Annotation> annotations = new ArrayList<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 List<ReferentialConstraint> getReferentialConstraints() {
+ return referentialConstraints;
+ }
+
+ @Override
+ public OnDelete getOnDelete() {
+ return onDelete;
+ }
+
+ public void setOnDelete(final OnDelete onDelete) {
+ this.onDelete = onDelete;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/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
index d6c9bed..16353f5 100644
--- 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
@@ -21,7 +21,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
import org.apache.olingo.commons.api.edm.geo.SRID;
import com.fasterxml.jackson.core.JsonParser;
@@ -35,7 +34,7 @@ public class ParameterDeserializer extends AbstractEdmDeserializer<AbstractParam
protected AbstractParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
throws IOException, JsonProcessingException {
- final AbstractParameter parameter = new org.apache.olingo.client.core.edm.xml.v4.ParameterImpl();
+ final AbstractParameter parameter = new org.apache.olingo.client.core.edm.xml.ParameterImpl();
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
final JsonToken token = jp.getCurrentToken();
@@ -57,11 +56,11 @@ public class ParameterDeserializer extends AbstractEdmDeserializer<AbstractParam
} else if ("SRID".equals(jp.getCurrentName())) {
final String srid = jp.nextTextValue();
if (srid != null) {
- ((org.apache.olingo.client.core.edm.xml.v4.ParameterImpl) parameter).setSrid(SRID.valueOf(srid));
+ ((org.apache.olingo.client.core.edm.xml.ParameterImpl) parameter).setSrid(SRID.valueOf(srid));
}
} else if ("Annotation".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.ParameterImpl) parameter).getAnnotations().
+ ((org.apache.olingo.client.core.edm.xml.ParameterImpl) parameter).getAnnotations().
add(jp.readValueAs(AnnotationImpl.class));
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java
new file mode 100644
index 0000000..ec2a08e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.Parameter;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+
+public class ParameterImpl extends AbstractParameter implements Parameter {
+
+ private static final long serialVersionUID = 7119478691341167904L;
+
+ private SRID srid;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public SRID getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final SRID srid) {
+ this.srid = srid;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/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
index bf6e8b4..02c3c3e 100644
--- 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
@@ -21,7 +21,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
import org.apache.olingo.commons.api.edm.geo.SRID;
import com.fasterxml.jackson.core.JsonParser;
@@ -35,7 +34,7 @@ public class PropertyDeserializer extends AbstractEdmDeserializer<AbstractProper
protected AbstractProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
throws IOException, JsonProcessingException {
- final AbstractProperty property = new org.apache.olingo.client.core.edm.xml.v4.PropertyImpl();
+ final AbstractProperty property = new org.apache.olingo.client.core.edm.xml.PropertyImpl();
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
final JsonToken token = jp.getCurrentToken();
@@ -65,7 +64,7 @@ public class PropertyDeserializer extends AbstractEdmDeserializer<AbstractProper
}
} else if ("Annotation".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.PropertyImpl) property).getAnnotations().
+ ((org.apache.olingo.client.core.edm.xml.PropertyImpl) property).getAnnotations().
add(jp.readValueAs(AnnotationImpl.class));
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java
new file mode 100644
index 0000000..1cbdfb1
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.Property;
+
+public class PropertyImpl extends AbstractProperty implements Property {
+
+ private static final long serialVersionUID = 4544336801968719526L;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceDeserializer.java
new file mode 100644
index 0000000..92f1e53
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/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.client.core.edm.xml;
+
+import java.io.IOException;
+import java.net.URI;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+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/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java
new file mode 100644
index 0000000..f9efbf9
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.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.xml;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Include;
+import org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
+import org.apache.olingo.client.api.edm.xml.Reference;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ReferenceDeserializer.class)
+public class ReferenceImpl extends AbstractAnnotatable implements Reference {
+
+ private static final long serialVersionUID = 7720274712545267654L;
+
+ private URI uri;
+
+ private final List<Include> includes = new ArrayList<Include>();
+
+ private final List<IncludeAnnotations> includeAnnotations = new ArrayList<IncludeAnnotations>();
+
+ @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;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java
new file mode 100644
index 0000000..61b2642
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/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;
+
+import org.apache.olingo.client.api.edm.xml.ReferentialConstraint;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ReferentialConstraintImpl extends AbstractAnnotatable implements ReferentialConstraint {
+
+ private static final long serialVersionUID = -5822115908069878139L;
+
+ @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/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeDeserializer.java
new file mode 100644
index 0000000..1a8cd94
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeDeserializer.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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+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())) {
+ final String scale = jp.nextTextValue();
+ returnType.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ final String srid = jp.nextTextValue();
+ if (srid != null) {
+ returnType.setSrid(SRID.valueOf(srid));
+ }
+ }
+ }
+ }
+
+ return returnType;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReturnTypeImpl.java
new file mode 100644
index 0000000..1135437
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/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;
+
+import org.apache.olingo.client.api.edm.xml.ReturnType;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ReturnTypeDeserializer.class)
+public class ReturnTypeImpl extends AbstractEdmItem implements ReturnType {
+
+ private static final long serialVersionUID = 6261092793901735110L;
+
+ private String type;
+
+ private boolean nullable = true;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private SRID 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 SRID getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final SRID srid) {
+ this.srid = srid;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
index c182303..0b042ad 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
@@ -20,12 +20,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
-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.TermImpl;
-import org.apache.olingo.client.core.edm.xml.v4.TypeDefinitionImpl;
-
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
@@ -37,7 +31,7 @@ public class SchemaDeserializer extends AbstractEdmDeserializer<AbstractSchema>
protected AbstractSchema doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
throws IOException, JsonProcessingException {
- final AbstractSchema schema = new org.apache.olingo.client.core.edm.xml.v4.SchemaImpl();
+ final AbstractSchema schema = new org.apache.olingo.client.core.edm.xml.SchemaImpl();
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
final JsonToken token = jp.getCurrentToken();
@@ -49,60 +43,60 @@ public class SchemaDeserializer extends AbstractEdmDeserializer<AbstractSchema>
} else if ("ComplexType".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
getComplexTypes().add(jp.readValueAs(
- org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl.class));
+ org.apache.olingo.client.core.edm.xml.ComplexTypeImpl.class));
} else if ("EntityType".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
getEntityTypes().add(jp.readValueAs(
- org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl.class));
+ org.apache.olingo.client.core.edm.xml.EntityTypeImpl.class));
} else if ("EnumType".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
getEnumTypes().add(jp.readValueAs(
- org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl.class));
+ org.apache.olingo.client.core.edm.xml.EnumTypeImpl.class));
} else if ("EntityContainer".equals(jp.getCurrentName())) {
jp.nextToken();
- org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl entityContainer =
+ org.apache.olingo.client.core.edm.xml.EntityContainerImpl entityContainer =
jp.readValueAs(
- org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl.class);
+ org.apache.olingo.client.core.edm.xml.EntityContainerImpl.class);
entityContainer.setDefaultEntityContainer(true);
- ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
setEntityContainer(entityContainer);
} else if ("Action".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getActions().
+ ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).getActions().
add(jp.readValueAs(ActionImpl.class));
} else if ("Function".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getFunctions().
+ ((org.apache.olingo.client.core.edm.xml.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).
+ ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
getTypeDefinitions().add(jp.readValueAs(TypeDefinitionImpl.class));
}
} else if ("Annotations".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotationGroups().
- add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v4.AnnotationsImpl.class));
+ ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).getAnnotationGroups().
+ add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.AnnotationsImpl.class));
} else if ("Annotation".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotations().
+ ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).getAnnotations().
add(jp.readValueAs(AnnotationImpl.class));
} else if ("Term".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getTerms().
+ ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).getTerms().
add(jp.readValueAs(TermImpl.class));
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java
new file mode 100644
index 0000000..f44e558
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java
@@ -0,0 +1,248 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, 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.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.client.api.edm.xml.Action;
+import org.apache.olingo.client.api.edm.xml.ActionImport;
+import org.apache.olingo.client.api.edm.xml.Annotatable;
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.Annotations;
+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.EntitySet;
+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.Function;
+import org.apache.olingo.client.api.edm.xml.FunctionImport;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.api.edm.xml.Singleton;
+import org.apache.olingo.client.api.edm.xml.Term;
+import org.apache.olingo.client.api.edm.xml.TypeDefinition;
+
+public class SchemaImpl extends AbstractSchema implements Schema {
+
+ private static final long serialVersionUID = 1911087363912024939L;
+
+ private final List<Action> actions = new ArrayList<Action>();
+
+ private final List<Annotations> annotationGroups = 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 Map<String, Annotatable> annotatables;
+
+ @Override
+ public List<Action> getActions() {
+ return actions;
+ }
+
+ @Override
+ public List<Action> getActions(final String name) {
+ return getAllByName(name, getActions());
+ }
+
+ @Override
+ public List<Annotations> getAnnotationGroups() {
+ return annotationGroups;
+ }
+
+ @Override
+ public Annotations getAnnotationGroup(final String target) {
+ Annotations result = null;
+ for (Annotations annots : getAnnotationGroups()) {
+ if (target.equals(annots.getTarget())) {
+ result = annots;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public Annotation getAnnotation(final String term) {
+ Annotation result = null;
+ for (Annotation annot : getAnnotations()) {
+ if (term.equals(annot.getTerm())) {
+ result = annot;
+ }
+ }
+ 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 Term getTerm(final String name) {
+ return getOneByName(name, getTerms());
+ }
+
+ @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 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;
+ }
+
+ @Override
+ public Map<String, Annotatable> getAnnotatables() {
+ if (annotatables == null) {
+ annotatables = new HashMap<String, Annotatable>();
+ for (Annotations annotationGroup : getAnnotationGroups()) {
+ annotatables.put(null, annotationGroup);
+ }
+ for (Annotation annotation : getAnnotations()) {
+ annotatables.put(annotation.getTerm(), annotation);
+ }
+ for (Action action : getActions()) {
+ annotatables.put(action.getName(), action);
+ }
+ for (ComplexType complexType : getComplexTypes()) {
+ annotatables.put(complexType.getName(), complexType);
+ }
+ for (EntityType entityType : getEntityTypes()) {
+ annotatables.put(entityType.getName(), entityType);
+ }
+ for (EnumType enumType : getEnumTypes()) {
+ annotatables.put(enumType.getName(), (EnumTypeImpl) enumType);
+ }
+ for (Function function : getFunctions()) {
+ annotatables.put(function.getName(), function);
+ }
+ for (Term term : getTerms()) {
+ annotatables.put(term.getName(), term);
+ }
+ for (TypeDefinition typedef : getTypeDefinitions()) {
+ annotatables.put(typedef.getName(), typedef);
+ }
+ if (entityContainer != null) {
+ annotatables.put(entityContainer.getName(), entityContainer);
+ for (Annotation annotation : entityContainer.getAnnotations()) {
+ annotatables.put(annotation.getTerm(), annotation);
+ }
+ for (ActionImport actionImport : entityContainer.getActionImports()) {
+ annotatables.put(actionImport.getName(), actionImport);
+ }
+ for (FunctionImport functionImport : entityContainer.getFunctionImports()) {
+ annotatables.put(functionImport.getName(), functionImport);
+ }
+ for (EntitySet entitySet : entityContainer.getEntitySets()) {
+ annotatables.put(entitySet.getName(), entitySet);
+ }
+ for (Singleton singleton : entityContainer.getSingletons()) {
+ annotatables.put(singleton.getName(), singleton);
+ }
+ }
+ }
+ return annotatables;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonDeserializer.java
new file mode 100644
index 0000000..1bc3b2d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonDeserializer.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;
+
+import java.io.IOException;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+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.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return singleton;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonImpl.java
new file mode 100644
index 0000000..ea26cf5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonImpl.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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding;
+import org.apache.olingo.client.api.edm.xml.Singleton;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = SingletonDeserializer.class)
+public class SingletonImpl extends AbstractAnnotatable implements Singleton {
+
+ private static final long serialVersionUID = 1656749615107151921L;
+
+ 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;
+ }
+
+ //TODO: includeInServiceDocument is always false for singletons
+ @Override
+ public boolean isIncludeInServiceDocument() {
+ return false;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermDeserializer.java
new file mode 100644
index 0000000..084c62f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermDeserializer.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.xml;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+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())) {
+ final String scale = jp.nextTextValue();
+ term.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ final String srid = jp.nextTextValue();
+ if (srid != null) {
+ term.setSrid(SRID.valueOf(srid));
+ }
+ } else if ("AppliesTo".equals(jp.getCurrentName())) {
+ term.getAppliesTo().addAll(Arrays.asList(StringUtils.split(jp.nextTextValue())));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ term.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return term;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java
new file mode 100644
index 0000000..a9212aa
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Term;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = TermDeserializer.class)
+public class TermImpl extends AbstractAnnotatable implements Term {
+
+ private static final long serialVersionUID = -8350072064720586186L;
+
+ 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 SRID srid;
+
+ private final List<String> appliesTo = new ArrayList<String>();
+
+ @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 SRID getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final SRID srid) {
+ this.srid = srid;
+ }
+
+ @Override
+ public List<String> getAppliesTo() {
+ return appliesTo;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionDeserializer.java
new file mode 100644
index 0000000..551a3c7
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionDeserializer.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 java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+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())) {
+ final String scale = jp.nextTextValue();
+ typeDefinition.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ final String srid = jp.nextTextValue();
+ if (srid != null) {
+ typeDefinition.setSrid(SRID.valueOf(srid));
+ }
+ } 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/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TypeDefinitionImpl.java
new file mode 100644
index 0000000..0ec8b17
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.TypeDefinition;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = TypeDefinitionDeserializer.class)
+public class TypeDefinitionImpl extends AbstractEdmItem implements TypeDefinition {
+
+ private static final long serialVersionUID = -902407149079419602L;
+
+ private String name;
+
+ private String underlyingType;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private boolean unicode = true;
+
+ private SRID 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 SRID getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final SRID srid) {
+ this.srid = srid;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java
new file mode 100644
index 0000000..35de525
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/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;
+
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Edmx;
+import org.apache.olingo.client.api.edm.xml.Reference;
+import org.apache.olingo.client.api.edm.xml.Schema;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+
+public class XMLMetadataImpl extends AbstractXMLMetadata implements XMLMetadata {
+
+ private static final long serialVersionUID = 6025723060298454901L;
+
+ 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);
+ }
+
+ @Override
+ public List<Reference> getReferences() {
+ return ((Edmx) this.edmx).getReferences();
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotatableDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotatableDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotatableDynamicAnnotationExpression.java
new file mode 100644
index 0000000..da9691e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotatableDynamicAnnotationExpression.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.annotation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotatable;
+import org.apache.olingo.client.api.edm.xml.Annotation;
+
+abstract class AbstractAnnotatableDynamicAnnotationExpression
+ extends AbstractDynamicAnnotationExpression implements Annotatable {
+
+ private static final long serialVersionUID = -450668773857358139L;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotationExpression.java
new file mode 100644
index 0000000..82c0a3d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractAnnotationExpression.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.xml.annotation;
+
+import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression;
+import org.apache.olingo.client.api.edm.xml.annotation.ConstantAnnotationExpression;
+import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmItem;
+
+public abstract class AbstractAnnotationExpression extends AbstractEdmItem implements AnnotationExpression {
+
+ private static final long serialVersionUID = -4238652997159205377L;
+
+ @Override
+ public boolean isConstant() {
+ return this instanceof ConstantAnnotationExpression;
+ }
+
+ @Override
+ public ConstantAnnotationExpression asConstant() {
+ return isConstant() ? (ConstantAnnotationExpression) this : null;
+ }
+
+ @Override
+ public boolean isDynamic() {
+ return this instanceof DynamicAnnotationExpression;
+ }
+
+ @Override
+ public DynamicAnnotationExpression asDynamic() {
+ return isDynamic() ? (DynamicAnnotationExpression) this : null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractDynamicAnnotationExpression.java
new file mode 100644
index 0000000..f94bac6
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractDynamicAnnotationExpression.java
@@ -0,0 +1,218 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, 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.annotation;
+
+import org.apache.olingo.client.api.edm.xml.annotation.AnnotationPath;
+import org.apache.olingo.client.api.edm.xml.annotation.Apply;
+import org.apache.olingo.client.api.edm.xml.annotation.Cast;
+import org.apache.olingo.client.api.edm.xml.annotation.Collection;
+import org.apache.olingo.client.api.edm.xml.annotation.DynamicAnnotationExpression;
+import org.apache.olingo.client.api.edm.xml.annotation.If;
+import org.apache.olingo.client.api.edm.xml.annotation.IsOf;
+import org.apache.olingo.client.api.edm.xml.annotation.LabeledElement;
+import org.apache.olingo.client.api.edm.xml.annotation.LabeledElementReference;
+import org.apache.olingo.client.api.edm.xml.annotation.NavigationPropertyPath;
+import org.apache.olingo.client.api.edm.xml.annotation.Not;
+import org.apache.olingo.client.api.edm.xml.annotation.Null;
+import org.apache.olingo.client.api.edm.xml.annotation.Path;
+import org.apache.olingo.client.api.edm.xml.annotation.PropertyPath;
+import org.apache.olingo.client.api.edm.xml.annotation.PropertyValue;
+import org.apache.olingo.client.api.edm.xml.annotation.Record;
+import org.apache.olingo.client.api.edm.xml.annotation.TwoParamsOpDynamicAnnotationExpression;
+import org.apache.olingo.client.api.edm.xml.annotation.UrlRef;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = DynamicAnnotationExpressionDeserializer.class)
+public abstract class AbstractDynamicAnnotationExpression
+ extends AbstractAnnotationExpression implements DynamicAnnotationExpression {
+
+ private static final long serialVersionUID = 1093411847477874348L;
+
+ @Override
+ public boolean isNot() {
+ return this instanceof Not;
+ }
+
+ @Override
+ public Not asNot() {
+ return isNot() ? (Not) this : null;
+
+ }
+
+ @Override
+ public boolean isTwoParamsOp() {
+ return this instanceof TwoParamsOpDynamicAnnotationExpression;
+ }
+
+ @Override
+ public TwoParamsOpDynamicAnnotationExpression asTwoParamsOp() {
+ return isTwoParamsOp() ? (TwoParamsOpDynamicAnnotationExpression) this : null;
+ }
+
+ @Override
+ public boolean isAnnotationPath() {
+ return this instanceof AnnotationPath;
+ }
+
+ @Override
+ public AnnotationPath asAnnotationPath() {
+ return isAnnotationPath() ? (AnnotationPath) this : null;
+ }
+
+ @Override
+ public boolean isApply() {
+ return this instanceof Apply;
+ }
+
+ @Override
+ public Apply asApply() {
+ return isApply() ? (Apply) this : null;
+ }
+
+ @Override
+ public boolean isCast() {
+ return this instanceof Cast;
+ }
+
+ @Override
+ public Cast asCast() {
+ return isCast() ? (Cast) this : null;
+ }
+
+ @Override
+ public boolean isCollection() {
+ return this instanceof Collection;
+ }
+
+ @Override
+ public Collection asCollection() {
+ return isCollection() ? (Collection) this : null;
+ }
+
+ @Override
+ public boolean isIf() {
+ return this instanceof If;
+ }
+
+ @Override
+ public If asIf() {
+ return isIf() ? (If) this : null;
+ }
+
+ @Override
+ public boolean isIsOf() {
+ return this instanceof IsOf;
+ }
+
+ @Override
+ public IsOf asIsOf() {
+ return isIsOf() ? (IsOf) this : null;
+ }
+
+ @Override
+ public boolean isLabeledElement() {
+ return this instanceof LabeledElement;
+ }
+
+ @Override
+ public LabeledElement asLabeledElement() {
+ return isLabeledElement() ? (LabeledElement) this : null;
+ }
+
+ @Override
+ public boolean isLabeledElementReference() {
+ return this instanceof LabeledElementReference;
+ }
+
+ @Override
+ public LabeledElementReference asLabeledElementReference() {
+ return isLabeledElementReference() ? (LabeledElementReference) this : null;
+ }
+
+ @Override
+ public boolean isNull() {
+ return this instanceof Null;
+ }
+
+ @Override
+ public Null asNull() {
+ return isNull() ? (Null) this : null;
+ }
+
+ @Override
+ public boolean isNavigationPropertyPath() {
+ return this instanceof NavigationPropertyPath;
+ }
+
+ @Override
+ public NavigationPropertyPath asNavigationPropertyPath() {
+ return isNavigationPropertyPath() ? (NavigationPropertyPath) this : null;
+ }
+
+ @Override
+ public boolean isPath() {
+ return this instanceof Path;
+ }
+
+ @Override
+ public Path asPath() {
+ return isPath() ? (Path) this : null;
+ }
+
+ @Override
+ public boolean isPropertyPath() {
+ return this instanceof PropertyPath;
+ }
+
+ @Override
+ public PropertyPath asPropertyPath() {
+ return isPropertyPath() ? (PropertyPath) this : null;
+ }
+
+ @Override
+ public boolean isPropertyValue() {
+ return this instanceof PropertyValue;
+ }
+
+ @Override
+ public PropertyValue asPropertyValue() {
+ return isPropertyValue() ? (PropertyValue) this : null;
+ }
+
+ @Override
+ public boolean isRecord() {
+ return this instanceof Record;
+ }
+
+ @Override
+ public Record asRecord() {
+ return isRecord() ? (Record) this : null;
+ }
+
+ @Override
+ public boolean isUrlRef() {
+ return this instanceof UrlRef;
+ }
+
+ @Override
+ public UrlRef asUrlRef() {
+ return isUrlRef() ? (UrlRef) this : null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractElementOrAttributeExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractElementOrAttributeExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractElementOrAttributeExpression.java
new file mode 100644
index 0000000..8237fca
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AbstractElementOrAttributeExpression.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.annotation;
+
+/**
+ * Groups dynamic expressions that may be provided using element notation or attribute notation.
+ */
+abstract class AbstractElementOrAttributeExpression extends AbstractDynamicAnnotationExpression {
+
+ private static final long serialVersionUID = 1588336268773032932L;
+
+ 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/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AnnotationPathImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AnnotationPathImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AnnotationPathImpl.java
new file mode 100644
index 0000000..0893613
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/AnnotationPathImpl.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.annotation;
+
+import org.apache.olingo.client.api.edm.xml.annotation.AnnotationPath;
+
+public class AnnotationPathImpl extends AbstractElementOrAttributeExpression implements AnnotationPath {
+
+ private static final long serialVersionUID = 5360735207353494466L;
+
+}