You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2015/04/28 22:16:11 UTC
[1/5] olingo-odata4 git commit: [OLINGO-564] Renamed 'ClientCsdl'
classes
Repository: olingo-odata4
Updated Branches:
refs/heads/OLINGO-564 3c0990910 -> 53b10f6b7
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyPath.java
deleted file mode 100644
index b74da28..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyPath.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.annotation.PropertyPath;
-
-class ClientPropertyPath extends AbstractClientElementOrAttributeExpression implements PropertyPath {
-
- private static final long serialVersionUID = -9133862135834738470L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyRef.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyRef.java
deleted file mode 100644
index 17bdc33..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyRef.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientPropertyRef.PropertyRefDeserializer.class)
-class ClientPropertyRef extends CsdlPropertyRef {
-
- private static final long serialVersionUID = 1504095609268590326L;
-
- static class PropertyRefDeserializer extends AbstractClientEdmDeserializer<CsdlPropertyRef> {
- @Override
- protected CsdlPropertyRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final CsdlPropertyRef propertyRef = new ClientPropertyRef();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- propertyRef.setName(jp.nextTextValue());
- } else if ("Alias".equals(jp.getCurrentName())) {
- propertyRef.setAlias(jp.nextTextValue());
- }
- }
- }
- return propertyRef;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyValue.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyValue.java
deleted file mode 100644
index 9b9aa8e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPropertyValue.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientPropertyValue.PropertyValueDeserializer.class)
-class ClientPropertyValue extends AbstractClientAnnotatableDynamicAnnotationExpression implements PropertyValue {
-
- private static final long serialVersionUID = -8437649215282645228L;
-
- private String property;
-
- private AnnotationExpression value;
-
- @Override
- public String getProperty() {
- return property;
- }
-
- public void setProperty(final String property) {
- this.property = property;
- }
-
- @Override
- public AnnotationExpression getValue() {
- return value;
- }
-
- public void setValue(final AnnotationExpression value) {
- this.value = value;
- }
-
- static class PropertyValueDeserializer extends AbstractClientEdmDeserializer<ClientPropertyValue> {
- @Override
- protected ClientPropertyValue doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientPropertyValue propValue = new ClientPropertyValue();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Property".equals(jp.getCurrentName())) {
- propValue.setProperty(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- propValue.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- } else if (isAnnotationConstExprConstruct(jp)) {
- propValue.setValue(parseAnnotationConstExprConstruct(jp));
- } else {
- propValue.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- }
- }
- }
- return propValue;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientRecord.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientRecord.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientRecord.java
deleted file mode 100644
index 264adae..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientRecord.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue;
-import org.apache.olingo.commons.api.edm.provider.annotation.Record;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = ClientRecord.RecordDeserializer.class)
-class ClientRecord extends AbstractClientAnnotatableDynamicAnnotationExpression implements Record {
-
- private static final long serialVersionUID = 4275271751615410709L;
-
- private String type;
-
- private final List<PropertyValue> propertyValues = new ArrayList<PropertyValue>();
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- @Override
- public List<PropertyValue> getPropertyValues() {
- return propertyValues;
- }
-
- static class RecordDeserializer extends AbstractClientEdmDeserializer<ClientRecord> {
- @Override
- protected ClientRecord doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientRecord record = new ClientRecord();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Type".equals(jp.getCurrentName())) {
- record.setType(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- record.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- } else {
- record.getPropertyValues().add(jp.readValueAs(ClientPropertyValue.class));
- }
- }
- }
- return record;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReference.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReference.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReference.java
deleted file mode 100644
index 36b43d6..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReference.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-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 org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = ClientReference.ReferenceDeserializer.class)
-class ClientReference extends CsdlAbstractEdmItem 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>();
- private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
-
- @Override
- public List<CsdlAnnotation> getAnnotations() {
- return annotations;
- }
-
- @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;
- }
-
- static class ReferenceDeserializer extends AbstractClientEdmDeserializer<ClientReference> {
- @Override
- protected ClientReference doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientReference reference = new ClientReference();
-
- 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( ClientInclude.class));
- } else if ("IncludeAnnotations".equals(jp.getCurrentName())) {
- jp.nextToken();
- reference.getIncludeAnnotations().add(jp.readValueAs( ClientIncludeAnnotations.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- reference.getAnnotations().add(jp.readValueAs( ClientAnnotation.class));
- }
- }
- }
-
- return reference;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReferentialConstraint.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReferentialConstraint.java
deleted file mode 100644
index e613563..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReferentialConstraint.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientReferentialConstraint.ReferentialConstraintDeserializer.class)
-class ClientReferentialConstraint extends CsdlReferentialConstraint {
-
- private static final long serialVersionUID = -5822115908069878139L;
-
- static class ReferentialConstraintDeserializer extends AbstractClientEdmDeserializer<CsdlReferentialConstraint> {
- @Override
- protected CsdlReferentialConstraint doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final CsdlReferentialConstraint refConst = new ClientReferentialConstraint();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Property".equals(jp.getCurrentName())) {
- refConst.setProperty(jp.nextTextValue());
- } else if ("ReferencedProperty".equals(jp.getCurrentName())) {
- refConst.setReferencedProperty(jp.nextTextValue());
- }
- }
- }
- return refConst;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReturnType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReturnType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReturnType.java
deleted file mode 100644
index 72db23f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientReturnType.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.api.edm.provider.CsdlReturnType;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientReturnType.ReturnTypeDeserializer.class)
-class ClientReturnType extends CsdlReturnType {
-
- private static final long serialVersionUID = 6261092793901735110L;
-
- static class ReturnTypeDeserializer extends AbstractClientEdmDeserializer<ClientReturnType> {
- @Override
- protected ClientReturnType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientReturnType returnType = new ClientReturnType();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Type".equals(jp.getCurrentName())) {
- String metadataTypeName = jp.nextTextValue();
- if (metadataTypeName.startsWith("Collection(")) {
- returnType.setType(metadataTypeName.substring(metadataTypeName.indexOf("(") + 1,
- metadataTypeName.length() - 1));
- returnType.setCollection(true);
- } else {
- returnType.setType(metadataTypeName);
- returnType.setCollection(false);
- }
- } 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/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSchema.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSchema.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSchema.java
deleted file mode 100644
index a4a0dd7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSchema.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientSchema.SchemaDeserializer.class)
-class ClientSchema extends CsdlSchema {
-
- private static final long serialVersionUID = 1911087363912024939L;
-
- static class SchemaDeserializer extends AbstractClientEdmDeserializer<ClientSchema> {
- @Override
- protected ClientSchema doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientSchema schema = new ClientSchema();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Namespace".equals(jp.getCurrentName())) {
- schema.setNamespace(jp.nextTextValue());
- } else if ("Alias".equals(jp.getCurrentName())) {
- schema.setAlias(jp.nextTextValue());
- } else if ("ComplexType".equals(jp.getCurrentName())) {
- jp.nextToken();
- schema.getComplexTypes().add(jp.readValueAs(ClientComplexType.class));
- } else if ("EntityType".equals(jp.getCurrentName())) {
- jp.nextToken();
- schema.getEntityTypes().add(jp.readValueAs(ClientEntityType.class));
- } else if ("EnumType".equals(jp.getCurrentName())) {
- jp.nextToken();
- schema.getEnumTypes().add(jp.readValueAs(ClientEnumType.class));
- } else if ("EntityContainer".equals(jp.getCurrentName())) {
- jp.nextToken();
- ClientEntityContainer entityContainer = jp.readValueAs(ClientEntityContainer.class);
- schema.setEntityContainer(entityContainer);
- } else if ("Action".equals(jp.getCurrentName())) {
- jp.nextToken();
- schema.getActions().add(jp.readValueAs(ClientAction.class));
- } else if ("Function".equals(jp.getCurrentName())) {
- jp.nextToken();
- schema.getFunctions().add(jp.readValueAs(ClientFunction.class));
- } else if ("TypeDefinition".equals(jp.getCurrentName())) {
- jp.nextToken();
- schema.getTypeDefinitions().add(jp.readValueAs(ClientTypeDefinition.class));
- }
- } else if ("Annotations".equals(jp.getCurrentName())) {
- jp.nextToken();
- schema.getAnnotationGroups().add(jp.readValueAs(ClientAnnotations.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- schema.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- } else if ("Term".equals(jp.getCurrentName())) {
- jp.nextToken();
- schema.getTerms().add(jp.readValueAs(ClientTerm.class));
- }
- }
-
- return schema;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSingleton.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSingleton.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSingleton.java
deleted file mode 100644
index a06d6e8..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientSingleton.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.CsdlSingleton;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientSingleton.SingletonDeserializer.class)
-class ClientSingleton extends CsdlSingleton {
-
- private static final long serialVersionUID = 1656749615107151921L;
-
- static class SingletonDeserializer extends AbstractClientEdmDeserializer<ClientSingleton> {
- @Override
- protected ClientSingleton doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientSingleton singleton = new ClientSingleton();
-
- 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.setType(jp.nextTextValue());
- } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
- jp.nextToken();
- singleton.getNavigationPropertyBindings().add(
- jp.readValueAs(ClientNavigationPropertyBinding.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- singleton.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return singleton;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTerm.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTerm.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTerm.java
deleted file mode 100644
index f0904dd..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTerm.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.api.edm.provider.CsdlTerm;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-import java.util.Arrays;
-
-@JsonDeserialize(using = ClientTerm.TermDeserializer.class)
-class ClientTerm extends CsdlTerm {
-
- private static final long serialVersionUID = -8350072064720586186L;
-
- static class TermDeserializer extends AbstractClientEdmDeserializer<ClientTerm> {
- @Override
- protected ClientTerm doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientTerm term = new ClientTerm();
-
- 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(ClientAnnotation.class));
- }
- }
- }
-
- return term;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTwoParamsOpDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTwoParamsOpDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTwoParamsOpDynamicAnnotationExpression.java
deleted file mode 100644
index 8ce3167..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTwoParamsOpDynamicAnnotationExpression.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression;
-
-class ClientTwoParamsOpDynamicAnnotationExpression
- extends AbstractClientDynamicAnnotationExpression implements TwoParamsOpDynamicAnnotationExpression {
-
- private static final long serialVersionUID = 6241842185452451946L;
-
- private Type type;
-
- private DynamicAnnotationExpression left;
-
- private DynamicAnnotationExpression right;
-
- @Override
- public Type getType() {
- return type;
- }
-
- public void setType(final Type type) {
- this.type = type;
- }
-
- @Override
- public DynamicAnnotationExpression getLeftExpression() {
- return left;
- }
-
- public void setLeftExpression(final DynamicAnnotationExpression left) {
- this.left = left;
- }
-
- @Override
- public DynamicAnnotationExpression getRightExpression() {
- return right;
- }
-
- public void setRightExpression(final DynamicAnnotationExpression right) {
- this.right = right;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java
deleted file mode 100644
index fd79ec4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientTypeDefinition.TypeDefinitionDeserializer.class)
-class ClientTypeDefinition extends CsdlTypeDefinition {
-
- private static final long serialVersionUID = -902407149079419602L;
-
- static class TypeDefinitionDeserializer extends AbstractClientEdmDeserializer<ClientTypeDefinition> {
- @Override
- protected ClientTypeDefinition doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientTypeDefinition typeDefinition = new ClientTypeDefinition();
-
- 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(ClientAnnotation.class));
- }
- }
- }
-
- return typeDefinition;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientUrlRef.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientUrlRef.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientUrlRef.java
deleted file mode 100644
index 053a52e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientUrlRef.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.UrlRef;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientUrlRef.UrlRefDeserializer.class)
-class ClientUrlRef extends AbstractClientDynamicAnnotationExpression implements UrlRef {
-
- private static final long serialVersionUID = -7693224811739000440L;
-
- private AnnotationExpression value;
-
- @Override
- public AnnotationExpression getValue() {
- return value;
- }
-
- public void setValue(final AnnotationExpression value) {
- this.value = value;
- }
-
- static class UrlRefDeserializer extends AbstractClientEdmDeserializer<ClientUrlRef> {
- @Override
- protected ClientUrlRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientUrlRef urlref = new ClientUrlRef();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if (isAnnotationConstExprConstruct(jp)) {
- urlref.setValue(parseAnnotationConstExprConstruct(jp));
- } else {
- urlref.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- }
- }
- }
- return urlref;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ClientODataDeserializerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ClientODataDeserializerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ClientODataDeserializerImpl.java
index 55a02d4..a668aaf 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ClientODataDeserializerImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ClientODataDeserializerImpl.java
@@ -28,8 +28,8 @@ import org.apache.olingo.client.api.edm.xml.XMLMetadata;
import org.apache.olingo.client.api.serialization.ClientODataDeserializer;
import org.apache.olingo.client.core.data.JSONServiceDocumentDeserializer;
import org.apache.olingo.client.core.data.XMLServiceDocumentDeserializer;
-import org.apache.olingo.client.core.edm.xml.ClientEdmx;
-import org.apache.olingo.client.core.edm.ClientXMLMetadata;
+import org.apache.olingo.client.core.edm.xml.ClientCsdlEdmx;
+import org.apache.olingo.client.core.edm.ClientCsdlXMLMetadata;
import org.apache.olingo.commons.api.data.Delta;
import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.EntityCollection;
@@ -114,7 +114,7 @@ public class ClientODataDeserializerImpl implements ClientODataDeserializer {
@Override
public XMLMetadata toMetadata(final InputStream input) {
try {
- return new ClientXMLMetadata(getXmlMapper().readValue(input, ClientEdmx.class));
+ return new ClientCsdlXMLMetadata(getXmlMapper().readValue(input, ClientCsdlEdmx.class));
} catch (Exception e) {
throw new IllegalArgumentException("Could not parse as Edmx document", e);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java
index c1b4e7c..c0af3af 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java
@@ -28,7 +28,7 @@ import org.apache.olingo.client.api.data.ServiceDocument;
import org.apache.olingo.client.api.domain.ODataEntitySetIterator;
import org.apache.olingo.client.api.edm.xml.XMLMetadata;
import org.apache.olingo.client.api.serialization.ODataReader;
-import org.apache.olingo.client.core.edm.ClientEdmProvider;
+import org.apache.olingo.client.core.edm.ClientCsdlEdmProvider;
import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.EntityCollection;
import org.apache.olingo.commons.api.data.Property;
@@ -68,7 +68,7 @@ public class ODataReaderImpl implements ODataReader {
@Override
public Edm readMetadata(final Map<String, CsdlSchema> xmlSchemas) {
- ClientEdmProvider prov = new ClientEdmProvider(xmlSchemas);
+ ClientCsdlEdmProvider prov = new ClientCsdlEdmProvider(xmlSchemas);
return new EdmProviderImpl(prov);
}
[3/5] olingo-odata4 git commit: [OLINGO-564] Renamed 'ClientCsdl'
classes
Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunctionImport.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunctionImport.java
new file mode 100644
index 0000000..6b6a044
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunctionImport.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlFunctionImport.FunctionImportDeserializer.class)
+class ClientCsdlFunctionImport extends CsdlFunctionImport {
+
+ private static final long serialVersionUID = -1686801084142932402L;
+
+ static class FunctionImportDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlFunctionImport> {
+ @Override
+ protected ClientCsdlFunctionImport doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlFunctionImport functImpImpl = new ClientCsdlFunctionImport();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ functImpImpl.setName(jp.nextTextValue());
+ } else if ("Function".equals(jp.getCurrentName())) {
+ functImpImpl.setFunction(jp.nextTextValue());
+ } else if ("EntitySet".equals(jp.getCurrentName())) {
+ functImpImpl.setEntitySet(jp.nextTextValue());
+ } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
+ functImpImpl.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ functImpImpl.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return functImpImpl;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIf.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIf.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIf.java
new file mode 100644
index 0000000..1289637
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIf.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 org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.If;
+
+class ClientCsdlIf extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements If {
+
+ private static final long serialVersionUID = -8571383625077590656L;
+
+ private AnnotationExpression guard;
+
+ private AnnotationExpression _then;
+
+ private AnnotationExpression _else;
+
+ @Override
+ public AnnotationExpression getGuard() {
+ return guard;
+ }
+
+ public void setGuard(final AnnotationExpression guard) {
+ this.guard = guard;
+ }
+
+ @Override
+ public AnnotationExpression getThen() {
+ return _then;
+ }
+
+ public void setThen(final AnnotationExpression _then) {
+ this._then = _then;
+ }
+
+ @Override
+ public AnnotationExpression getElse() {
+ return _else;
+ }
+
+ public void setElse(final AnnotationExpression _else) {
+ this._else = _else;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlInclude.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlInclude.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlInclude.java
new file mode 100644
index 0000000..541f037
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlInclude.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.client.api.edm.xml.Include;
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlInclude.IncludeDeserializer.class)
+class ClientCsdlInclude extends CsdlAbstractEdmItem implements Include {
+
+ private static final long serialVersionUID = -5450008299655584221L;
+
+ private String namespace;
+ private String alias;
+
+ @Override
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setNamespace(final String namespace) {
+ this.namespace = namespace;
+ }
+
+ @Override
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(final String alias) {
+ this.alias = alias;
+ }
+
+ static class IncludeDeserializer extends AbstractClientCsdlEdmDeserializer<Include> {
+ @Override
+ protected Include doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlInclude include = new ClientCsdlInclude();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Namespace".equals(jp.getCurrentName())) {
+ include.setNamespace(jp.nextTextValue());
+ } else if ("Alias".equals(jp.getCurrentName())) {
+ include.setAlias(jp.nextTextValue());
+ }
+ }
+ }
+ return include;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIncludeAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIncludeAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIncludeAnnotations.java
new file mode 100644
index 0000000..87150ea
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIncludeAnnotations.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.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlIncludeAnnotations.IncludeAnnotationsDeserializer.class)
+class ClientCsdlIncludeAnnotations extends CsdlAbstractEdmItem implements IncludeAnnotations {
+
+ private static final long serialVersionUID = -8157841387011422396L;
+
+ private String termNamespace;
+ private String qualifier;
+ private String targetNamespace;
+
+ @Override
+ public String getTermNamespace() {
+ return termNamespace;
+ }
+
+ public void setTermNamespace(final String termNamespace) {
+ this.termNamespace = termNamespace;
+ }
+
+ @Override
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public void setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ }
+
+ @Override
+ public String getTargetNamespace() {
+ return targetNamespace;
+ }
+
+ public void setTargetNamespace(final String targetNamespace) {
+ this.targetNamespace = targetNamespace;
+ }
+
+ static class IncludeAnnotationsDeserializer extends AbstractClientCsdlEdmDeserializer<IncludeAnnotations> {
+ @Override
+ protected IncludeAnnotations doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlIncludeAnnotations member = new ClientCsdlIncludeAnnotations();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("TermNamespace".equals(jp.getCurrentName())) {
+ member.setTermNamespace(jp.nextTextValue());
+ } else if ("Qualifier".equals(jp.getCurrentName())) {
+ member.setQualifier(jp.nextTextValue());
+ } else if ("TargetNamespace".equals(jp.getCurrentName())) {
+ member.setTargetNamespace(jp.nextTextValue());
+ }
+ }
+ }
+ return member;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIsOf.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIsOf.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIsOf.java
new file mode 100644
index 0000000..58b34e0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIsOf.java
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.IsOf;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlIsOf.IsOfDeserializer.class)
+class ClientCsdlIsOf extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements IsOf {
+
+ private static final long serialVersionUID = -893355856129761174L;
+
+ private String type;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private SRID srid;
+
+ private DynamicAnnotationExpression value;
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ @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 DynamicAnnotationExpression getValue() {
+ return value;
+ }
+
+ public void setValue(final DynamicAnnotationExpression value) {
+ this.value = value;
+ }
+
+ static class IsOfDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlIsOf> {
+ @Override
+ protected ClientCsdlIsOf doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlIsOf isof = new ClientCsdlIsOf();
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Type".equals(jp.getCurrentName())) {
+ isof.setType(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ isof.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ isof.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ isof.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ final String scale = jp.nextTextValue();
+ isof.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ final String srid = jp.nextTextValue();
+ if (srid != null) {
+ isof.setSrid(SRID.valueOf(srid));
+ }
+ } else {
+ isof.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ }
+ }
+ }
+ return isof;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElement.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElement.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElement.java
new file mode 100644
index 0000000..db1a734
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElement.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 com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElement;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlLabeledElement.LabeledElementDeserializer.class)
+class ClientCsdlLabeledElement
+ extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements LabeledElement {
+
+ private static final long serialVersionUID = 4909387630253341824L;
+
+ private String name;
+
+ private DynamicAnnotationExpression value;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public DynamicAnnotationExpression getValue() {
+ return value;
+ }
+
+ public void setValue(final DynamicAnnotationExpression value) {
+ this.value = value;
+ }
+
+ static class LabeledElementDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlLabeledElement> {
+ @Override
+ protected ClientCsdlLabeledElement doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlLabeledElement element = new ClientCsdlLabeledElement();
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ element.setName(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ element.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ } else {
+ element.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ }
+ }
+ }
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElementReference.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElementReference.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElementReference.java
new file mode 100644
index 0000000..b3f1e5a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElementReference.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElementReference;
+
+class ClientCsdlLabeledElementReference
+ extends AbstractClientCsdlElementOrAttributeExpression implements LabeledElementReference {
+
+ private static final long serialVersionUID = 7560525604021670529L;
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationProperty.java
new file mode 100644
index 0000000..2fca830
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationProperty.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlNavigationProperty.NavigationPropertyDeserializer.class)
+class ClientCsdlNavigationProperty extends CsdlNavigationProperty {
+
+ private static final long serialVersionUID = 6240231735592427582L;
+
+ static class NavigationPropertyDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlNavigationProperty> {
+
+ @Override
+ protected CsdlNavigationProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final CsdlNavigationProperty property = new ClientCsdlNavigationProperty();
+
+ 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())) {
+ String metadataTypeName = jp.nextTextValue();
+ if (metadataTypeName.startsWith("Collection(")) {
+ property.setType(metadataTypeName.substring(metadataTypeName.indexOf("(") + 1,
+ metadataTypeName.length() - 1));
+ property.setCollection(true);
+ } else {
+ property.setType(metadataTypeName);
+ property.setCollection(false);
+ }
+ } 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(ClientCsdlReferentialConstraint.class));
+ } else if ("OnDelete".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ property.setOnDelete(jp.readValueAs(ClientCsdlOnDelete.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ property.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+ return property;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyBinding.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyBinding.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyBinding.java
new file mode 100644
index 0000000..d9da5b0
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyBinding.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 com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlNavigationPropertyBinding.NavigationPropertyBindingDeserializer.class)
+class ClientCsdlNavigationPropertyBinding extends CsdlNavigationPropertyBinding {
+
+ private static final long serialVersionUID = -7056978592235483660L;
+
+ @Override
+ public CsdlNavigationPropertyBinding setPath(final String path) {
+ super.setPath(path);
+ return this;
+ }
+
+ @Override
+ public CsdlNavigationPropertyBinding setTarget(final String target) {
+ super.setTarget(target);
+ return this;
+ }
+
+ static class NavigationPropertyBindingDeserializer extends
+ AbstractClientCsdlEdmDeserializer<CsdlNavigationPropertyBinding> {
+ @Override
+ protected CsdlNavigationPropertyBinding doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlNavigationPropertyBinding member = new ClientCsdlNavigationPropertyBinding();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Path".equals(jp.getCurrentName())) {
+ member.setPath(jp.nextTextValue());
+ } else if ("Target".equals(jp.getCurrentName())) {
+ member.setTarget(jp.nextTextValue());
+ }
+ }
+ }
+ return member;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyPath.java
new file mode 100644
index 0000000..039af20
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyPath.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import org.apache.olingo.commons.api.edm.provider.annotation.NavigationPropertyPath;
+
+class ClientCsdlNavigationPropertyPath extends AbstractClientCsdlElementOrAttributeExpression
+ implements NavigationPropertyPath {
+
+ private static final long serialVersionUID = 879840502446301312L;
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNot.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNot.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNot.java
new file mode 100644
index 0000000..b417341
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNot.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.Not;
+
+class ClientCsdlNot extends AbstractClientCsdlDynamicAnnotationExpression implements Not {
+
+ private static final long serialVersionUID = -437788415922966812L;
+
+ private DynamicAnnotationExpression expression;
+
+ @Override
+ public DynamicAnnotationExpression getExpression() {
+ return expression;
+ }
+
+ public void setExpression(final DynamicAnnotationExpression expression) {
+ this.expression = expression;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNull.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNull.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNull.java
new file mode 100644
index 0000000..5181c0f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNull.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.annotation.Null;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlNull.NullDeserializer.class)
+class ClientCsdlNull extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements Null {
+
+ private static final long serialVersionUID = -3148516847180393142L;
+
+ static class NullDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlNull> {
+ @Override
+ protected ClientCsdlNull doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlNull _null = new ClientCsdlNull();
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Annotation".equals(jp.getCurrentName())) {
+ _null.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+ return _null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlOnDelete.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlOnDelete.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlOnDelete.java
new file mode 100644
index 0000000..6fa992f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlOnDelete.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.commons.api.edm.provider.CsdlOnDelete;
+import org.apache.olingo.commons.api.edm.provider.CsdlOnDeleteAction;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlOnDelete.OnDeleteDeserializer.class)
+class ClientCsdlOnDelete extends CsdlOnDelete {
+
+ private static final long serialVersionUID = -7130889202653716784L;
+
+ static class OnDeleteDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlOnDelete> {
+ @Override
+ protected CsdlOnDelete doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final CsdlOnDelete ondelete = new ClientCsdlOnDelete();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Action".equals(jp.getCurrentName())) {
+ CsdlOnDeleteAction action = CsdlOnDeleteAction.valueOf(jp.nextTextValue());
+ ondelete.setAction(action);
+ }
+ }
+ }
+ return ondelete;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlParameter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlParameter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlParameter.java
new file mode 100644
index 0000000..4df4377
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlParameter.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.CsdlParameter;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlParameter.ParameterDeserializer.class)
+class ClientCsdlParameter extends CsdlParameter {
+
+ private static final long serialVersionUID = 7119478691341167904L;
+
+ static class ParameterDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlParameter> {
+ @Override
+ protected ClientCsdlParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlParameter parameter = new ClientCsdlParameter();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ parameter.setName(jp.nextTextValue());
+ } else if ("Type".equals(jp.getCurrentName())) {
+ String metadataTypeName = jp.nextTextValue();
+ if (metadataTypeName.startsWith("Collection(")) {
+ parameter.setType(metadataTypeName.substring(metadataTypeName.indexOf("(") + 1,
+ metadataTypeName.length() - 1));
+ parameter.setCollection(true);
+ } else {
+ parameter.setType(metadataTypeName);
+ parameter.setCollection(false);
+ }
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ parameter.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ parameter.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ parameter.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ final String scale = jp.nextTextValue();
+ parameter.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ final String srid = jp.nextTextValue();
+ if (srid != null) {
+ parameter.setSrid(SRID.valueOf(srid));
+ }
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ parameter.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return parameter;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPath.java
new file mode 100644
index 0000000..ed4d2bc
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPath.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;
+
+import org.apache.olingo.commons.api.edm.provider.annotation.Path;
+
+class ClientCsdlPath extends AbstractClientCsdlElementOrAttributeExpression implements Path {
+
+ private static final long serialVersionUID = 6020168217561402545L;
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlProperty.java
new file mode 100644
index 0000000..647f386
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlProperty.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.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.CsdlProperty;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlProperty.PropertyDeserializer.class)
+class ClientCsdlProperty extends CsdlProperty {
+
+ private static final long serialVersionUID = -4521766603286651372L;
+
+ static class PropertyDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlProperty> {
+ @Override
+ protected ClientCsdlProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlProperty property = new ClientCsdlProperty();
+
+ 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())) {
+ String metadataTypeName = jp.nextTextValue();
+ if (metadataTypeName.startsWith("Collection(")) {
+ property.setType(metadataTypeName.substring(metadataTypeName.indexOf("(") + 1,
+ metadataTypeName.length() - 1));
+ property.setCollection(true);
+ } else {
+ property.setType(metadataTypeName);
+ property.setCollection(false);
+ }
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ property.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("DefaultValue".equals(jp.getCurrentName())) {
+ property.setDefaultValue(jp.nextTextValue());
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ property.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ property.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ final String scale = jp.nextTextValue();
+ property.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
+ } else if ("Unicode".equals(jp.getCurrentName())) {
+ property.setUnicode(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ final String srid = jp.nextTextValue();
+ if (srid != null) {
+ property.setSrid(SRID.valueOf(srid));
+ }
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ property.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return property;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyPath.java
new file mode 100644
index 0000000..45b66dc
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyPath.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;
+
+import org.apache.olingo.commons.api.edm.provider.annotation.PropertyPath;
+
+class ClientCsdlPropertyPath extends AbstractClientCsdlElementOrAttributeExpression implements PropertyPath {
+
+ private static final long serialVersionUID = -9133862135834738470L;
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyRef.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyRef.java
new file mode 100644
index 0000000..6e32473
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyRef.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlPropertyRef.PropertyRefDeserializer.class)
+class ClientCsdlPropertyRef extends CsdlPropertyRef {
+
+ private static final long serialVersionUID = 1504095609268590326L;
+
+ static class PropertyRefDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlPropertyRef> {
+ @Override
+ protected CsdlPropertyRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final CsdlPropertyRef propertyRef = new ClientCsdlPropertyRef();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ propertyRef.setName(jp.nextTextValue());
+ } else if ("Alias".equals(jp.getCurrentName())) {
+ propertyRef.setAlias(jp.nextTextValue());
+ }
+ }
+ }
+ return propertyRef;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyValue.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyValue.java
new file mode 100644
index 0000000..d1cec62
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyValue.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlPropertyValue.PropertyValueDeserializer.class)
+class ClientCsdlPropertyValue extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression
+ implements PropertyValue {
+
+ private static final long serialVersionUID = -8437649215282645228L;
+
+ private String property;
+
+ private AnnotationExpression value;
+
+ @Override
+ public String getProperty() {
+ return property;
+ }
+
+ public void setProperty(final String property) {
+ this.property = property;
+ }
+
+ @Override
+ public AnnotationExpression getValue() {
+ return value;
+ }
+
+ public void setValue(final AnnotationExpression value) {
+ this.value = value;
+ }
+
+ static class PropertyValueDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlPropertyValue> {
+ @Override
+ protected ClientCsdlPropertyValue doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlPropertyValue propValue = new ClientCsdlPropertyValue();
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Property".equals(jp.getCurrentName())) {
+ propValue.setProperty(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ propValue.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ } else if (isAnnotationConstExprConstruct(jp)) {
+ propValue.setValue(parseAnnotationConstExprConstruct(jp));
+ } else {
+ propValue.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ }
+ }
+ }
+ return propValue;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlRecord.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlRecord.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlRecord.java
new file mode 100644
index 0000000..f1176c9
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlRecord.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue;
+import org.apache.olingo.commons.api.edm.provider.annotation.Record;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ClientCsdlRecord.RecordDeserializer.class)
+class ClientCsdlRecord extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements Record {
+
+ private static final long serialVersionUID = 4275271751615410709L;
+
+ private String type;
+
+ private final List<PropertyValue> propertyValues = new ArrayList<PropertyValue>();
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ @Override
+ public List<PropertyValue> getPropertyValues() {
+ return propertyValues;
+ }
+
+ static class RecordDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlRecord> {
+ @Override
+ protected ClientCsdlRecord doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlRecord record = new ClientCsdlRecord();
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Type".equals(jp.getCurrentName())) {
+ record.setType(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ record.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ } else {
+ record.getPropertyValues().add(jp.readValueAs(ClientCsdlPropertyValue.class));
+ }
+ }
+ }
+ return record;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReference.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReference.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReference.java
new file mode 100644
index 0000000..b0b71e7
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReference.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+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 org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ClientCsdlReference.ReferenceDeserializer.class)
+class ClientCsdlReference extends CsdlAbstractEdmItem 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>();
+ private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ @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;
+ }
+
+ static class ReferenceDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlReference> {
+ @Override
+ protected ClientCsdlReference doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlReference reference = new ClientCsdlReference();
+
+ 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( ClientCsdlInclude.class));
+ } else if ("IncludeAnnotations".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ reference.getIncludeAnnotations().add(jp.readValueAs( ClientCsdlIncludeAnnotations.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ reference.getAnnotations().add(jp.readValueAs( ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return reference;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReferentialConstraint.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReferentialConstraint.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReferentialConstraint.java
new file mode 100644
index 0000000..1327766
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReferentialConstraint.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.commons.api.edm.provider.CsdlReferentialConstraint;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlReferentialConstraint.ReferentialConstraintDeserializer.class)
+class ClientCsdlReferentialConstraint extends CsdlReferentialConstraint {
+
+ private static final long serialVersionUID = -5822115908069878139L;
+
+ static class ReferentialConstraintDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlReferentialConstraint> {
+ @Override
+ protected CsdlReferentialConstraint doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final CsdlReferentialConstraint refConst = new ClientCsdlReferentialConstraint();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Property".equals(jp.getCurrentName())) {
+ refConst.setProperty(jp.nextTextValue());
+ } else if ("ReferencedProperty".equals(jp.getCurrentName())) {
+ refConst.setReferencedProperty(jp.nextTextValue());
+ }
+ }
+ }
+ return refConst;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReturnType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReturnType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReturnType.java
new file mode 100644
index 0000000..302bd9f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlReturnType.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.CsdlReturnType;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlReturnType.ReturnTypeDeserializer.class)
+class ClientCsdlReturnType extends CsdlReturnType {
+
+ private static final long serialVersionUID = 6261092793901735110L;
+
+ static class ReturnTypeDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlReturnType> {
+ @Override
+ protected ClientCsdlReturnType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlReturnType returnType = new ClientCsdlReturnType();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Type".equals(jp.getCurrentName())) {
+ String metadataTypeName = jp.nextTextValue();
+ if (metadataTypeName.startsWith("Collection(")) {
+ returnType.setType(metadataTypeName.substring(metadataTypeName.indexOf("(") + 1,
+ metadataTypeName.length() - 1));
+ returnType.setCollection(true);
+ } else {
+ returnType.setType(metadataTypeName);
+ returnType.setCollection(false);
+ }
+ } 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/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSchema.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSchema.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSchema.java
new file mode 100644
index 0000000..bc141c5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSchema.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlSchema.SchemaDeserializer.class)
+class ClientCsdlSchema extends CsdlSchema {
+
+ private static final long serialVersionUID = 1911087363912024939L;
+
+ static class SchemaDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlSchema> {
+ @Override
+ protected ClientCsdlSchema doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlSchema schema = new ClientCsdlSchema();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Namespace".equals(jp.getCurrentName())) {
+ schema.setNamespace(jp.nextTextValue());
+ } else if ("Alias".equals(jp.getCurrentName())) {
+ schema.setAlias(jp.nextTextValue());
+ } else if ("ComplexType".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ schema.getComplexTypes().add(jp.readValueAs(ClientCsdlComplexType.class));
+ } else if ("EntityType".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ schema.getEntityTypes().add(jp.readValueAs(ClientCsdlEntityType.class));
+ } else if ("EnumType".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ schema.getEnumTypes().add(jp.readValueAs(ClientCsdlEnumType.class));
+ } else if ("EntityContainer".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ClientCsdlEntityContainer entityContainer = jp.readValueAs(ClientCsdlEntityContainer.class);
+ schema.setEntityContainer(entityContainer);
+ } else if ("Action".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ schema.getActions().add(jp.readValueAs(ClientCsdlAction.class));
+ } else if ("Function".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ schema.getFunctions().add(jp.readValueAs(ClientCsdlFunction.class));
+ } else if ("TypeDefinition".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ schema.getTypeDefinitions().add(jp.readValueAs(ClientCsdlTypeDefinition.class));
+ }
+ } else if ("Annotations".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ schema.getAnnotationGroups().add(jp.readValueAs(ClientCsdlAnnotations.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ schema.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ } else if ("Term".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ schema.getTerms().add(jp.readValueAs(ClientCsdlTerm.class));
+ }
+ }
+
+ return schema;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSingleton.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSingleton.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSingleton.java
new file mode 100644
index 0000000..7a2d097
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlSingleton.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.CsdlSingleton;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlSingleton.SingletonDeserializer.class)
+class ClientCsdlSingleton extends CsdlSingleton {
+
+ private static final long serialVersionUID = 1656749615107151921L;
+
+ static class SingletonDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlSingleton> {
+ @Override
+ protected ClientCsdlSingleton doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlSingleton singleton = new ClientCsdlSingleton();
+
+ 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.setType(jp.nextTextValue());
+ } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ singleton.getNavigationPropertyBindings().add(
+ jp.readValueAs(ClientCsdlNavigationPropertyBinding.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ singleton.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return singleton;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTerm.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTerm.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTerm.java
new file mode 100644
index 0000000..b2cef22
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTerm.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.CsdlTerm;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+@JsonDeserialize(using = ClientCsdlTerm.TermDeserializer.class)
+class ClientCsdlTerm extends CsdlTerm {
+
+ private static final long serialVersionUID = -8350072064720586186L;
+
+ static class TermDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlTerm> {
+ @Override
+ protected ClientCsdlTerm doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlTerm term = new ClientCsdlTerm();
+
+ 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(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return term;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTwoParamsOpDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTwoParamsOpDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTwoParamsOpDynamicAnnotationExpression.java
new file mode 100644
index 0000000..b4d3732
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTwoParamsOpDynamicAnnotationExpression.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression;
+
+class ClientCsdlTwoParamsOpDynamicAnnotationExpression
+ extends AbstractClientCsdlDynamicAnnotationExpression implements TwoParamsOpDynamicAnnotationExpression {
+
+ private static final long serialVersionUID = 6241842185452451946L;
+
+ private Type type;
+
+ private DynamicAnnotationExpression left;
+
+ private DynamicAnnotationExpression right;
+
+ @Override
+ public Type getType() {
+ return type;
+ }
+
+ public void setType(final Type type) {
+ this.type = type;
+ }
+
+ @Override
+ public DynamicAnnotationExpression getLeftExpression() {
+ return left;
+ }
+
+ public void setLeftExpression(final DynamicAnnotationExpression left) {
+ this.left = left;
+ }
+
+ @Override
+ public DynamicAnnotationExpression getRightExpression() {
+ return right;
+ }
+
+ public void setRightExpression(final DynamicAnnotationExpression right) {
+ this.right = right;
+ }
+
+}
[5/5] olingo-odata4 git commit: [OLINGO-564] Renamed 'ClientCsdl'
classes
Posted by mi...@apache.org.
[OLINGO-564] Renamed 'ClientCsdl' classes
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/53b10f6b
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/53b10f6b
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/53b10f6b
Branch: refs/heads/OLINGO-564
Commit: 53b10f6b7f700f2c9147148669965ec732ad3d28
Parents: 3c09909
Author: Michael Bolz <mi...@sap.com>
Authored: Tue Apr 28 22:14:13 2015 +0200
Committer: Michael Bolz <mi...@sap.com>
Committed: Tue Apr 28 22:14:13 2015 +0200
----------------------------------------------------------------------
.../olingo/ext/proxy/AbstractService.java | 4 +-
.../client/core/edm/ClientCsdlEdmProvider.java | 212 +++++++++++
.../client/core/edm/ClientCsdlXMLMetadata.java | 75 ++++
.../client/core/edm/ClientEdmProvider.java | 212 -----------
.../client/core/edm/ClientXMLMetadata.java | 75 ----
...tAnnotatableDynamicAnnotationExpression.java | 38 --
.../xml/AbstractClientAnnotationExpression.java | 49 ---
...lAnnotatableDynamicAnnotationExpression.java | 38 ++
.../AbstractClientCsdlAnnotationExpression.java | 49 +++
...ctClientCsdlDynamicAnnotationExpression.java | 356 +++++++++++++++++++
.../xml/AbstractClientCsdlEdmDeserializer.java | 60 ++++
...tClientCsdlElementOrAttributeExpression.java | 37 ++
...stractClientDynamicAnnotationExpression.java | 356 -------------------
.../edm/xml/AbstractClientEdmDeserializer.java | 60 ----
...tractClientElementOrAttributeExpression.java | 37 --
.../client/core/edm/xml/ClientAction.java | 68 ----
.../client/core/edm/xml/ClientActionImport.java | 58 ---
.../client/core/edm/xml/ClientAnnotation.java | 66 ----
.../core/edm/xml/ClientAnnotationPath.java | 27 --
.../client/core/edm/xml/ClientAnnotations.java | 62 ----
.../olingo/client/core/edm/xml/ClientApply.java | 80 -----
.../olingo/client/core/edm/xml/ClientCast.java | 137 -------
.../client/core/edm/xml/ClientCollection.java | 64 ----
.../client/core/edm/xml/ClientComplexType.java | 72 ----
.../xml/ClientConstantAnnotationExpression.java | 52 ---
.../client/core/edm/xml/ClientCsdlAction.java | 68 ++++
.../core/edm/xml/ClientCsdlActionImport.java | 58 +++
.../core/edm/xml/ClientCsdlAnnotation.java | 66 ++++
.../core/edm/xml/ClientCsdlAnnotationPath.java | 27 ++
.../core/edm/xml/ClientCsdlAnnotations.java | 62 ++++
.../client/core/edm/xml/ClientCsdlApply.java | 80 +++++
.../client/core/edm/xml/ClientCsdlCast.java | 137 +++++++
.../core/edm/xml/ClientCsdlCollection.java | 64 ++++
.../core/edm/xml/ClientCsdlComplexType.java | 72 ++++
.../ClientCsdlConstantAnnotationExpression.java | 52 +++
.../core/edm/xml/ClientCsdlDataServices.java | 93 +++++
.../client/core/edm/xml/ClientCsdlEdmx.java | 95 +++++
.../core/edm/xml/ClientCsdlEntityContainer.java | 72 ++++
.../core/edm/xml/ClientCsdlEntityKey.java | 63 ++++
.../core/edm/xml/ClientCsdlEntitySet.java | 65 ++++
.../core/edm/xml/ClientCsdlEntityType.java | 76 ++++
.../core/edm/xml/ClientCsdlEnumMember.java | 57 +++
.../client/core/edm/xml/ClientCsdlEnumType.java | 65 ++++
.../client/core/edm/xml/ClientCsdlFunction.java | 69 ++++
.../core/edm/xml/ClientCsdlFunctionImport.java | 64 ++++
.../client/core/edm/xml/ClientCsdlIf.java | 61 ++++
.../client/core/edm/xml/ClientCsdlInclude.java | 76 ++++
.../edm/xml/ClientCsdlIncludeAnnotations.java | 88 +++++
.../client/core/edm/xml/ClientCsdlIsOf.java | 136 +++++++
.../core/edm/xml/ClientCsdlLabeledElement.java | 79 ++++
.../xml/ClientCsdlLabeledElementReference.java | 28 ++
.../edm/xml/ClientCsdlNavigationProperty.java | 80 +++++
.../ClientCsdlNavigationPropertyBinding.java | 67 ++++
.../xml/ClientCsdlNavigationPropertyPath.java | 28 ++
.../client/core/edm/xml/ClientCsdlNot.java | 39 ++
.../client/core/edm/xml/ClientCsdlNull.java | 51 +++
.../client/core/edm/xml/ClientCsdlOnDelete.java | 54 +++
.../core/edm/xml/ClientCsdlParameter.java | 84 +++++
.../client/core/edm/xml/ClientCsdlPath.java | 27 ++
.../client/core/edm/xml/ClientCsdlProperty.java | 88 +++++
.../core/edm/xml/ClientCsdlPropertyPath.java | 27 ++
.../core/edm/xml/ClientCsdlPropertyRef.java | 54 +++
.../core/edm/xml/ClientCsdlPropertyValue.java | 81 +++++
.../client/core/edm/xml/ClientCsdlRecord.java | 76 ++++
.../core/edm/xml/ClientCsdlReference.java | 98 +++++
.../xml/ClientCsdlReferentialConstraint.java | 54 +++
.../core/edm/xml/ClientCsdlReturnType.java | 78 ++++
.../client/core/edm/xml/ClientCsdlSchema.java | 86 +++++
.../core/edm/xml/ClientCsdlSingleton.java | 62 ++++
.../client/core/edm/xml/ClientCsdlTerm.java | 83 +++++
...lTwoParamsOpDynamicAnnotationExpression.java | 62 ++++
.../core/edm/xml/ClientCsdlTypeDefinition.java | 74 ++++
.../client/core/edm/xml/ClientCsdlUrlRef.java | 65 ++++
.../client/core/edm/xml/ClientDataServices.java | 93 -----
.../olingo/client/core/edm/xml/ClientEdmx.java | 95 -----
.../core/edm/xml/ClientEntityContainer.java | 72 ----
.../client/core/edm/xml/ClientEntityKey.java | 63 ----
.../client/core/edm/xml/ClientEntitySet.java | 65 ----
.../client/core/edm/xml/ClientEntityType.java | 76 ----
.../client/core/edm/xml/ClientEnumMember.java | 57 ---
.../client/core/edm/xml/ClientEnumType.java | 65 ----
.../client/core/edm/xml/ClientFunction.java | 69 ----
.../core/edm/xml/ClientFunctionImport.java | 64 ----
.../olingo/client/core/edm/xml/ClientIf.java | 61 ----
.../client/core/edm/xml/ClientInclude.java | 76 ----
.../core/edm/xml/ClientIncludeAnnotations.java | 88 -----
.../olingo/client/core/edm/xml/ClientIsOf.java | 136 -------
.../core/edm/xml/ClientLabeledElement.java | 79 ----
.../edm/xml/ClientLabeledElementReference.java | 28 --
.../core/edm/xml/ClientNavigationProperty.java | 80 -----
.../xml/ClientNavigationPropertyBinding.java | 67 ----
.../edm/xml/ClientNavigationPropertyPath.java | 28 --
.../olingo/client/core/edm/xml/ClientNot.java | 39 --
.../olingo/client/core/edm/xml/ClientNull.java | 51 ---
.../client/core/edm/xml/ClientOnDelete.java | 54 ---
.../client/core/edm/xml/ClientParameter.java | 84 -----
.../olingo/client/core/edm/xml/ClientPath.java | 27 --
.../client/core/edm/xml/ClientProperty.java | 88 -----
.../client/core/edm/xml/ClientPropertyPath.java | 27 --
.../client/core/edm/xml/ClientPropertyRef.java | 54 ---
.../core/edm/xml/ClientPropertyValue.java | 80 -----
.../client/core/edm/xml/ClientRecord.java | 76 ----
.../client/core/edm/xml/ClientReference.java | 98 -----
.../edm/xml/ClientReferentialConstraint.java | 54 ---
.../client/core/edm/xml/ClientReturnType.java | 78 ----
.../client/core/edm/xml/ClientSchema.java | 86 -----
.../client/core/edm/xml/ClientSingleton.java | 62 ----
.../olingo/client/core/edm/xml/ClientTerm.java | 83 -----
...tTwoParamsOpDynamicAnnotationExpression.java | 62 ----
.../core/edm/xml/ClientTypeDefinition.java | 74 ----
.../client/core/edm/xml/ClientUrlRef.java | 65 ----
.../ClientODataDeserializerImpl.java | 6 +-
.../core/serialization/ODataReaderImpl.java | 4 +-
113 files changed, 4125 insertions(+), 4124 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java
index 8770286..f8506c2 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/AbstractService.java
@@ -30,7 +30,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.olingo.client.api.EdmEnabledODataClient;
import org.apache.olingo.client.api.edm.xml.XMLMetadata;
import org.apache.olingo.client.core.ODataClientFactory;
-import org.apache.olingo.client.core.edm.ClientEdmProvider;
+import org.apache.olingo.client.core.edm.ClientCsdlEdmProvider;
import org.apache.olingo.commons.api.ODataRuntimeException;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
@@ -86,7 +86,7 @@ public abstract class AbstractService<C extends EdmEnabledODataClient> {
}
final Edm edm;
if (metadata != null) {
- ClientEdmProvider provider = new ClientEdmProvider(metadata.getSchemaByNsOrAlias());
+ ClientCsdlEdmProvider provider = new ClientCsdlEdmProvider(metadata.getSchemaByNsOrAlias());
edm = new EdmProviderImpl(provider);
}else{
edm = null;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlEdmProvider.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlEdmProvider.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlEdmProvider.java
new file mode 100644
index 0000000..28536ba
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlEdmProvider.java
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider;
+import org.apache.olingo.commons.api.edm.provider.CsdlAction;
+import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;
+import org.apache.olingo.commons.api.edm.provider.CsdlAliasInfo;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations;
+import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;
+import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer;
+import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo;
+import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet;
+import org.apache.olingo.commons.api.edm.provider.CsdlEntityType;
+import org.apache.olingo.commons.api.edm.provider.CsdlEnumType;
+import org.apache.olingo.commons.api.edm.provider.CsdlFunction;
+import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport;
+import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
+import org.apache.olingo.commons.api.edm.provider.CsdlSingleton;
+import org.apache.olingo.commons.api.edm.provider.CsdlTerm;
+import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition;
+
+public class ClientCsdlEdmProvider extends CsdlAbstractEdmProvider {
+
+ private final Map<String, CsdlSchema> xmlSchemas;
+
+ public ClientCsdlEdmProvider(Map<String, CsdlSchema> xmlSchemas) {
+ this.xmlSchemas = xmlSchemas;
+ }
+
+ @Override
+ public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(enumTypeName.getNamespace());
+ if (schema != null) {
+ return schema.getEnumType(enumTypeName.getName());
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(typeDefinitionName.getNamespace());
+ if (schema != null) {
+ return schema.getTypeDefinition(typeDefinitionName.getName());
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(entityTypeName.getNamespace());
+ if (schema != null) {
+ return schema.getEntityType(entityTypeName.getName());
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(complexTypeName.getNamespace());
+ if (schema != null) {
+ return schema.getComplexType(complexTypeName.getName());
+ }
+ return null;
+ }
+
+ @Override
+ public List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(actionName.getNamespace());
+ if (schema != null) {
+ return schema.getActions(actionName.getName());
+ }
+ return null;
+ }
+
+ @Override
+ public List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(functionName.getNamespace());
+ if (schema != null) {
+ return schema.getFunctions(functionName.getName());
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(termName.getNamespace());
+ if (schema != null) {
+ return schema.getTerm(termName.getName());
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
+ throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace());
+ if (schema != null) {
+ return schema.getEntityContainer().getEntitySet(entitySetName);
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
+ throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace());
+ if (schema != null) {
+ return schema.getEntityContainer().getSingleton(singletonName);
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
+ throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace());
+ if (schema != null) {
+ return schema.getEntityContainer().getActionImport(actionImportName);
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
+ throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace());
+ if (schema != null) {
+ return schema.getEntityContainer().getFunctionImport(functionImportName);
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName)
+ throws ODataException {
+ for (CsdlSchema schema : xmlSchemas.values()) {
+ if (schema.getEntityContainer() != null) {
+ return new CsdlEntityContainerInfo().setContainerName(entityContainerName).setExtendsContainer(
+ schema.getEntityContainer().getExtendsContainerFQN());
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public List<CsdlAliasInfo> getAliasInfos() throws ODataException {
+ ArrayList<CsdlAliasInfo> aliasInfo = new ArrayList<CsdlAliasInfo>();
+ for (CsdlSchema schema : xmlSchemas.values()) {
+ if (schema.getAlias() != null) {
+ aliasInfo.add(new CsdlAliasInfo().setNamespace(schema.getNamespace()).setAlias(schema.getAlias()));
+ }
+ }
+ return aliasInfo;
+ }
+
+ @Override
+ public List<CsdlSchema> getSchemas() throws ODataException {
+ return new ArrayList<CsdlSchema>(xmlSchemas.values());
+ }
+
+ @Override
+ public CsdlEntityContainer getEntityContainer() throws ODataException {
+ for (CsdlSchema schema : xmlSchemas.values()) {
+ if (schema.getEntityContainer() != null) {
+ return schema.getEntityContainer();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException {
+ CsdlSchema schema = xmlSchemas.get(targetName.getNamespace());
+ if (schema != null) {
+ return schema.getAnnotationGroup(targetName.getName());
+ }
+ return null;
+ }
+
+ @Override
+ public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException {
+ final CsdlSchema schema = xmlSchemas.get(annotatedName.getNamespace());
+ if (schema != null) {
+ return schema.getAnnotatables().get(annotatedName.getName());
+ }
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlXMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlXMLMetadata.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlXMLMetadata.java
new file mode 100644
index 0000000..b4f7743
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientCsdlXMLMetadata.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.edm.xml.Edmx;
+import org.apache.olingo.client.api.edm.xml.Reference;
+import org.apache.olingo.client.api.edm.xml.XMLMetadata;
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
+import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
+
+/**
+ * Entry point for access information about EDM metadata.
+ */
+public class ClientCsdlXMLMetadata extends CsdlAbstractEdmItem implements XMLMetadata {
+
+ private static final long serialVersionUID = 6025723060298454901L;
+ protected final Edmx edmx;
+
+ public ClientCsdlXMLMetadata(final Edmx edmx) {
+ this.edmx = edmx;
+ }
+
+ @Override
+ public List<CsdlSchema> getSchemas() {
+ return this.edmx.getDataServices().getSchemas();
+ }
+
+ @Override
+ public CsdlSchema getSchema(final int index) {
+ return getSchemas().get(index);
+ }
+
+ @Override
+ public CsdlSchema getSchema(final String key) {
+ return getSchemaByNsOrAlias().get(key);
+ }
+
+ @Override
+ public Map<String, CsdlSchema> getSchemaByNsOrAlias() {
+ final Map<String, CsdlSchema> schemaByNsOrAlias = new HashMap<String, CsdlSchema>();
+ for (CsdlSchema schema : getSchemas()) {
+ schemaByNsOrAlias.put(schema.getNamespace(), schema);
+ if (StringUtils.isNotBlank(schema.getAlias())) {
+ schemaByNsOrAlias.put(schema.getAlias(), schema);
+ }
+ }
+ return schemaByNsOrAlias;
+ }
+
+ @Override
+ public List<Reference> getReferences() {
+ return this.edmx.getReferences();
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientEdmProvider.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientEdmProvider.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientEdmProvider.java
deleted file mode 100644
index 6284ade..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientEdmProvider.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmProvider;
-import org.apache.olingo.commons.api.edm.provider.CsdlAction;
-import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;
-import org.apache.olingo.commons.api.edm.provider.CsdlAliasInfo;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations;
-import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;
-import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer;
-import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainerInfo;
-import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet;
-import org.apache.olingo.commons.api.edm.provider.CsdlEntityType;
-import org.apache.olingo.commons.api.edm.provider.CsdlEnumType;
-import org.apache.olingo.commons.api.edm.provider.CsdlFunction;
-import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport;
-import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
-import org.apache.olingo.commons.api.edm.provider.CsdlSingleton;
-import org.apache.olingo.commons.api.edm.provider.CsdlTerm;
-import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition;
-
-public class ClientEdmProvider extends CsdlAbstractEdmProvider {
-
- private final Map<String, CsdlSchema> xmlSchemas;
-
- public ClientEdmProvider(Map<String, CsdlSchema> xmlSchemas) {
- this.xmlSchemas = xmlSchemas;
- }
-
- @Override
- public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
- CsdlSchema schema = xmlSchemas.get(enumTypeName.getNamespace());
- if (schema != null) {
- return schema.getEnumType(enumTypeName.getName());
- }
- return null;
- }
-
- @Override
- public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException {
- CsdlSchema schema = xmlSchemas.get(typeDefinitionName.getNamespace());
- if (schema != null) {
- return schema.getTypeDefinition(typeDefinitionName.getName());
- }
- return null;
- }
-
- @Override
- public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
- CsdlSchema schema = xmlSchemas.get(entityTypeName.getNamespace());
- if (schema != null) {
- return schema.getEntityType(entityTypeName.getName());
- }
- return null;
- }
-
- @Override
- public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
- CsdlSchema schema = xmlSchemas.get(complexTypeName.getNamespace());
- if (schema != null) {
- return schema.getComplexType(complexTypeName.getName());
- }
- return null;
- }
-
- @Override
- public List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException {
- CsdlSchema schema = xmlSchemas.get(actionName.getNamespace());
- if (schema != null) {
- return schema.getActions(actionName.getName());
- }
- return null;
- }
-
- @Override
- public List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException {
- CsdlSchema schema = xmlSchemas.get(functionName.getNamespace());
- if (schema != null) {
- return schema.getFunctions(functionName.getName());
- }
- return null;
- }
-
- @Override
- public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException {
- CsdlSchema schema = xmlSchemas.get(termName.getNamespace());
- if (schema != null) {
- return schema.getTerm(termName.getName());
- }
- return null;
- }
-
- @Override
- public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
- throws ODataException {
- CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace());
- if (schema != null) {
- return schema.getEntityContainer().getEntitySet(entitySetName);
- }
- return null;
- }
-
- @Override
- public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
- throws ODataException {
- CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace());
- if (schema != null) {
- return schema.getEntityContainer().getSingleton(singletonName);
- }
- return null;
- }
-
- @Override
- public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
- throws ODataException {
- CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace());
- if (schema != null) {
- return schema.getEntityContainer().getActionImport(actionImportName);
- }
- return null;
- }
-
- @Override
- public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
- throws ODataException {
- CsdlSchema schema = xmlSchemas.get(entityContainer.getNamespace());
- if (schema != null) {
- return schema.getEntityContainer().getFunctionImport(functionImportName);
- }
- return null;
- }
-
- @Override
- public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName)
- throws ODataException {
- for (CsdlSchema schema : xmlSchemas.values()) {
- if (schema.getEntityContainer() != null) {
- return new CsdlEntityContainerInfo().setContainerName(entityContainerName).setExtendsContainer(
- schema.getEntityContainer().getExtendsContainerFQN());
- }
- }
- return null;
- }
-
- @Override
- public List<CsdlAliasInfo> getAliasInfos() throws ODataException {
- ArrayList<CsdlAliasInfo> aliasInfo = new ArrayList<CsdlAliasInfo>();
- for (CsdlSchema schema : xmlSchemas.values()) {
- if (schema.getAlias() != null) {
- aliasInfo.add(new CsdlAliasInfo().setNamespace(schema.getNamespace()).setAlias(schema.getAlias()));
- }
- }
- return aliasInfo;
- }
-
- @Override
- public List<CsdlSchema> getSchemas() throws ODataException {
- return new ArrayList<CsdlSchema>(xmlSchemas.values());
- }
-
- @Override
- public CsdlEntityContainer getEntityContainer() throws ODataException {
- for (CsdlSchema schema : xmlSchemas.values()) {
- if (schema.getEntityContainer() != null) {
- return schema.getEntityContainer();
- }
- }
- return null;
- }
-
- @Override
- public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException {
- CsdlSchema schema = xmlSchemas.get(targetName.getNamespace());
- if (schema != null) {
- return schema.getAnnotationGroup(targetName.getName());
- }
- return null;
- }
-
- @Override
- public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException {
- final CsdlSchema schema = xmlSchemas.get(annotatedName.getNamespace());
- if (schema != null) {
- return schema.getAnnotatables().get(annotatedName.getName());
- }
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientXMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientXMLMetadata.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientXMLMetadata.java
deleted file mode 100644
index 96c07c2..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/ClientXMLMetadata.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.client.api.edm.xml.Edmx;
-import org.apache.olingo.client.api.edm.xml.Reference;
-import org.apache.olingo.client.api.edm.xml.XMLMetadata;
-import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
-import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
-
-/**
- * Entry point for access information about EDM metadata.
- */
-public class ClientXMLMetadata extends CsdlAbstractEdmItem implements XMLMetadata {
-
- private static final long serialVersionUID = 6025723060298454901L;
- protected final Edmx edmx;
-
- public ClientXMLMetadata(final Edmx edmx) {
- this.edmx = edmx;
- }
-
- @Override
- public List<CsdlSchema> getSchemas() {
- return this.edmx.getDataServices().getSchemas();
- }
-
- @Override
- public CsdlSchema getSchema(final int index) {
- return getSchemas().get(index);
- }
-
- @Override
- public CsdlSchema getSchema(final String key) {
- return getSchemaByNsOrAlias().get(key);
- }
-
- @Override
- public Map<String, CsdlSchema> getSchemaByNsOrAlias() {
- final Map<String, CsdlSchema> schemaByNsOrAlias = new HashMap<String, CsdlSchema>();
- for (CsdlSchema schema : getSchemas()) {
- schemaByNsOrAlias.put(schema.getNamespace(), schema);
- if (StringUtils.isNotBlank(schema.getAlias())) {
- schemaByNsOrAlias.put(schema.getAlias(), schema);
- }
- }
- return schemaByNsOrAlias;
- }
-
- @Override
- public List<Reference> getReferences() {
- return this.edmx.getReferences();
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotatableDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotatableDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotatableDynamicAnnotationExpression.java
deleted file mode 100644
index 052c4c7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotatableDynamicAnnotationExpression.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
-
-abstract class AbstractClientAnnotatableDynamicAnnotationExpression
- extends AbstractClientDynamicAnnotationExpression implements CsdlAnnotatable {
-
- private static final long serialVersionUID = -450668773857358139L;
-
- private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
-
- @Override
- public List<CsdlAnnotation> getAnnotations() {
- return annotations;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotationExpression.java
deleted file mode 100644
index bcdaf40..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientAnnotationExpression.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
-
-abstract class AbstractClientAnnotationExpression extends CsdlAbstractEdmItem 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/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlAnnotatableDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlAnnotatableDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlAnnotatableDynamicAnnotationExpression.java
new file mode 100644
index 0000000..68e98ae
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlAnnotatableDynamicAnnotationExpression.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.commons.api.edm.provider.CsdlAnnotatable;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
+
+abstract class AbstractClientCsdlAnnotatableDynamicAnnotationExpression
+ extends AbstractClientCsdlDynamicAnnotationExpression implements CsdlAnnotatable {
+
+ private static final long serialVersionUID = -450668773857358139L;
+
+ private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlAnnotationExpression.java
new file mode 100644
index 0000000..d362dfd
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlAnnotationExpression.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;
+
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
+import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
+
+abstract class AbstractClientCsdlAnnotationExpression extends CsdlAbstractEdmItem 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/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlDynamicAnnotationExpression.java
new file mode 100644
index 0000000..229ef87
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlDynamicAnnotationExpression.java
@@ -0,0 +1,356 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonLocation;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.ClassUtils;
+import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationPath;
+import org.apache.olingo.commons.api.edm.provider.annotation.Apply;
+import org.apache.olingo.commons.api.edm.provider.annotation.Cast;
+import org.apache.olingo.commons.api.edm.provider.annotation.Collection;
+import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.If;
+import org.apache.olingo.commons.api.edm.provider.annotation.IsOf;
+import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElement;
+import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElementReference;
+import org.apache.olingo.commons.api.edm.provider.annotation.NavigationPropertyPath;
+import org.apache.olingo.commons.api.edm.provider.annotation.Not;
+import org.apache.olingo.commons.api.edm.provider.annotation.Null;
+import org.apache.olingo.commons.api.edm.provider.annotation.Path;
+import org.apache.olingo.commons.api.edm.provider.annotation.PropertyPath;
+import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue;
+import org.apache.olingo.commons.api.edm.provider.annotation.Record;
+import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.UrlRef;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = AbstractClientCsdlDynamicAnnotationExpression.DynamicAnnotationExpressionDeserializer.class)
+abstract class AbstractClientCsdlDynamicAnnotationExpression
+ extends AbstractClientCsdlAnnotationExpression 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;
+ }
+
+ static class DynamicAnnotationExpressionDeserializer
+ extends AbstractClientCsdlEdmDeserializer<AbstractClientCsdlDynamicAnnotationExpression> {
+
+ private static final String[] EL_OR_ATTR = {
+ AnnotationPath.class.getSimpleName(), NavigationPropertyPath.class.getSimpleName(),
+ Path.class.getSimpleName(), PropertyPath.class.getSimpleName()
+ };
+
+ private static final String APPLY = Apply.class.getSimpleName();
+ private static final String CAST = Cast.class.getSimpleName();
+ private static final String COLLECTION = Collection.class.getSimpleName();
+ private static final String IF = If.class.getSimpleName();
+ private static final String IS_OF = IsOf.class.getSimpleName();
+ private static final String LABELED_ELEMENT = LabeledElement.class.getSimpleName();
+ private static final String NULL = Null.class.getSimpleName();
+ private static final String RECORD = Record.class.getSimpleName();
+ private static final String URL_REF = UrlRef.class.getSimpleName();
+
+ private AbstractClientCsdlElementOrAttributeExpression getElementOrAttributeExpression(final String simpleClassName)
+ throws JsonParseException {
+
+ try {
+ @SuppressWarnings("unchecked")
+ Class<? extends AbstractClientCsdlElementOrAttributeExpression> elOrAttrClass =
+ (Class<? extends AbstractClientCsdlElementOrAttributeExpression>) ClassUtils.getClass(
+ getClass().getPackage().getName() + ".ClientCsdl" + simpleClassName);
+ return elOrAttrClass.newInstance();
+ } catch (Exception e) {
+ throw new JsonParseException("Could not instantiate " + simpleClassName, JsonLocation.NA, e);
+ }
+ }
+
+ private AbstractClientCsdlAnnotationExpression parseConstOrEnumExpression(final JsonParser jp) throws IOException {
+ AbstractClientCsdlAnnotationExpression result;
+ if (isAnnotationConstExprConstruct(jp)) {
+ result = parseAnnotationConstExprConstruct(jp);
+ } else {
+ result = jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class);
+ }
+ jp.nextToken();
+
+ return result;
+ }
+
+ @Override
+ protected AbstractClientCsdlDynamicAnnotationExpression doDeserialize(final JsonParser jp,
+ final DeserializationContext ctxt) throws IOException {
+
+ AbstractClientCsdlDynamicAnnotationExpression expression = null;
+
+ if ("Not".equals(jp.getCurrentName())) {
+ final ClientCsdlNot not = new ClientCsdlNot();
+
+ jp.nextToken();
+ //Search for field name
+ while (jp.getCurrentToken() != JsonToken.FIELD_NAME) {
+ jp.nextToken();
+ }
+ not.setExpression(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ //Search for end object
+ while (jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals("Not")) {
+ jp.nextToken();
+ }
+
+ expression = not;
+ } else if (TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName()) != null) {
+ final ClientCsdlTwoParamsOpDynamicAnnotationExpression dynExprDoubleParamOp =
+ new ClientCsdlTwoParamsOpDynamicAnnotationExpression();
+ dynExprDoubleParamOp.setType(TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName()));
+
+ jp.nextToken();
+ //Search for field name
+ while (jp.getCurrentToken() != JsonToken.FIELD_NAME) {
+ jp.nextToken();
+ }
+ dynExprDoubleParamOp.setLeftExpression(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ dynExprDoubleParamOp.setRightExpression(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ //Search for expression
+ while (jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals(dynExprDoubleParamOp
+ .getType().name())) {
+ jp.nextToken();
+ }
+
+ expression = dynExprDoubleParamOp;
+ } else if (ArrayUtils.contains(EL_OR_ATTR, jp.getCurrentName())) {
+ final AbstractClientCsdlElementOrAttributeExpression elOrAttr =
+ getElementOrAttributeExpression(jp.getCurrentName());
+ elOrAttr.setValue(jp.nextTextValue());
+ expression = elOrAttr;
+ } else if (APPLY.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ expression = jp.readValueAs(ClientCsdlApply.class);
+ } else if (CAST.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ expression = jp.readValueAs(ClientCsdlCast.class);
+ } else if (COLLECTION.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ expression = jp.readValueAs(ClientCsdlCollection.class);
+ } else if (IF.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ jp.nextToken();
+
+ final ClientCsdlIf ifImpl = new ClientCsdlIf();
+ ifImpl.setGuard(parseConstOrEnumExpression(jp));
+ ifImpl.setThen(parseConstOrEnumExpression(jp));
+ ifImpl.setElse(parseConstOrEnumExpression(jp));
+
+ expression = ifImpl;
+ } else if (IS_OF.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ expression = jp.readValueAs(ClientCsdlIsOf.class);
+ } else if (LABELED_ELEMENT.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ expression = jp.readValueAs(ClientCsdlLabeledElement.class);
+ } else if (NULL.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ expression = jp.readValueAs(ClientCsdlNull.class);
+ } else if (RECORD.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ expression = jp.readValueAs(ClientCsdlRecord.class);
+ } else if (URL_REF.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ expression = jp.readValueAs(ClientCsdlUrlRef.class);
+ }
+
+ return expression;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlEdmDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlEdmDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlEdmDeserializer.java
new file mode 100644
index 0000000..c96654c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlEdmDeserializer.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser;
+
+abstract class AbstractClientCsdlEdmDeserializer<T> extends JsonDeserializer<T> {
+
+ protected boolean isAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
+ return ClientCsdlConstantAnnotationExpression.Type.fromString(jp.getCurrentName()) != null;
+ }
+
+ protected ClientCsdlConstantAnnotationExpression parseAnnotationConstExprConstruct(final JsonParser jp)
+ throws IOException {
+ final ClientCsdlConstantAnnotationExpression constExpr = new ClientCsdlConstantAnnotationExpression();
+ constExpr.setType(ClientCsdlConstantAnnotationExpression.Type.fromString(jp.getCurrentName()));
+ constExpr.setValue(jp.nextTextValue());
+ return constExpr;
+ }
+
+ protected ClientCsdlReturnType parseReturnType(final JsonParser jp, final String elementName) throws IOException {
+ final ClientCsdlReturnType returnType;
+ if (elementName.equals(((FromXmlParser) jp).getStaxReader().getLocalName())) {
+ returnType = new ClientCsdlReturnType();
+ returnType.setType(jp.nextTextValue());
+ } else {
+ jp.nextToken();
+ returnType = jp.readValueAs(ClientCsdlReturnType.class);
+ }
+ return returnType;
+ }
+
+ protected abstract T doDeserialize(JsonParser jp, DeserializationContext ctxt) throws IOException;
+
+ @Override
+ public T deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException {
+ return doDeserialize(jp, ctxt);
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlElementOrAttributeExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlElementOrAttributeExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlElementOrAttributeExpression.java
new file mode 100644
index 0000000..6c4c5cf
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlElementOrAttributeExpression.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;
+
+/**
+ * Groups dynamic expressions that may be provided using element notation or attribute notation.
+ */
+class AbstractClientCsdlElementOrAttributeExpression extends AbstractClientCsdlDynamicAnnotationExpression {
+
+ 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/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientDynamicAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientDynamicAnnotationExpression.java
deleted file mode 100644
index 8e8440e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientDynamicAnnotationExpression.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonLocation;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.ClassUtils;
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationPath;
-import org.apache.olingo.commons.api.edm.provider.annotation.Apply;
-import org.apache.olingo.commons.api.edm.provider.annotation.Cast;
-import org.apache.olingo.commons.api.edm.provider.annotation.Collection;
-import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.If;
-import org.apache.olingo.commons.api.edm.provider.annotation.IsOf;
-import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElement;
-import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElementReference;
-import org.apache.olingo.commons.api.edm.provider.annotation.NavigationPropertyPath;
-import org.apache.olingo.commons.api.edm.provider.annotation.Not;
-import org.apache.olingo.commons.api.edm.provider.annotation.Null;
-import org.apache.olingo.commons.api.edm.provider.annotation.Path;
-import org.apache.olingo.commons.api.edm.provider.annotation.PropertyPath;
-import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue;
-import org.apache.olingo.commons.api.edm.provider.annotation.Record;
-import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.UrlRef;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = AbstractClientDynamicAnnotationExpression.DynamicAnnotationExpressionDeserializer.class)
-abstract class AbstractClientDynamicAnnotationExpression
- extends AbstractClientAnnotationExpression 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;
- }
-
- static class DynamicAnnotationExpressionDeserializer
- extends AbstractClientEdmDeserializer<AbstractClientDynamicAnnotationExpression> {
-
- private static final String[] EL_OR_ATTR = {
- AnnotationPath.class.getSimpleName(), NavigationPropertyPath.class.getSimpleName(),
- Path.class.getSimpleName(), PropertyPath.class.getSimpleName()
- };
-
- private static final String APPLY = Apply.class.getSimpleName();
- private static final String CAST = Cast.class.getSimpleName();
- private static final String COLLECTION = Collection.class.getSimpleName();
- private static final String IF = If.class.getSimpleName();
- private static final String IS_OF = IsOf.class.getSimpleName();
- private static final String LABELED_ELEMENT = LabeledElement.class.getSimpleName();
- private static final String NULL = Null.class.getSimpleName();
- private static final String RECORD = Record.class.getSimpleName();
- private static final String URL_REF = UrlRef.class.getSimpleName();
-
- private AbstractClientElementOrAttributeExpression getElementOrAttributeExpression(final String simpleClassName)
- throws JsonParseException {
-
- try {
- @SuppressWarnings("unchecked")
- Class<? extends AbstractClientElementOrAttributeExpression> elOrAttrClass =
- (Class<? extends AbstractClientElementOrAttributeExpression>) ClassUtils.getClass(
- getClass().getPackage().getName() + ".Client" + simpleClassName);
- return elOrAttrClass.newInstance();
- } catch (Exception e) {
- throw new JsonParseException("Could not instantiate " + simpleClassName, JsonLocation.NA, e);
- }
- }
-
- private AbstractClientAnnotationExpression parseConstOrEnumExpression(final JsonParser jp) throws IOException {
- AbstractClientAnnotationExpression result;
- if (isAnnotationConstExprConstruct(jp)) {
- result = parseAnnotationConstExprConstruct(jp);
- } else {
- result = jp.readValueAs(AbstractClientDynamicAnnotationExpression.class);
- }
- jp.nextToken();
-
- return result;
- }
-
- @Override
- protected AbstractClientDynamicAnnotationExpression doDeserialize(final JsonParser jp,
- final DeserializationContext ctxt) throws IOException {
-
- AbstractClientDynamicAnnotationExpression expression = null;
-
- if ("Not".equals(jp.getCurrentName())) {
- final ClientNot not = new ClientNot();
-
- jp.nextToken();
- //Search for field name
- while (jp.getCurrentToken() != JsonToken.FIELD_NAME) {
- jp.nextToken();
- }
- not.setExpression(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- //Search for end object
- while (jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals("Not")) {
- jp.nextToken();
- }
-
- expression = not;
- } else if (TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName()) != null) {
- final ClientTwoParamsOpDynamicAnnotationExpression dynExprDoubleParamOp =
- new ClientTwoParamsOpDynamicAnnotationExpression();
- dynExprDoubleParamOp.setType(TwoParamsOpDynamicAnnotationExpression.Type.fromString(jp.getCurrentName()));
-
- jp.nextToken();
- //Search for field name
- while (jp.getCurrentToken() != JsonToken.FIELD_NAME) {
- jp.nextToken();
- }
- dynExprDoubleParamOp.setLeftExpression(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- dynExprDoubleParamOp.setRightExpression(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- //Search for expression
- while (jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals(dynExprDoubleParamOp
- .getType().name())) {
- jp.nextToken();
- }
-
- expression = dynExprDoubleParamOp;
- } else if (ArrayUtils.contains(EL_OR_ATTR, jp.getCurrentName())) {
- final AbstractClientElementOrAttributeExpression elOrAttr =
- getElementOrAttributeExpression(jp.getCurrentName());
- elOrAttr.setValue(jp.nextTextValue());
- expression = elOrAttr;
- } else if (APPLY.equals(jp.getCurrentName())) {
- jp.nextToken();
- expression = jp.readValueAs(ClientApply.class);
- } else if (CAST.equals(jp.getCurrentName())) {
- jp.nextToken();
- expression = jp.readValueAs(ClientCast.class);
- } else if (COLLECTION.equals(jp.getCurrentName())) {
- jp.nextToken();
- expression = jp.readValueAs(ClientCollection.class);
- } else if (IF.equals(jp.getCurrentName())) {
- jp.nextToken();
- jp.nextToken();
-
- final ClientIf ifImpl = new ClientIf();
- ifImpl.setGuard(parseConstOrEnumExpression(jp));
- ifImpl.setThen(parseConstOrEnumExpression(jp));
- ifImpl.setElse(parseConstOrEnumExpression(jp));
-
- expression = ifImpl;
- } else if (IS_OF.equals(jp.getCurrentName())) {
- jp.nextToken();
- expression = jp.readValueAs(ClientIsOf.class);
- } else if (LABELED_ELEMENT.equals(jp.getCurrentName())) {
- jp.nextToken();
- expression = jp.readValueAs(ClientLabeledElement.class);
- } else if (NULL.equals(jp.getCurrentName())) {
- jp.nextToken();
- expression = jp.readValueAs(ClientNull.class);
- } else if (RECORD.equals(jp.getCurrentName())) {
- jp.nextToken();
- expression = jp.readValueAs(ClientRecord.class);
- } else if (URL_REF.equals(jp.getCurrentName())) {
- jp.nextToken();
- expression = jp.readValueAs(ClientUrlRef.class);
- }
-
- return expression;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientEdmDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientEdmDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientEdmDeserializer.java
deleted file mode 100644
index 5447de6..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientEdmDeserializer.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.io.IOException;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser;
-
-abstract class AbstractClientEdmDeserializer<T> extends JsonDeserializer<T> {
-
- protected boolean isAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
- return ClientConstantAnnotationExpression.Type.fromString(jp.getCurrentName()) != null;
- }
-
- protected ClientConstantAnnotationExpression parseAnnotationConstExprConstruct(final JsonParser jp)
- throws IOException {
- final ClientConstantAnnotationExpression constExpr = new ClientConstantAnnotationExpression();
- constExpr.setType(ClientConstantAnnotationExpression.Type.fromString(jp.getCurrentName()));
- constExpr.setValue(jp.nextTextValue());
- return constExpr;
- }
-
- protected ClientReturnType parseReturnType(final JsonParser jp, final String elementName) throws IOException {
- final ClientReturnType returnType;
- if (elementName.equals(((FromXmlParser) jp).getStaxReader().getLocalName())) {
- returnType = new ClientReturnType();
- returnType.setType(jp.nextTextValue());
- } else {
- jp.nextToken();
- returnType = jp.readValueAs(ClientReturnType.class);
- }
- return returnType;
- }
-
- protected abstract T doDeserialize(JsonParser jp, DeserializationContext ctxt) throws IOException;
-
- @Override
- public T deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException {
- return doDeserialize(jp, ctxt);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientElementOrAttributeExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientElementOrAttributeExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientElementOrAttributeExpression.java
deleted file mode 100644
index 7bcbf90..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientElementOrAttributeExpression.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-/**
- * Groups dynamic expressions that may be provided using element notation or attribute notation.
- */
-class AbstractClientElementOrAttributeExpression extends AbstractClientDynamicAnnotationExpression {
-
- 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/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAction.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAction.java
deleted file mode 100644
index af274c5..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.provider.CsdlAction;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientAction.ActionDeserializer.class)
-class ClientAction extends CsdlAction {
-
- private static final long serialVersionUID = 5321541275349234088L;
-
- static class ActionDeserializer extends AbstractClientEdmDeserializer<ClientAction> {
-
- @Override
- protected ClientAction doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientAction action = new ClientAction();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- action.setName(jp.nextTextValue());
- } else if ("IsBound".equals(jp.getCurrentName())) {
- action.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("EntitySetPath".equals(jp.getCurrentName())) {
- action.setEntitySetPath(jp.nextTextValue());
- } else if ("Parameter".equals(jp.getCurrentName())) {
- jp.nextToken();
- action.getParameters().add(jp.readValueAs(ClientParameter.class));
- } else if ("ReturnType".equals(jp.getCurrentName())) {
- action.setReturnType(parseReturnType(jp, "Action"));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- action.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return action;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientActionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientActionImport.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientActionImport.java
deleted file mode 100644
index 2419332..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientActionImport.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientActionImport.ActionImportDeserializer.class)
-class ClientActionImport extends CsdlActionImport {
-
- private static final long serialVersionUID = 2971468441177647068L;
-
- static class ActionImportDeserializer extends AbstractClientEdmDeserializer<ClientActionImport> {
-
- @Override
- protected ClientActionImport doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientActionImport action = new ClientActionImport();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Action".equals(jp.getCurrentName())) {
- action.setAction(jp.nextTextValue());
- } else if ("Name".equals(jp.getCurrentName())) {
- action.setName(jp.nextTextValue());
- } else if ("EntitySet".equals(jp.getCurrentName())) {
- action.setEntitySet(jp.nextTextValue());
- }
- }
- }
-
- return action;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotation.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotation.java
deleted file mode 100644
index a8a978a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.io.IOException;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = ClientAnnotation.AnnotationDeserializer.class)
-class ClientAnnotation extends CsdlAnnotation {
-
- private static final long serialVersionUID = 5464714417411058033L;
-
- static class AnnotationDeserializer extends AbstractClientEdmDeserializer<CsdlAnnotation> {
-
- @Override
- protected CsdlAnnotation doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientAnnotation annotation = new ClientAnnotation();
-
- 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 ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- annotation.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- } else if (isAnnotationConstExprConstruct(jp)) {
- // Constant Expressions
- annotation.setExpression(parseAnnotationConstExprConstruct(jp));
- } else {
- // Dynamic Expressions
- annotation.setExpression(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- }
- }
- }
-
- return annotation;
- }
- }
-}
[4/5] olingo-odata4 git commit: [OLINGO-564] Renamed 'ClientCsdl'
classes
Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotationPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotationPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotationPath.java
deleted file mode 100644
index 7644c03..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotationPath.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationPath;
-
-class ClientAnnotationPath extends AbstractClientElementOrAttributeExpression implements AnnotationPath {
-
- private static final long serialVersionUID = 5360735207353494466L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotations.java
deleted file mode 100644
index d395706..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientAnnotations.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientAnnotations.AnnotationsDeserializer.class)
-class ClientAnnotations extends CsdlAnnotations {
-
- private static final long serialVersionUID = -5961207981571644200L;
-
- static class AnnotationsDeserializer extends AbstractClientEdmDeserializer<ClientAnnotations> {
-
- @Override
- protected ClientAnnotations doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientAnnotations annotations = new ClientAnnotations();
-
- for (; jp.getCurrentToken() != null && jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Target".equals(jp.getCurrentName())) {
- annotations.setTarget(jp.nextTextValue());
- } else if ("Qualifier".equals(jp.getCurrentName())) {
- annotations.setQualifier(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- annotations.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return annotations;
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientApply.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientApply.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientApply.java
deleted file mode 100644
index 9d89fc7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientApply.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.Apply;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = ClientApply.ApplyDeserializer.class)
-class ClientApply extends AbstractClientAnnotatableDynamicAnnotationExpression implements Apply {
-
- private static final long serialVersionUID = 4358398303405059879L;
-
- private String function;
-
- private final List<AnnotationExpression> parameters = new ArrayList<AnnotationExpression>();
-
- @Override
- public String getFunction() {
- return function;
- }
-
- public void setFunction(final String function) {
- this.function = function;
- }
-
- @Override
- public List<AnnotationExpression> getParameters() {
- return parameters;
- }
-
- static class ApplyDeserializer extends AbstractClientEdmDeserializer<ClientApply> {
-
- @Override
- protected ClientApply doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientApply apply = new ClientApply();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Function".equals(jp.getCurrentName())) {
- apply.setFunction(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- apply.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- } else if (isAnnotationConstExprConstruct(jp)) {
- apply.getParameters().add(parseAnnotationConstExprConstruct(jp));
- } else {
- apply.getParameters().add(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- }
- }
- }
-
- return apply;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCast.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCast.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCast.java
deleted file mode 100644
index 2160268..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCast.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.api.edm.provider.annotation.Cast;
-import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientCast.CastDeserializer.class)
-class ClientCast extends AbstractClientAnnotatableDynamicAnnotationExpression implements Cast {
-
- private static final long serialVersionUID = 3312415984116005313L;
-
- private String type;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- private SRID srid;
-
- private DynamicAnnotationExpression value;
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- @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 DynamicAnnotationExpression getValue() {
- return value;
- }
-
- public void setValue(final DynamicAnnotationExpression value) {
- this.value = value;
- }
-
- static class CastDeserializer extends AbstractClientEdmDeserializer<ClientCast> {
-
- @Override
- protected ClientCast doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientCast cast = new ClientCast();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Type".equals(jp.getCurrentName())) {
- cast.setType(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- cast.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- final String maxLenght = jp.nextTextValue();
- cast.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
- } else if ("Precision".equals(jp.getCurrentName())) {
- cast.setPrecision(Integer.valueOf(jp.nextTextValue()));
- } else if ("Scale".equals(jp.getCurrentName())) {
- final String scale = jp.nextTextValue();
- cast.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
- } else if ("SRID".equals(jp.getCurrentName())) {
- final String srid = jp.nextTextValue();
- if (srid != null) {
- cast.setSrid(SRID.valueOf(srid));
- }
- } else {
- cast.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- }
- }
- }
- return cast;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCollection.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCollection.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCollection.java
deleted file mode 100644
index 6dc43a9..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCollection.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.Collection;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = ClientCollection.CollectionDeserializer.class)
-class ClientCollection extends AbstractClientDynamicAnnotationExpression implements Collection {
-
- private static final long serialVersionUID = -724749123749715643L;
-
- private final List<AnnotationExpression> items = new ArrayList<AnnotationExpression>();
-
- @Override
- public List<AnnotationExpression> getItems() {
- return items;
- }
-
- static class CollectionDeserializer extends AbstractClientEdmDeserializer<ClientCollection> {
- @Override
- protected ClientCollection doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientCollection collection = new ClientCollection();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if (isAnnotationConstExprConstruct(jp)) {
- collection.getItems().add(parseAnnotationConstExprConstruct(jp));
- } else {
- collection.getItems().add(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- }
- }
- }
-
- return collection;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientComplexType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientComplexType.java
deleted file mode 100644
index 1f6e6de..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientComplexType.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or >ied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientComplexType.ComplexTypeDeserializer.class)
-class ClientComplexType extends CsdlComplexType {
-
- private static final long serialVersionUID = 4076944306925840115L;
-
- static class ComplexTypeDeserializer extends AbstractClientEdmDeserializer<CsdlComplexType> {
-
- @Override
- protected CsdlComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientComplexType complexType = new ClientComplexType();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- complexType.setName(jp.nextTextValue());
- } else if ("Abstract".equals(jp.getCurrentName())) {
- complexType.setAbstract(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("BaseType".equals(jp.getCurrentName())) {
- complexType.setBaseType(jp.nextTextValue());
- } else if ("OpenType".equals(jp.getCurrentName())) {
- complexType.setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Property".equals(jp.getCurrentName())) {
- jp.nextToken();
- complexType.getProperties().add(jp.readValueAs(ClientProperty.class));
- } else if ("NavigationProperty".equals(jp.getCurrentName())) {
- jp.nextToken();
- complexType.getNavigationProperties().add(jp.readValueAs(ClientNavigationProperty.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- complexType.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return complexType;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientConstantAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientConstantAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientConstantAnnotationExpression.java
deleted file mode 100644
index 6ff3fd3..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientConstantAnnotationExpression.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
-
-class ClientConstantAnnotationExpression
- extends AbstractClientAnnotationExpression implements ConstantAnnotationExpression {
-
- private static final long serialVersionUID = 5618680702707972904L;
-
- private Type type;
-
- private String value;
-
- @Override
- public Type getType() {
- return type;
- }
-
- @Override
- public void setType(final Type type) {
- this.type = type;
- }
-
- @Override
- public String getValue() {
- return value;
- }
-
- @Override
- public void setValue(final String value) {
- this.value = value;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAction.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAction.java
new file mode 100644
index 0000000..4514564
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAction.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.provider.CsdlAction;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlAction.ActionDeserializer.class)
+class ClientCsdlAction extends CsdlAction {
+
+ private static final long serialVersionUID = 5321541275349234088L;
+
+ static class ActionDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlAction> {
+
+ @Override
+ protected ClientCsdlAction doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlAction action = new ClientCsdlAction();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ action.setName(jp.nextTextValue());
+ } else if ("IsBound".equals(jp.getCurrentName())) {
+ action.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("EntitySetPath".equals(jp.getCurrentName())) {
+ action.setEntitySetPath(jp.nextTextValue());
+ } else if ("Parameter".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ action.getParameters().add(jp.readValueAs(ClientCsdlParameter.class));
+ } else if ("ReturnType".equals(jp.getCurrentName())) {
+ action.setReturnType(parseReturnType(jp, "Action"));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ action.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return action;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlActionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlActionImport.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlActionImport.java
new file mode 100644
index 0000000..ee6c69d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlActionImport.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 com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlActionImport.ActionImportDeserializer.class)
+class ClientCsdlActionImport extends CsdlActionImport {
+
+ private static final long serialVersionUID = 2971468441177647068L;
+
+ static class ActionImportDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlActionImport> {
+
+ @Override
+ protected ClientCsdlActionImport doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlActionImport action = new ClientCsdlActionImport();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Action".equals(jp.getCurrentName())) {
+ action.setAction(jp.nextTextValue());
+ } else if ("Name".equals(jp.getCurrentName())) {
+ action.setName(jp.nextTextValue());
+ } else if ("EntitySet".equals(jp.getCurrentName())) {
+ action.setEntitySet(jp.nextTextValue());
+ }
+ }
+ }
+
+ return action;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotation.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotation.java
new file mode 100644
index 0000000..5413444
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotation.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 com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ClientCsdlAnnotation.AnnotationDeserializer.class)
+class ClientCsdlAnnotation extends CsdlAnnotation {
+
+ private static final long serialVersionUID = 5464714417411058033L;
+
+ static class AnnotationDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlAnnotation> {
+
+ @Override
+ protected CsdlAnnotation doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlAnnotation annotation = new ClientCsdlAnnotation();
+
+ 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 ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ annotation.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ } else if (isAnnotationConstExprConstruct(jp)) {
+ // Constant Expressions
+ annotation.setExpression(parseAnnotationConstExprConstruct(jp));
+ } else {
+ // Dynamic Expressions
+ annotation.setExpression(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ }
+ }
+ }
+
+ return annotation;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotationPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotationPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotationPath.java
new file mode 100644
index 0000000..195f24b
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotationPath.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;
+
+import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationPath;
+
+class ClientCsdlAnnotationPath extends AbstractClientCsdlElementOrAttributeExpression implements AnnotationPath {
+
+ private static final long serialVersionUID = 5360735207353494466L;
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotations.java
new file mode 100644
index 0000000..c710a42
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotations.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlAnnotations.AnnotationsDeserializer.class)
+class ClientCsdlAnnotations extends CsdlAnnotations {
+
+ private static final long serialVersionUID = -5961207981571644200L;
+
+ static class AnnotationsDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlAnnotations> {
+
+ @Override
+ protected ClientCsdlAnnotations doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlAnnotations annotations = new ClientCsdlAnnotations();
+
+ for (; jp.getCurrentToken() != null && jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Target".equals(jp.getCurrentName())) {
+ annotations.setTarget(jp.nextTextValue());
+ } else if ("Qualifier".equals(jp.getCurrentName())) {
+ annotations.setQualifier(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ annotations.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return annotations;
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlApply.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlApply.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlApply.java
new file mode 100644
index 0000000..2d80c98
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlApply.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.Apply;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ClientCsdlApply.ApplyDeserializer.class)
+class ClientCsdlApply extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements Apply {
+
+ private static final long serialVersionUID = 4358398303405059879L;
+
+ private String function;
+
+ private final List<AnnotationExpression> parameters = new ArrayList<AnnotationExpression>();
+
+ @Override
+ public String getFunction() {
+ return function;
+ }
+
+ public void setFunction(final String function) {
+ this.function = function;
+ }
+
+ @Override
+ public List<AnnotationExpression> getParameters() {
+ return parameters;
+ }
+
+ static class ApplyDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlApply> {
+
+ @Override
+ protected ClientCsdlApply doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlApply apply = new ClientCsdlApply();
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Function".equals(jp.getCurrentName())) {
+ apply.setFunction(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ apply.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ } else if (isAnnotationConstExprConstruct(jp)) {
+ apply.getParameters().add(parseAnnotationConstExprConstruct(jp));
+ } else {
+ apply.getParameters().add(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ }
+ }
+ }
+
+ return apply;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCast.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCast.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCast.java
new file mode 100644
index 0000000..384f6fa
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCast.java
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.annotation.Cast;
+import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlCast.CastDeserializer.class)
+class ClientCsdlCast extends AbstractClientCsdlAnnotatableDynamicAnnotationExpression implements Cast {
+
+ private static final long serialVersionUID = 3312415984116005313L;
+
+ private String type;
+
+ private Integer maxLength;
+
+ private Integer precision;
+
+ private Integer scale;
+
+ private SRID srid;
+
+ private DynamicAnnotationExpression value;
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ @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 DynamicAnnotationExpression getValue() {
+ return value;
+ }
+
+ public void setValue(final DynamicAnnotationExpression value) {
+ this.value = value;
+ }
+
+ static class CastDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlCast> {
+
+ @Override
+ protected ClientCsdlCast doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlCast cast = new ClientCsdlCast();
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Type".equals(jp.getCurrentName())) {
+ cast.setType(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ cast.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ cast.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ cast.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ final String scale = jp.nextTextValue();
+ cast.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ final String srid = jp.nextTextValue();
+ if (srid != null) {
+ cast.setSrid(SRID.valueOf(srid));
+ }
+ } else {
+ cast.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ }
+ }
+ }
+ return cast;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCollection.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCollection.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCollection.java
new file mode 100644
index 0000000..cc9832b
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCollection.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.Collection;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ClientCsdlCollection.CollectionDeserializer.class)
+class ClientCsdlCollection extends AbstractClientCsdlDynamicAnnotationExpression implements Collection {
+
+ private static final long serialVersionUID = -724749123749715643L;
+
+ private final List<AnnotationExpression> items = new ArrayList<AnnotationExpression>();
+
+ @Override
+ public List<AnnotationExpression> getItems() {
+ return items;
+ }
+
+ static class CollectionDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlCollection> {
+ @Override
+ protected ClientCsdlCollection doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlCollection collection = new ClientCsdlCollection();
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if (isAnnotationConstExprConstruct(jp)) {
+ collection.getItems().add(parseAnnotationConstExprConstruct(jp));
+ } else {
+ collection.getItems().add(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ }
+ }
+ }
+
+ return collection;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlComplexType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlComplexType.java
new file mode 100644
index 0000000..0b59e99
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlComplexType.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 >ied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.provider.CsdlComplexType;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlComplexType.ComplexTypeDeserializer.class)
+class ClientCsdlComplexType extends CsdlComplexType {
+
+ private static final long serialVersionUID = 4076944306925840115L;
+
+ static class ComplexTypeDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlComplexType> {
+
+ @Override
+ protected CsdlComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlComplexType complexType = new ClientCsdlComplexType();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ complexType.setName(jp.nextTextValue());
+ } else if ("Abstract".equals(jp.getCurrentName())) {
+ complexType.setAbstract(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("BaseType".equals(jp.getCurrentName())) {
+ complexType.setBaseType(jp.nextTextValue());
+ } else if ("OpenType".equals(jp.getCurrentName())) {
+ complexType.setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Property".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ complexType.getProperties().add(jp.readValueAs(ClientCsdlProperty.class));
+ } else if ("NavigationProperty".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ complexType.getNavigationProperties().add(jp.readValueAs(ClientCsdlNavigationProperty.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ complexType.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return complexType;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlConstantAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlConstantAnnotationExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlConstantAnnotationExpression.java
new file mode 100644
index 0000000..26e067f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlConstantAnnotationExpression.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
+
+class ClientCsdlConstantAnnotationExpression
+ extends AbstractClientCsdlAnnotationExpression implements ConstantAnnotationExpression {
+
+ private static final long serialVersionUID = 5618680702707972904L;
+
+ private Type type;
+
+ private String value;
+
+ @Override
+ public Type getType() {
+ return type;
+ }
+
+ @Override
+ public void setType(final Type type) {
+ this.type = type;
+ }
+
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(final String value) {
+ this.value = value;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlDataServices.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlDataServices.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlDataServices.java
new file mode 100644
index 0000000..072ad0f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlDataServices.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.client.api.edm.xml.DataServices;
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
+import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ClientCsdlDataServices.DataServicesDeserializer.class)
+class ClientCsdlDataServices extends CsdlAbstractEdmItem implements DataServices {
+
+ private static final long serialVersionUID = 4200317286476885204L;
+
+ private final List<CsdlSchema> schemas = new ArrayList<CsdlSchema>();
+
+ private String dataServiceVersion;
+
+ private String maxDataServiceVersion;
+
+ @Override
+ public String getDataServiceVersion() {
+ return dataServiceVersion;
+ }
+
+ public void setDataServiceVersion(final String version) {
+ this.dataServiceVersion = version;
+ }
+
+ @Override
+ public String getMaxDataServiceVersion() {
+ return maxDataServiceVersion;
+ }
+
+ public void setMaxDataServiceVersion(final String version) {
+ this.maxDataServiceVersion = version;
+ }
+
+ @Override
+ public List<CsdlSchema> getSchemas() {
+ return schemas;
+ }
+
+ static class DataServicesDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlDataServices> {
+
+ @Override
+ protected ClientCsdlDataServices doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlDataServices dataServices = new ClientCsdlDataServices();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("DataServiceVersion".equals(jp.getCurrentName())) {
+ dataServices.setDataServiceVersion(jp.nextTextValue());
+ } else if ("MaxDataServiceVersion".equals(jp.getCurrentName())) {
+ dataServices.setMaxDataServiceVersion(jp.nextTextValue());
+ } else if ("Schema".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ dataServices.getSchemas().add(jp.readValueAs(ClientCsdlSchema.class));
+ }
+ }
+ }
+
+ return dataServices;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEdmx.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEdmx.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEdmx.java
new file mode 100644
index 0000000..ba0d26d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEdmx.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.client.api.edm.xml.DataServices;
+import org.apache.olingo.client.api.edm.xml.Edmx;
+import org.apache.olingo.client.api.edm.xml.Reference;
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ClientCsdlEdmx.EdmxDeserializer.class)
+public class ClientCsdlEdmx extends CsdlAbstractEdmItem implements Edmx {
+
+ private static final long serialVersionUID = -6293476719276092572L;
+
+ private final List<Reference> references = new ArrayList<Reference>();
+
+ private String version;
+
+ private DataServices dataServices;
+
+ @Override
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(final String version) {
+ this.version = version;
+ }
+
+ @Override
+ public DataServices getDataServices() {
+ return dataServices;
+ }
+
+ public void setDataServices(final DataServices dataServices) {
+ this.dataServices = dataServices;
+ }
+
+ @Override
+ public List<Reference> getReferences() {
+ return references;
+ }
+
+ static class EdmxDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlEdmx> {
+
+ @Override
+ protected ClientCsdlEdmx doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlEdmx edmx = new ClientCsdlEdmx();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Version".equals(jp.getCurrentName())) {
+ edmx.setVersion(jp.nextTextValue());
+ } else if ("DataServices".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ edmx.setDataServices(jp.readValueAs(ClientCsdlDataServices.class));
+ } else if ("Reference".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ edmx.getReferences().add(jp.readValueAs(ClientCsdlReference.class));
+ }
+ }
+ }
+
+ return edmx;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityContainer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityContainer.java
new file mode 100644
index 0000000..de83325
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityContainer.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlEntityContainer.EntityContainerDeserializer.class)
+class ClientCsdlEntityContainer extends CsdlEntityContainer {
+
+ private static final long serialVersionUID = 5631432527646955795L;
+
+ static class EntityContainerDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlEntityContainer> {
+
+ @Override
+ protected ClientCsdlEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlEntityContainer entityContainer = new ClientCsdlEntityContainer();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ entityContainer.setName(jp.nextTextValue());
+ } else if ("Extends".equals(jp.getCurrentName())) {
+ entityContainer.setExtendsContainer(jp.nextTextValue());
+ } else if ("EntitySet".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityContainer.getEntitySets().add(jp.readValueAs(ClientCsdlEntitySet.class));
+ } else if ("Singleton".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityContainer.getSingletons().add(jp.readValueAs(ClientCsdlSingleton.class));
+ } else if ("ActionImport".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityContainer.getActionImports().add(jp.readValueAs(ClientCsdlActionImport.class));
+ } else if ("FunctionImport".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityContainer.getFunctionImports().add(jp.readValueAs(ClientCsdlFunctionImport.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityContainer.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return entityContainer;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityKey.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityKey.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityKey.java
new file mode 100644
index 0000000..7be9a90
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityKey.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
+import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ClientCsdlEntityKey.EntityKeyDeserializer.class)
+class ClientCsdlEntityKey extends CsdlAbstractEdmItem {
+
+ private static final long serialVersionUID = 520227585458843347L;
+
+ private final List<CsdlPropertyRef> propertyRefs = new ArrayList<CsdlPropertyRef>();
+
+ public List<CsdlPropertyRef> getPropertyRefs() {
+ return propertyRefs;
+ }
+
+ static class EntityKeyDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlEntityKey> {
+ @Override
+ protected ClientCsdlEntityKey doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlEntityKey entityKey = new ClientCsdlEntityKey();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+
+ if (token == JsonToken.FIELD_NAME && "PropertyRef".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityKey.getPropertyRefs().add(jp.readValueAs(ClientCsdlPropertyRef.class));
+ }
+ }
+
+ return entityKey;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntitySet.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntitySet.java
new file mode 100644
index 0000000..6973a27
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntitySet.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlEntitySet.EntitySetDeserializer.class)
+class ClientCsdlEntitySet extends CsdlEntitySet {
+
+ private static final long serialVersionUID = -5553885465204370676L;
+
+ static class EntitySetDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlEntitySet> {
+ @Override
+ protected CsdlEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlEntitySet entitySet = new ClientCsdlEntitySet();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ entitySet.setName(jp.nextTextValue());
+ } else if ("EntityType".equals(jp.getCurrentName())) {
+ entitySet.setType(jp.nextTextValue());
+ } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
+ entitySet.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entitySet.getNavigationPropertyBindings().add(jp.readValueAs(ClientCsdlNavigationPropertyBinding.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entitySet.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return entitySet;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityType.java
new file mode 100644
index 0000000..f08bcbe
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEntityType.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.provider.CsdlEntityType;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlEntityType.EntityTypeDeserializer.class)
+class ClientCsdlEntityType extends CsdlEntityType {
+
+ private static final long serialVersionUID = -3986417775876689669L;
+
+ static class EntityTypeDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlEntityType> {
+ @Override
+ protected CsdlEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlEntityType entityType = new ClientCsdlEntityType();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ entityType.setName(jp.nextTextValue());
+ } else if ("Abstract".equals(jp.getCurrentName())) {
+ entityType.setAbstract(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("BaseType".equals(jp.getCurrentName())) {
+ entityType.setBaseType(jp.nextTextValue());
+ } else if ("OpenType".equals(jp.getCurrentName())) {
+ entityType.setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("HasStream".equals(jp.getCurrentName())) {
+ entityType.setHasStream(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Key".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ClientCsdlEntityKey keyImpl = jp.readValueAs(ClientCsdlEntityKey.class);
+ entityType.setKey(keyImpl.getPropertyRefs());
+ } else if ("Property".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityType.getProperties().add(jp.readValueAs(ClientCsdlProperty.class));
+ } else if ("NavigationProperty".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityType.getNavigationProperties().add(jp.readValueAs(ClientCsdlNavigationProperty.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityType.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return entityType;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumMember.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumMember.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumMember.java
new file mode 100644
index 0000000..057a678
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumMember.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 com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlEnumMember.EnumMemberDeserializer.class)
+class ClientCsdlEnumMember extends CsdlEnumMember {
+
+ private static final long serialVersionUID = -6138606817225829791L;
+
+ static class EnumMemberDeserializer extends AbstractClientCsdlEdmDeserializer<CsdlEnumMember> {
+ @Override
+ protected CsdlEnumMember doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final CsdlEnumMember member = new CsdlEnumMember();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ member.setName(jp.nextTextValue());
+ } else if ("Value".equals(jp.getCurrentName())) {
+ member.setValue(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ member.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+ return member;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumType.java
new file mode 100644
index 0000000..a49f3ff
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlEnumType.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.provider.CsdlEnumType;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlEnumType.EnumTypeDeserializer.class)
+class ClientCsdlEnumType extends CsdlEnumType {
+
+ private static final long serialVersionUID = 9191189755592743333L;
+
+ static class EnumTypeDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlEnumType> {
+ @Override
+ protected ClientCsdlEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlEnumType enumType = new ClientCsdlEnumType();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ enumType.setName(jp.nextTextValue());
+ } else if ("UnderlyingType".equals(jp.getCurrentName())) {
+ enumType.setUnderlyingType(jp.nextTextValue());
+ } else if ("IsFlags".equals(jp.getCurrentName())) {
+ enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Member".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ enumType.getMembers().add(jp.readValueAs(ClientCsdlEnumMember.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ enumType.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return enumType;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunction.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunction.java
new file mode 100644
index 0000000..97fd637
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlFunction.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 com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.provider.CsdlFunction;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlFunction.FunctionDeserializer.class)
+class ClientCsdlFunction extends CsdlFunction {
+
+ private static final long serialVersionUID = -5494898295282843362L;
+
+ static class FunctionDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlFunction> {
+ @Override
+ protected ClientCsdlFunction doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+
+ final ClientCsdlFunction functionImpl = new ClientCsdlFunction();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ functionImpl.setName(jp.nextTextValue());
+ } else if ("IsBound".equals(jp.getCurrentName())) {
+ functionImpl.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("IsComposable".equals(jp.getCurrentName())) {
+ functionImpl.setComposable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("EntitySetPath".equals(jp.getCurrentName())) {
+ functionImpl.setEntitySetPath(jp.nextTextValue());
+ } else if ("Parameter".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ functionImpl.getParameters().add(jp.readValueAs(ClientCsdlParameter.class));
+ } else if ("ReturnType".equals(jp.getCurrentName())) {
+ functionImpl.setReturnType(parseReturnType(jp, "Function"));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ functionImpl.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return functionImpl;
+ }
+ }
+}
[2/5] olingo-odata4 git commit: [OLINGO-564] Renamed 'ClientCsdl'
classes
Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTypeDefinition.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTypeDefinition.java
new file mode 100644
index 0000000..420f226
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTypeDefinition.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlTypeDefinition.TypeDefinitionDeserializer.class)
+class ClientCsdlTypeDefinition extends CsdlTypeDefinition {
+
+ private static final long serialVersionUID = -902407149079419602L;
+
+ static class TypeDefinitionDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlTypeDefinition> {
+ @Override
+ protected ClientCsdlTypeDefinition doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlTypeDefinition typeDefinition = new ClientCsdlTypeDefinition();
+
+ 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(ClientCsdlAnnotation.class));
+ }
+ }
+ }
+
+ return typeDefinition;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlUrlRef.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlUrlRef.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlUrlRef.java
new file mode 100644
index 0000000..280e1af
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlUrlRef.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.UrlRef;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+import java.io.IOException;
+
+@JsonDeserialize(using = ClientCsdlUrlRef.UrlRefDeserializer.class)
+class ClientCsdlUrlRef extends AbstractClientCsdlDynamicAnnotationExpression implements UrlRef {
+
+ private static final long serialVersionUID = -7693224811739000440L;
+
+ private AnnotationExpression value;
+
+ @Override
+ public AnnotationExpression getValue() {
+ return value;
+ }
+
+ public void setValue(final AnnotationExpression value) {
+ this.value = value;
+ }
+
+ static class UrlRefDeserializer extends AbstractClientCsdlEdmDeserializer<ClientCsdlUrlRef> {
+ @Override
+ protected ClientCsdlUrlRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException {
+ final ClientCsdlUrlRef urlref = new ClientCsdlUrlRef();
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if (isAnnotationConstExprConstruct(jp)) {
+ urlref.setValue(parseAnnotationConstExprConstruct(jp));
+ } else {
+ urlref.setValue(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ }
+ }
+ }
+ return urlref;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientDataServices.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientDataServices.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientDataServices.java
deleted file mode 100644
index d4a4406..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientDataServices.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.client.api.edm.xml.DataServices;
-import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
-import org.apache.olingo.commons.api.edm.provider.CsdlSchema;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = ClientDataServices.DataServicesDeserializer.class)
-class ClientDataServices extends CsdlAbstractEdmItem implements DataServices {
-
- private static final long serialVersionUID = 4200317286476885204L;
-
- private final List<CsdlSchema> schemas = new ArrayList<CsdlSchema>();
-
- private String dataServiceVersion;
-
- private String maxDataServiceVersion;
-
- @Override
- public String getDataServiceVersion() {
- return dataServiceVersion;
- }
-
- public void setDataServiceVersion(final String version) {
- this.dataServiceVersion = version;
- }
-
- @Override
- public String getMaxDataServiceVersion() {
- return maxDataServiceVersion;
- }
-
- public void setMaxDataServiceVersion(final String version) {
- this.maxDataServiceVersion = version;
- }
-
- @Override
- public List<CsdlSchema> getSchemas() {
- return schemas;
- }
-
- static class DataServicesDeserializer extends AbstractClientEdmDeserializer<ClientDataServices> {
-
- @Override
- protected ClientDataServices doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientDataServices dataServices = new ClientDataServices();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("DataServiceVersion".equals(jp.getCurrentName())) {
- dataServices.setDataServiceVersion(jp.nextTextValue());
- } else if ("MaxDataServiceVersion".equals(jp.getCurrentName())) {
- dataServices.setMaxDataServiceVersion(jp.nextTextValue());
- } else if ("Schema".equals(jp.getCurrentName())) {
- jp.nextToken();
- dataServices.getSchemas().add(jp.readValueAs(ClientSchema.class));
- }
- }
- }
-
- return dataServices;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEdmx.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEdmx.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEdmx.java
deleted file mode 100644
index 736030b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEdmx.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.client.api.edm.xml.DataServices;
-import org.apache.olingo.client.api.edm.xml.Edmx;
-import org.apache.olingo.client.api.edm.xml.Reference;
-import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = ClientEdmx.EdmxDeserializer.class)
-public class ClientEdmx extends CsdlAbstractEdmItem implements Edmx {
-
- private static final long serialVersionUID = -6293476719276092572L;
-
- private final List<Reference> references = new ArrayList<Reference>();
-
- private String version;
-
- private DataServices dataServices;
-
- @Override
- public String getVersion() {
- return version;
- }
-
- public void setVersion(final String version) {
- this.version = version;
- }
-
- @Override
- public DataServices getDataServices() {
- return dataServices;
- }
-
- public void setDataServices(final DataServices dataServices) {
- this.dataServices = dataServices;
- }
-
- @Override
- public List<Reference> getReferences() {
- return references;
- }
-
- static class EdmxDeserializer extends AbstractClientEdmDeserializer<ClientEdmx> {
-
- @Override
- protected ClientEdmx doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientEdmx edmx = new ClientEdmx();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Version".equals(jp.getCurrentName())) {
- edmx.setVersion(jp.nextTextValue());
- } else if ("DataServices".equals(jp.getCurrentName())) {
- jp.nextToken();
- edmx.setDataServices(jp.readValueAs(ClientDataServices.class));
- } else if ("Reference".equals(jp.getCurrentName())) {
- jp.nextToken();
- edmx.getReferences().add(jp.readValueAs(ClientReference.class));
- }
- }
- }
-
- return edmx;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityContainer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityContainer.java
deleted file mode 100644
index 2109cee..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityContainer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientEntityContainer.EntityContainerDeserializer.class)
-class ClientEntityContainer extends CsdlEntityContainer {
-
- private static final long serialVersionUID = 5631432527646955795L;
-
- static class EntityContainerDeserializer extends AbstractClientEdmDeserializer<ClientEntityContainer> {
-
- @Override
- protected ClientEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientEntityContainer entityContainer = new ClientEntityContainer();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- entityContainer.setName(jp.nextTextValue());
- } else if ("Extends".equals(jp.getCurrentName())) {
- entityContainer.setExtendsContainer(jp.nextTextValue());
- } else if ("EntitySet".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityContainer.getEntitySets().add(jp.readValueAs(ClientEntitySet.class));
- } else if ("Singleton".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityContainer.getSingletons().add(jp.readValueAs(ClientSingleton.class));
- } else if ("ActionImport".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityContainer.getActionImports().add(jp.readValueAs(ClientActionImport.class));
- } else if ("FunctionImport".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityContainer.getFunctionImports().add(jp.readValueAs(ClientFunctionImport.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityContainer.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return entityContainer;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityKey.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityKey.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityKey.java
deleted file mode 100644
index 6b9e230..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityKey.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
-import org.apache.olingo.commons.api.edm.provider.CsdlPropertyRef;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = ClientEntityKey.EntityKeyDeserializer.class)
-class ClientEntityKey extends CsdlAbstractEdmItem {
-
- private static final long serialVersionUID = 520227585458843347L;
-
- private final List<CsdlPropertyRef> propertyRefs = new ArrayList<CsdlPropertyRef>();
-
- public List<CsdlPropertyRef> getPropertyRefs() {
- return propertyRefs;
- }
-
- static class EntityKeyDeserializer extends AbstractClientEdmDeserializer<ClientEntityKey> {
- @Override
- protected ClientEntityKey doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientEntityKey entityKey = new ClientEntityKey();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
-
- if (token == JsonToken.FIELD_NAME && "PropertyRef".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityKey.getPropertyRefs().add(jp.readValueAs(ClientPropertyRef.class));
- }
- }
-
- return entityKey;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntitySet.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntitySet.java
deleted file mode 100644
index ca358cb..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntitySet.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.provider.CsdlEntitySet;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientEntitySet.EntitySetDeserializer.class)
-class ClientEntitySet extends CsdlEntitySet {
-
- private static final long serialVersionUID = -5553885465204370676L;
-
- static class EntitySetDeserializer extends AbstractClientEdmDeserializer<CsdlEntitySet> {
- @Override
- protected CsdlEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientEntitySet entitySet = new ClientEntitySet();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- entitySet.setName(jp.nextTextValue());
- } else if ("EntityType".equals(jp.getCurrentName())) {
- entitySet.setType(jp.nextTextValue());
- } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
- entitySet.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
- jp.nextToken();
- entitySet.getNavigationPropertyBindings().add(jp.readValueAs(ClientNavigationPropertyBinding.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- entitySet.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return entitySet;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityType.java
deleted file mode 100644
index ceef35e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEntityType.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.provider.CsdlEntityType;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientEntityType.EntityTypeDeserializer.class)
-class ClientEntityType extends CsdlEntityType {
-
- private static final long serialVersionUID = -3986417775876689669L;
-
- static class EntityTypeDeserializer extends AbstractClientEdmDeserializer<CsdlEntityType> {
- @Override
- protected CsdlEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientEntityType entityType = new ClientEntityType();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- entityType.setName(jp.nextTextValue());
- } else if ("Abstract".equals(jp.getCurrentName())) {
- entityType.setAbstract(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("BaseType".equals(jp.getCurrentName())) {
- entityType.setBaseType(jp.nextTextValue());
- } else if ("OpenType".equals(jp.getCurrentName())) {
- entityType.setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("HasStream".equals(jp.getCurrentName())) {
- entityType.setHasStream(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Key".equals(jp.getCurrentName())) {
- jp.nextToken();
- ClientEntityKey keyImpl = jp.readValueAs(ClientEntityKey.class);
- entityType.setKey(keyImpl.getPropertyRefs());
- } else if ("Property".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityType.getProperties().add(jp.readValueAs(ClientProperty.class));
- } else if ("NavigationProperty".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityType.getNavigationProperties().add(jp.readValueAs(ClientNavigationProperty.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- entityType.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return entityType;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumMember.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumMember.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumMember.java
deleted file mode 100644
index b72e2df..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumMember.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.commons.api.edm.provider.CsdlEnumMember;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientEnumMember.EnumMemberDeserializer.class)
-class ClientEnumMember extends CsdlEnumMember {
-
- private static final long serialVersionUID = -6138606817225829791L;
-
- static class EnumMemberDeserializer extends AbstractClientEdmDeserializer<CsdlEnumMember> {
- @Override
- protected CsdlEnumMember doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final CsdlEnumMember member = new CsdlEnumMember();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- member.setName(jp.nextTextValue());
- } else if ("Value".equals(jp.getCurrentName())) {
- member.setValue(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- member.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
- return member;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumType.java
deleted file mode 100644
index e64f1c8..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientEnumType.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.provider.CsdlEnumType;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientEnumType.EnumTypeDeserializer.class)
-class ClientEnumType extends CsdlEnumType {
-
- private static final long serialVersionUID = 9191189755592743333L;
-
- static class EnumTypeDeserializer extends AbstractClientEdmDeserializer<ClientEnumType> {
- @Override
- protected ClientEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientEnumType enumType = new ClientEnumType();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- enumType.setName(jp.nextTextValue());
- } else if ("UnderlyingType".equals(jp.getCurrentName())) {
- enumType.setUnderlyingType(jp.nextTextValue());
- } else if ("IsFlags".equals(jp.getCurrentName())) {
- enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Member".equals(jp.getCurrentName())) {
- jp.nextToken();
- enumType.getMembers().add(jp.readValueAs(ClientEnumMember.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- enumType.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return enumType;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunction.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunction.java
deleted file mode 100644
index c07b37e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.provider.CsdlFunction;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientFunction.FunctionDeserializer.class)
-class ClientFunction extends CsdlFunction {
-
- private static final long serialVersionUID = -5494898295282843362L;
-
- static class FunctionDeserializer extends AbstractClientEdmDeserializer<ClientFunction> {
- @Override
- protected ClientFunction doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientFunction functionImpl = new ClientFunction();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- functionImpl.setName(jp.nextTextValue());
- } else if ("IsBound".equals(jp.getCurrentName())) {
- functionImpl.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("IsComposable".equals(jp.getCurrentName())) {
- functionImpl.setComposable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("EntitySetPath".equals(jp.getCurrentName())) {
- functionImpl.setEntitySetPath(jp.nextTextValue());
- } else if ("Parameter".equals(jp.getCurrentName())) {
- jp.nextToken();
- functionImpl.getParameters().add(jp.readValueAs(ClientParameter.class));
- } else if ("ReturnType".equals(jp.getCurrentName())) {
- functionImpl.setReturnType(parseReturnType(jp, "Function"));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- functionImpl.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return functionImpl;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunctionImport.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunctionImport.java
deleted file mode 100644
index 25c3a91..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientFunctionImport.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientFunctionImport.FunctionImportDeserializer.class)
-class ClientFunctionImport extends CsdlFunctionImport {
-
- private static final long serialVersionUID = -1686801084142932402L;
-
- static class FunctionImportDeserializer extends AbstractClientEdmDeserializer<ClientFunctionImport> {
- @Override
- protected ClientFunctionImport doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientFunctionImport functImpImpl = new ClientFunctionImport();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- functImpImpl.setName(jp.nextTextValue());
- } else if ("Function".equals(jp.getCurrentName())) {
- functImpImpl.setFunction(jp.nextTextValue());
- } else if ("EntitySet".equals(jp.getCurrentName())) {
- functImpImpl.setEntitySet(jp.nextTextValue());
- } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
- functImpImpl.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- functImpImpl.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return functImpImpl;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIf.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIf.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIf.java
deleted file mode 100644
index 26d33e6..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIf.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.If;
-
-class ClientIf extends AbstractClientAnnotatableDynamicAnnotationExpression implements If {
-
- private static final long serialVersionUID = -8571383625077590656L;
-
- private AnnotationExpression guard;
-
- private AnnotationExpression _then;
-
- private AnnotationExpression _else;
-
- @Override
- public AnnotationExpression getGuard() {
- return guard;
- }
-
- public void setGuard(final AnnotationExpression guard) {
- this.guard = guard;
- }
-
- @Override
- public AnnotationExpression getThen() {
- return _then;
- }
-
- public void setThen(final AnnotationExpression _then) {
- this._then = _then;
- }
-
- @Override
- public AnnotationExpression getElse() {
- return _else;
- }
-
- public void setElse(final AnnotationExpression _else) {
- this._else = _else;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientInclude.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientInclude.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientInclude.java
deleted file mode 100644
index fafd3a4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientInclude.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.client.api.edm.xml.Include;
-import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientInclude.IncludeDeserializer.class)
-class ClientInclude extends CsdlAbstractEdmItem implements Include {
-
- private static final long serialVersionUID = -5450008299655584221L;
-
- private String namespace;
- private String alias;
-
- @Override
- public String getNamespace() {
- return namespace;
- }
-
- public void setNamespace(final String namespace) {
- this.namespace = namespace;
- }
-
- @Override
- public String getAlias() {
- return alias;
- }
-
- public void setAlias(final String alias) {
- this.alias = alias;
- }
-
- static class IncludeDeserializer extends AbstractClientEdmDeserializer<Include> {
- @Override
- protected Include doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientInclude include = new ClientInclude();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Namespace".equals(jp.getCurrentName())) {
- include.setNamespace(jp.nextTextValue());
- } else if ("Alias".equals(jp.getCurrentName())) {
- include.setAlias(jp.nextTextValue());
- }
- }
- }
- return include;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIncludeAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIncludeAnnotations.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIncludeAnnotations.java
deleted file mode 100644
index 3617c65..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIncludeAnnotations.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
-import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientIncludeAnnotations.IncludeAnnotationsDeserializer.class)
-class ClientIncludeAnnotations extends CsdlAbstractEdmItem implements IncludeAnnotations {
-
- private static final long serialVersionUID = -8157841387011422396L;
-
- private String termNamespace;
- private String qualifier;
- private String targetNamespace;
-
- @Override
- public String getTermNamespace() {
- return termNamespace;
- }
-
- public void setTermNamespace(final String termNamespace) {
- this.termNamespace = termNamespace;
- }
-
- @Override
- public String getQualifier() {
- return qualifier;
- }
-
- public void setQualifier(final String qualifier) {
- this.qualifier = qualifier;
- }
-
- @Override
- public String getTargetNamespace() {
- return targetNamespace;
- }
-
- public void setTargetNamespace(final String targetNamespace) {
- this.targetNamespace = targetNamespace;
- }
-
- static class IncludeAnnotationsDeserializer extends AbstractClientEdmDeserializer<IncludeAnnotations> {
- @Override
- protected IncludeAnnotations doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientIncludeAnnotations member = new ClientIncludeAnnotations();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("TermNamespace".equals(jp.getCurrentName())) {
- member.setTermNamespace(jp.nextTextValue());
- } else if ("Qualifier".equals(jp.getCurrentName())) {
- member.setQualifier(jp.nextTextValue());
- } else if ("TargetNamespace".equals(jp.getCurrentName())) {
- member.setTargetNamespace(jp.nextTextValue());
- }
- }
- }
- return member;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIsOf.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIsOf.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIsOf.java
deleted file mode 100644
index bae05ac..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientIsOf.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.IsOf;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientIsOf.IsOfDeserializer.class)
-class ClientIsOf extends AbstractClientAnnotatableDynamicAnnotationExpression implements IsOf {
-
- private static final long serialVersionUID = -893355856129761174L;
-
- private String type;
-
- private Integer maxLength;
-
- private Integer precision;
-
- private Integer scale;
-
- private SRID srid;
-
- private DynamicAnnotationExpression value;
-
- @Override
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- @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 DynamicAnnotationExpression getValue() {
- return value;
- }
-
- public void setValue(final DynamicAnnotationExpression value) {
- this.value = value;
- }
-
- static class IsOfDeserializer extends AbstractClientEdmDeserializer<ClientIsOf> {
- @Override
- protected ClientIsOf doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientIsOf isof = new ClientIsOf();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Type".equals(jp.getCurrentName())) {
- isof.setType(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- isof.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- final String maxLenght = jp.nextTextValue();
- isof.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
- } else if ("Precision".equals(jp.getCurrentName())) {
- isof.setPrecision(Integer.valueOf(jp.nextTextValue()));
- } else if ("Scale".equals(jp.getCurrentName())) {
- final String scale = jp.nextTextValue();
- isof.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
- } else if ("SRID".equals(jp.getCurrentName())) {
- final String srid = jp.nextTextValue();
- if (srid != null) {
- isof.setSrid(SRID.valueOf(srid));
- }
- } else {
- isof.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- }
- }
- }
- return isof;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientLabeledElement.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientLabeledElement.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientLabeledElement.java
deleted file mode 100644
index 5ae9a89..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientLabeledElement.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElement;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientLabeledElement.LabeledElementDeserializer.class)
-class ClientLabeledElement
- extends AbstractClientAnnotatableDynamicAnnotationExpression implements LabeledElement {
-
- private static final long serialVersionUID = 4909387630253341824L;
-
- private String name;
-
- private DynamicAnnotationExpression value;
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- @Override
- public DynamicAnnotationExpression getValue() {
- return value;
- }
-
- public void setValue(final DynamicAnnotationExpression value) {
- this.value = value;
- }
-
- static class LabeledElementDeserializer extends AbstractClientEdmDeserializer<ClientLabeledElement> {
- @Override
- protected ClientLabeledElement doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientLabeledElement element = new ClientLabeledElement();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- element.setName(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- element.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- } else {
- element.setValue(jp.readValueAs(AbstractClientDynamicAnnotationExpression.class));
- }
- }
- }
- return element;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientLabeledElementReference.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientLabeledElementReference.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientLabeledElementReference.java
deleted file mode 100644
index e1a6303..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientLabeledElementReference.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.annotation.LabeledElementReference;
-
-class ClientLabeledElementReference
- extends AbstractClientElementOrAttributeExpression implements LabeledElementReference {
-
- private static final long serialVersionUID = 7560525604021670529L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationProperty.java
deleted file mode 100644
index 5b0af33..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationProperty.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.provider.CsdlNavigationProperty;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientNavigationProperty.NavigationPropertyDeserializer.class)
-class ClientNavigationProperty extends CsdlNavigationProperty {
-
- private static final long serialVersionUID = 6240231735592427582L;
-
- static class NavigationPropertyDeserializer extends AbstractClientEdmDeserializer<CsdlNavigationProperty> {
-
- @Override
- protected CsdlNavigationProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final CsdlNavigationProperty property = new ClientNavigationProperty();
-
- 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())) {
- String metadataTypeName = jp.nextTextValue();
- if (metadataTypeName.startsWith("Collection(")) {
- property.setType(metadataTypeName.substring(metadataTypeName.indexOf("(") + 1,
- metadataTypeName.length() - 1));
- property.setCollection(true);
- } else {
- property.setType(metadataTypeName);
- property.setCollection(false);
- }
- } 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(ClientReferentialConstraint.class));
- } else if ("OnDelete".equals(jp.getCurrentName())) {
- jp.nextToken();
- property.setOnDelete(jp.readValueAs(ClientOnDelete.class));
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- property.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
- return property;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyBinding.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyBinding.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyBinding.java
deleted file mode 100644
index 250c769..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyBinding.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientNavigationPropertyBinding.NavigationPropertyBindingDeserializer.class)
-class ClientNavigationPropertyBinding extends CsdlNavigationPropertyBinding {
-
- private static final long serialVersionUID = -7056978592235483660L;
-
- @Override
- public CsdlNavigationPropertyBinding setPath(final String path) {
- super.setPath(path);
- return this;
- }
-
- @Override
- public CsdlNavigationPropertyBinding setTarget(final String target) {
- super.setTarget(target);
- return this;
- }
-
- static class NavigationPropertyBindingDeserializer extends
- AbstractClientEdmDeserializer<CsdlNavigationPropertyBinding> {
- @Override
- protected CsdlNavigationPropertyBinding doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientNavigationPropertyBinding member = new ClientNavigationPropertyBinding();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Path".equals(jp.getCurrentName())) {
- member.setPath(jp.nextTextValue());
- } else if ("Target".equals(jp.getCurrentName())) {
- member.setTarget(jp.nextTextValue());
- }
- }
- }
- return member;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyPath.java
deleted file mode 100644
index 8a3173c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNavigationPropertyPath.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.annotation.NavigationPropertyPath;
-
-class ClientNavigationPropertyPath extends AbstractClientElementOrAttributeExpression
- implements NavigationPropertyPath {
-
- private static final long serialVersionUID = 879840502446301312L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNot.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNot.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNot.java
deleted file mode 100644
index eca2b67..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNot.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.Not;
-
-class ClientNot extends AbstractClientDynamicAnnotationExpression implements Not {
-
- private static final long serialVersionUID = -437788415922966812L;
-
- private DynamicAnnotationExpression expression;
-
- @Override
- public DynamicAnnotationExpression getExpression() {
- return expression;
- }
-
- public void setExpression(final DynamicAnnotationExpression expression) {
- this.expression = expression;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNull.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNull.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNull.java
deleted file mode 100644
index 950d10c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientNull.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.olingo.commons.api.edm.provider.annotation.Null;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientNull.NullDeserializer.class)
-class ClientNull extends AbstractClientAnnotatableDynamicAnnotationExpression implements Null {
-
- private static final long serialVersionUID = -3148516847180393142L;
-
- static class NullDeserializer extends AbstractClientEdmDeserializer<ClientNull> {
- @Override
- protected ClientNull doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
- final ClientNull _null = new ClientNull();
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Annotation".equals(jp.getCurrentName())) {
- _null.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
- return _null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientOnDelete.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientOnDelete.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientOnDelete.java
deleted file mode 100644
index 489326d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientOnDelete.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.commons.api.edm.provider.CsdlOnDelete;
-import org.apache.olingo.commons.api.edm.provider.CsdlOnDeleteAction;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientOnDelete.OnDeleteDeserializer.class)
-class ClientOnDelete extends CsdlOnDelete {
-
- private static final long serialVersionUID = -7130889202653716784L;
-
- static class OnDeleteDeserializer extends AbstractClientEdmDeserializer<CsdlOnDelete> {
- @Override
- protected CsdlOnDelete doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final CsdlOnDelete ondelete = new ClientOnDelete();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Action".equals(jp.getCurrentName())) {
- CsdlOnDeleteAction action = CsdlOnDeleteAction.valueOf(jp.nextTextValue());
- ondelete.setAction(action);
- }
- }
- }
- return ondelete;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientParameter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientParameter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientParameter.java
deleted file mode 100644
index 24e8650..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientParameter.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.api.edm.provider.CsdlParameter;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientParameter.ParameterDeserializer.class)
-class ClientParameter extends CsdlParameter {
-
- private static final long serialVersionUID = 7119478691341167904L;
-
- static class ParameterDeserializer extends AbstractClientEdmDeserializer<ClientParameter> {
- @Override
- protected ClientParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientParameter parameter = new ClientParameter();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Name".equals(jp.getCurrentName())) {
- parameter.setName(jp.nextTextValue());
- } else if ("Type".equals(jp.getCurrentName())) {
- String metadataTypeName = jp.nextTextValue();
- if (metadataTypeName.startsWith("Collection(")) {
- parameter.setType(metadataTypeName.substring(metadataTypeName.indexOf("(") + 1,
- metadataTypeName.length() - 1));
- parameter.setCollection(true);
- } else {
- parameter.setType(metadataTypeName);
- parameter.setCollection(false);
- }
- } else if ("Nullable".equals(jp.getCurrentName())) {
- parameter.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- final String maxLenght = jp.nextTextValue();
- parameter.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
- } else if ("Precision".equals(jp.getCurrentName())) {
- parameter.setPrecision(Integer.valueOf(jp.nextTextValue()));
- } else if ("Scale".equals(jp.getCurrentName())) {
- final String scale = jp.nextTextValue();
- parameter.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
- } else if ("SRID".equals(jp.getCurrentName())) {
- final String srid = jp.nextTextValue();
- if (srid != null) {
- parameter.setSrid(SRID.valueOf(srid));
- }
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- parameter.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return parameter;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPath.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPath.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPath.java
deleted file mode 100644
index 3d790d7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientPath.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import org.apache.olingo.commons.api.edm.provider.annotation.Path;
-
-class ClientPath extends AbstractClientElementOrAttributeExpression implements Path {
-
- private static final long serialVersionUID = 6020168217561402545L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/53b10f6b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientProperty.java
deleted file mode 100644
index d753fd4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientProperty.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.xml;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.api.edm.provider.CsdlProperty;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-import java.io.IOException;
-
-@JsonDeserialize(using = ClientProperty.PropertyDeserializer.class)
-class ClientProperty extends CsdlProperty {
-
- private static final long serialVersionUID = -4521766603286651372L;
-
- static class PropertyDeserializer extends AbstractClientEdmDeserializer<ClientProperty> {
- @Override
- protected ClientProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException {
-
- final ClientProperty property = new ClientProperty();
-
- 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())) {
- String metadataTypeName = jp.nextTextValue();
- if (metadataTypeName.startsWith("Collection(")) {
- property.setType(metadataTypeName.substring(metadataTypeName.indexOf("(") + 1,
- metadataTypeName.length() - 1));
- property.setCollection(true);
- } else {
- property.setType(metadataTypeName);
- property.setCollection(false);
- }
- } else if ("Nullable".equals(jp.getCurrentName())) {
- property.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("DefaultValue".equals(jp.getCurrentName())) {
- property.setDefaultValue(jp.nextTextValue());
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- final String maxLenght = jp.nextTextValue();
- property.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
- } else if ("Precision".equals(jp.getCurrentName())) {
- property.setPrecision(Integer.valueOf(jp.nextTextValue()));
- } else if ("Scale".equals(jp.getCurrentName())) {
- final String scale = jp.nextTextValue();
- property.setScale(scale.equalsIgnoreCase("variable") ? 0 : Integer.valueOf(scale));
- } else if ("Unicode".equals(jp.getCurrentName())) {
- property.setUnicode(BooleanUtils.toBoolean(jp.nextTextValue()));
- } else if ("SRID".equals(jp.getCurrentName())) {
- final String srid = jp.nextTextValue();
- if (srid != null) {
- property.setSrid(SRID.valueOf(srid));
- }
- } else if ("Annotation".equals(jp.getCurrentName())) {
- jp.nextToken();
- property.getAnnotations().add(jp.readValueAs(ClientAnnotation.class));
- }
- }
- }
-
- return property;
- }
- }
-}