You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2015/02/18 17:29:18 UTC
[07/17] olingo-odata4 git commit: [OLINGO-575] Move v4 package
content one package up
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmConstantAnnotationExpressionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmConstantAnnotationExpressionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmConstantAnnotationExpressionImpl.java
deleted file mode 100644
index aeded52..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmConstantAnnotationExpressionImpl.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.v4.annotation;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.client.api.edm.xml.v4.annotation.ConstantAnnotationExpression;
-import org.apache.olingo.commons.api.Constants;
-import org.apache.olingo.commons.api.domain.v4.ODataEnumValue;
-import org.apache.olingo.commons.api.domain.v4.ODataValue;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.annotation.EdmConstantAnnotationExpression;
-import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.olingo.commons.core.domain.v4.ODataCollectionValueImpl;
-import org.apache.olingo.commons.core.domain.v4.ODataEnumValueImpl;
-import org.apache.olingo.commons.core.domain.v4.ODataPrimitiveValueImpl;
-import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
-
-public class EdmConstantAnnotationExpressionImpl implements EdmConstantAnnotationExpression {
-
- private final ODataValue value;
-
- public EdmConstantAnnotationExpressionImpl(final ConstantAnnotationExpression constExprConstruct) {
- if (constExprConstruct.getType() == ConstantAnnotationExpression.Type.EnumMember) {
- final List<ODataEnumValue> enumValues = new ArrayList<ODataEnumValue>();
- String enumTypeName = null;
- for (String split : StringUtils.split(constExprConstruct.getValue(), ' ')) {
- final String[] enumSplit = StringUtils.split(split, '/');
- enumTypeName = enumSplit[0];
- enumValues.add(new ODataEnumValueImpl(enumSplit[0], enumSplit[1]));
- }
- if (enumValues.size() == 1) {
- value = enumValues.get(0);
- } else {
- final ODataCollectionValueImpl collValue = new ODataCollectionValueImpl(enumTypeName);
- for (ODataValue enumValue : enumValues) {
- collValue.add(enumValue);
- }
- value = collValue;
- }
- } else {
- EdmPrimitiveTypeKind kind;
- switch (constExprConstruct.getType()) {
- case Binary:
- kind = EdmPrimitiveTypeKind.Binary;
- break;
- case Bool:
- kind = EdmPrimitiveTypeKind.Boolean;
- break;
- case Date:
- kind = EdmPrimitiveTypeKind.Date;
- break;
- case DateTimeOffset:
- kind = EdmPrimitiveTypeKind.DateTimeOffset;
- break;
- case Decimal:
- kind = EdmPrimitiveTypeKind.Decimal;
- break;
- case Duration:
- kind = EdmPrimitiveTypeKind.Duration;
- break;
- case Float:
- kind = EdmPrimitiveTypeKind.Single;
- break;
- case Guid:
- kind = EdmPrimitiveTypeKind.Guid;
- break;
- case Int:
- kind = EdmPrimitiveTypeKind.Int32;
- break;
- case TimeOfDay:
- kind = EdmPrimitiveTypeKind.TimeOfDay;
- break;
- case String:
- default:
- kind = EdmPrimitiveTypeKind.String;
- }
- final ODataPrimitiveValueImpl.BuilderImpl primitiveValueBuilder =
- new ODataPrimitiveValueImpl.BuilderImpl(ODataServiceVersion.V40);
- primitiveValueBuilder.setType(kind);
- try {
- final EdmPrimitiveType primitiveType = EdmPrimitiveTypeFactory.getInstance(kind);
- primitiveValueBuilder.setValue(
- primitiveType.valueOfString(constExprConstruct.getValue(),
- null, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null,
- primitiveType.getDefaultType()));
- } catch (final EdmPrimitiveTypeException e) {
- throw new IllegalArgumentException(e);
- }
-
- value = primitiveValueBuilder.build();
- }
- }
-
- @Override
- public boolean isConstant() {
- return true;
- }
-
- @Override
- public EdmConstantAnnotationExpression asConstant() {
- return this;
- }
-
- @Override
- public boolean isDynamic() {
- return false;
- }
-
- @Override
- public EdmDynamicAnnotationExpression asDynamic() {
- return null;
- }
-
- @Override
- public ODataValue getValue() {
- return value;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmIsOfImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmIsOfImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmIsOfImpl.java
deleted file mode 100644
index 2d00e79..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmIsOfImpl.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.v4.annotation;
-
-import org.apache.olingo.client.api.edm.xml.v4.annotation.IsOf;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.annotation.EdmIsOf;
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.core.edm.EdmTypeInfo;
-import org.apache.olingo.commons.core.edm.annotation.AbstractEdmAnnotatableDynamicAnnotationExpression;
-
-public class EdmIsOfImpl extends AbstractEdmAnnotatableDynamicAnnotationExpression implements EdmIsOf {
-
- private final Edm edm;
-
- private final IsOf isOf;
-
- private final EdmDynamicAnnotationExpression value;
-
- private EdmType type;
-
- public EdmIsOfImpl(final Edm edm, final IsOf isOf, final EdmDynamicAnnotationExpression value) {
- this.edm = edm;
- this.isOf = isOf;
- this.value = value;
- }
-
- @Override
- public Integer getMaxLength() {
- return isOf.getMaxLength();
- }
-
- @Override
- public Integer getPrecision() {
- return isOf.getPrecision();
- }
-
- @Override
- public Integer getScale() {
- return isOf.getScale();
- }
-
- @Override
- public SRID getSrid() {
- return isOf.getSrid();
- }
-
- @Override
- public EdmType getType() {
- if (type == null) {
- final EdmTypeInfo typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(isOf.getType()).build();
- type = typeInfo.getType();
- }
- return type;
- }
-
- @Override
- public EdmDynamicAnnotationExpression getValue() {
- return value;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmRecordImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmRecordImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmRecordImpl.java
deleted file mode 100644
index 8c22b27..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmRecordImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.edm.v4.annotation;
-
-import java.util.List;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmStructuredType;
-import org.apache.olingo.commons.api.edm.annotation.EdmPropertyValue;
-import org.apache.olingo.commons.api.edm.annotation.EdmRecord;
-import org.apache.olingo.commons.core.edm.EdmTypeInfo;
-import org.apache.olingo.commons.core.edm.annotation.AbstractEdmAnnotatableDynamicAnnotationExpression;
-
-public class EdmRecordImpl extends AbstractEdmAnnotatableDynamicAnnotationExpression implements EdmRecord {
-
- private final List<EdmPropertyValue> propertyValues;
-
- private EdmStructuredType type;
-
- public EdmRecordImpl(final Edm edm, final String type, final List<EdmPropertyValue> propertyValues) {
- this.propertyValues = propertyValues;
-
- if (type != null) {
- final EdmTypeInfo typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(type).build();
- this.type = typeInfo.getEntityType() == null ? typeInfo.getComplexType() : typeInfo.getEntityType();
- }
- }
-
- @Override
- public List<EdmPropertyValue> getPropertyValues() {
- return propertyValues;
- }
-
- @Override
- public EdmStructuredType getType() {
- return type;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractAnnotatable.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractAnnotatable.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractAnnotatable.java
new file mode 100644
index 0000000..e0fd56e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractAnnotatable.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotatable;
+import org.apache.olingo.client.api.edm.xml.Annotation;
+
+public abstract class AbstractAnnotatable extends AbstractEdmItem implements Annotatable {
+
+ private static final long serialVersionUID = 3739284381932173905L;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
index 404d131..adc89c2 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
@@ -18,9 +18,9 @@
*/
package org.apache.olingo.client.core.edm.xml;
-import org.apache.olingo.client.api.edm.xml.CommonNavigationProperty;
-import org.apache.olingo.client.api.edm.xml.CommonProperty;
import org.apache.olingo.client.api.edm.xml.ComplexType;
+import org.apache.olingo.client.api.edm.xml.NavigationProperty;
+import org.apache.olingo.client.api.edm.xml.Property;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -39,14 +39,14 @@ public abstract class AbstractComplexType extends AbstractEdmItem implements Com
public void setName(final String name) {
this.name = name;
}
-
+
@Override
- public CommonProperty getProperty(final String name) {
+ public Property getProperty(final String name) {
return getOneByName(name, getProperties());
}
@Override
- public CommonNavigationProperty getNavigationProperty(final String name) {
+ public NavigationProperty getNavigationProperty(final String name) {
return getOneByName(name, getNavigationProperties());
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmDeserializer.java
index 556c81f..0391517 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmDeserializer.java
@@ -20,8 +20,7 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
-import org.apache.olingo.client.core.edm.xml.v4.ReturnTypeImpl;
-import org.apache.olingo.client.core.edm.xml.v4.annotation.ConstantAnnotationExpressionImpl;
+import org.apache.olingo.client.core.edm.xml.annotation.ConstantAnnotationExpressionImpl;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import com.fasterxml.jackson.core.JsonParser;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
index 3c5453c..9d8cf5e 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
@@ -20,9 +20,9 @@ package org.apache.olingo.client.core.edm.xml;
import java.util.List;
-import org.apache.olingo.client.api.edm.xml.CommonFunctionImport;
import org.apache.olingo.client.api.edm.xml.EntityContainer;
import org.apache.olingo.client.api.edm.xml.EntitySet;
+import org.apache.olingo.client.api.edm.xml.FunctionImport;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -79,7 +79,7 @@ public abstract class AbstractEntityContainer extends AbstractEdmItem implements
public EntitySet getEntitySet(final String name) {
return getOneByName(name, getEntitySets());
}
-
+
/**
* Gets the first function import with given name.
*
@@ -87,7 +87,7 @@ public abstract class AbstractEntityContainer extends AbstractEdmItem implements
* @return function import.
*/
@Override
- public CommonFunctionImport getFunctionImport(final String name) {
+ public FunctionImport getFunctionImport(final String name) {
return getOneByName(name, getFunctionImports());
}
@@ -98,7 +98,7 @@ public abstract class AbstractEntityContainer extends AbstractEdmItem implements
* @return function imports.
*/
@Override
- public List<? extends CommonFunctionImport> getFunctionImports(final String name) {
+ public List<FunctionImport> getFunctionImports(final String name) {
return getAllByName(name, getFunctionImports());
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractXMLMetadata.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractXMLMetadata.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractXMLMetadata.java
index 6159e95..f911463 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractXMLMetadata.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractXMLMetadata.java
@@ -41,10 +41,10 @@ public abstract class AbstractXMLMetadata extends AbstractEdmItem implements XML
}
@Override
- public List<? extends Schema> getSchemas() {
+ public List<Schema> getSchemas() {
return this.edmx.getDataServices().getSchemas();
}
-
+
@Override
public Schema getSchema(final int index) {
return getSchemas().get(index);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionDeserializer.java
new file mode 100644
index 0000000..562c8e9
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionDeserializer.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+public class ActionDeserializer extends AbstractEdmDeserializer<ActionImpl> {
+
+ @Override
+ protected ActionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final ActionImpl action = new ActionImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ action.setName(jp.nextTextValue());
+ } else if ("IsBound".equals(jp.getCurrentName())) {
+ action.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("EntitySetPath".equals(jp.getCurrentName())) {
+ action.setEntitySetPath(jp.nextTextValue());
+ } else if ("Parameter".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ action.getParameters().add(jp.readValueAs(ParameterImpl.class));
+ } else if ("ReturnType".equals(jp.getCurrentName())) {
+ action.setReturnType(parseReturnType(jp, "Action"));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ action.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return action;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImpl.java
new file mode 100644
index 0000000..2b685dd
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImpl.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Action;
+import org.apache.olingo.client.api.edm.xml.Parameter;
+import org.apache.olingo.client.api.edm.xml.ReturnType;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ActionDeserializer.class)
+public class ActionImpl extends AbstractAnnotatable implements Action {
+
+ private static final long serialVersionUID = 5321541275349234088L;
+
+ private String name;
+
+ private boolean bound = false;
+
+ private String entitySetPath;
+
+ private final List<Parameter> parameters = new ArrayList<Parameter>();
+
+ private ReturnType returnType;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean isBound() {
+ return bound;
+ }
+
+ public void setBound(final boolean bound) {
+ this.bound = bound;
+ }
+
+ @Override
+ public String getEntitySetPath() {
+ return entitySetPath;
+ }
+
+ public void setEntitySetPath(final String entitySetPath) {
+ this.entitySetPath = entitySetPath;
+ }
+
+ @Override
+ public Parameter getParameter(final String name) {
+ return getOneByName(name, getParameters());
+ }
+
+ @Override
+ public List<Parameter> getParameters() {
+ return parameters;
+ }
+
+ @Override
+ public ReturnType getReturnType() {
+ return returnType;
+ }
+
+ public void setReturnType(final ReturnType returnType) {
+ this.returnType = returnType;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImportImpl.java
new file mode 100644
index 0000000..ac9c1c5
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ActionImportImpl.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import org.apache.olingo.client.api.edm.xml.ActionImport;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ActionImportImpl extends AbstractAnnotatable implements ActionImport {
+
+ private static final long serialVersionUID = 2971468441177647068L;
+
+ @JsonProperty(value = "Name", required = true)
+ private String name;
+
+ @JsonProperty(value = "Action", required = true)
+ private String action;
+
+ @JsonProperty(value = "EntitySet")
+ private String entitySet;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getAction() {
+ return action;
+ }
+
+ public void setAction(final String action) {
+ this.action = action;
+ }
+
+ @Override
+ public String getEntitySet() {
+ return entitySet;
+ }
+
+ @Override
+ public void setEntitySet(final String entitySet) {
+ this.entitySet = entitySet;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationDeserializer.java
new file mode 100644
index 0000000..a81180a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationDeserializer.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.annotation.AbstractDynamicAnnotationExpression;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+public class AnnotationDeserializer extends AbstractEdmDeserializer<AnnotationImpl> {
+
+ @Override
+ protected AnnotationImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AnnotationImpl annotation = new AnnotationImpl();
+
+ for (; jp.getCurrentToken() != null && jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Term".equals(jp.getCurrentName())) {
+ annotation.setTerm(jp.nextTextValue());
+ } else if ("Qualifier".equals(jp.getCurrentName())) {
+ annotation.setQualifier(jp.nextTextValue());
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ annotation.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
+ } else if (isAnnotationConstExprConstruct(jp)) {
+ // Constant Expressions
+ annotation.setAnnotationExpression(parseAnnotationConstExprConstruct(jp));
+ } else {
+ // Dynamic Expressions
+ annotation.setAnnotationExpression(jp.readValueAs(AbstractDynamicAnnotationExpression.class));
+ }
+ }
+ }
+
+ return annotation;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationImpl.java
new file mode 100644
index 0000000..aaf510e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationImpl.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 org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.annotation.AnnotationExpression;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = AnnotationDeserializer.class)
+public class AnnotationImpl extends AbstractAnnotatable implements Annotation {
+
+ private static final long serialVersionUID = 5464714417411058033L;
+
+ private String term;
+
+ private String qualifier;
+
+ private AnnotationExpression annotationExpression;
+
+ @Override
+ public String getTerm() {
+ return term;
+ }
+
+ public void setTerm(final String term) {
+ this.term = term;
+ }
+
+ @Override
+ public String getQualifier() {
+ return qualifier;
+ }
+
+ public void setQualifier(final String qualifier) {
+ this.qualifier = qualifier;
+ }
+
+ @Override
+ public AnnotationExpression getExpression() {
+ return annotationExpression;
+ }
+
+ public void setAnnotationExpression(final AnnotationExpression annotationExpression) {
+ this.annotationExpression = annotationExpression;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsDeserializer.java
new file mode 100644
index 0000000..14d84ca
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsDeserializer.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+public class AnnotationsDeserializer extends AbstractEdmDeserializer<AnnotationsImpl> {
+
+ @Override
+ protected AnnotationsImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AnnotationsImpl annotations = new AnnotationsImpl();
+
+ for (; jp.getCurrentToken() != 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(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java
new file mode 100644
index 0000000..0f0907e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.Annotations;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = AnnotationsDeserializer.class)
+public class AnnotationsImpl extends AbstractAnnotations implements Annotations {
+
+ private static final long serialVersionUID = -5961207981571644200L;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+ @Override
+ public Annotation getAnnotation(final String term) {
+ Annotation result = null;
+ for (Annotation annotation : getAnnotations()) {
+ if (term.equals(annotation.getTerm())) {
+ result = annotation;
+ }
+ }
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
index a152b38..fbd16ab 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
@@ -21,10 +21,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl;
-import org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyImpl;
-import org.apache.olingo.client.core.edm.xml.v4.PropertyImpl;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeImpl.java
new file mode 100644
index 0000000..86d171b
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeImpl.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or >ied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.ComplexType;
+import org.apache.olingo.client.api.edm.xml.NavigationProperty;
+import org.apache.olingo.client.api.edm.xml.Property;
+
+public class ComplexTypeImpl extends AbstractComplexType implements ComplexType {
+
+ private static final long serialVersionUID = 4076944306925840115L;
+
+ private boolean abstractEntityType = false;
+
+ private String baseType;
+
+ private boolean openType = false;
+
+ private final List<Property> properties = new ArrayList<Property>();
+
+ private final List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public boolean isAbstractEntityType() {
+ return abstractEntityType;
+ }
+
+ public void setAbstractEntityType(final boolean abstractEntityType) {
+ this.abstractEntityType = abstractEntityType;
+ }
+
+ @Override
+ public String getBaseType() {
+ return baseType;
+ }
+
+ public void setBaseType(final String baseType) {
+ this.baseType = baseType;
+ }
+
+ @Override
+ public boolean isOpenType() {
+ return openType;
+ }
+
+ public void setOpenType(final boolean openType) {
+ this.openType = openType;
+ }
+
+ @Override
+ public Property getProperty(final String name) {
+ return (Property) super.getProperty(name);
+ }
+
+ @Override
+ public List<Property> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public NavigationProperty getNavigationProperty(final String name) {
+ return (NavigationProperty) super.getNavigationProperty(name);
+ }
+
+ @Override
+ public List<NavigationProperty> getNavigationProperties() {
+ return navigationProperties;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
index 85a9a05..14298ea 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
@@ -20,9 +20,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
-import org.apache.olingo.client.core.edm.xml.v4.DataServicesImpl;
-import org.apache.olingo.client.core.edm.xml.v4.SchemaImpl;
-
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java
new file mode 100644
index 0000000..a04385a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Schema;
+
+public class DataServicesImpl extends AbstractDataServices {
+
+ private static final long serialVersionUID = 4200317286476885204L;
+
+ private final List<Schema> schemas = new ArrayList<Schema>();
+
+ @Override
+ public List<Schema> getSchemas() {
+ return schemas;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
index 7355498..96943a4 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
@@ -20,8 +20,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
-import org.apache.olingo.client.core.edm.xml.v4.ReferenceImpl;
-
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
@@ -33,7 +31,7 @@ public class EdmxDeserializer extends AbstractEdmDeserializer<AbstractEdmx> {
protected AbstractEdmx doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
throws IOException, JsonProcessingException {
- final AbstractEdmx edmx = new org.apache.olingo.client.core.edm.xml.v4.EdmxImpl();
+ final AbstractEdmx edmx = new org.apache.olingo.client.core.edm.xml.EdmxImpl();
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
final JsonToken token = jp.getCurrentToken();
@@ -43,13 +41,13 @@ public class EdmxDeserializer extends AbstractEdmDeserializer<AbstractEdmx> {
} else if ("DataServices".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EdmxImpl) edmx).
+ ((org.apache.olingo.client.core.edm.xml.EdmxImpl) edmx).
setDataServices(jp.readValueAs(
- org.apache.olingo.client.core.edm.xml.v4.DataServicesImpl.class));
+ org.apache.olingo.client.core.edm.xml.DataServicesImpl.class));
} else if ("Reference".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EdmxImpl) edmx).getReferences().
+ ((org.apache.olingo.client.core.edm.xml.EdmxImpl) edmx).getReferences().
add(jp.readValueAs(ReferenceImpl.class));
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java
new file mode 100644
index 0000000..b1abbec
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Edmx;
+import org.apache.olingo.client.api.edm.xml.Reference;
+
+public class EdmxImpl extends AbstractEdmx implements Edmx {
+
+ private static final long serialVersionUID = -6293476719276092572L;
+
+ private final List<Reference> references = new ArrayList<Reference>();
+
+ @Override
+ public DataServicesImpl getDataServices() {
+ return (DataServicesImpl) super.getDataServices();
+ }
+
+ @Override
+ public List<Reference> getReferences() {
+ return references;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
index 46c1e55..c8a647f 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
@@ -21,9 +21,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.edm.xml.v4.ActionImportImpl;
-import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.edm.xml.v4.SingletonImpl;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -36,7 +33,7 @@ public class EntityContainerDeserializer extends AbstractEdmDeserializer<Abstrac
protected AbstractEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
throws IOException, JsonProcessingException {
- final AbstractEntityContainer entityContainer = new org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl();
+ final AbstractEntityContainer entityContainer = new org.apache.olingo.client.core.edm.xml.EntityContainerImpl();
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
final JsonToken token = jp.getCurrentToken();
@@ -52,28 +49,28 @@ public class EntityContainerDeserializer extends AbstractEdmDeserializer<Abstrac
} else if ("EntitySet".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).
getEntitySets().add(jp.readValueAs(
- org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl.class));
+ org.apache.olingo.client.core.edm.xml.EntitySetImpl.class));
} else if ("Singleton".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).
getSingletons().add(jp.readValueAs(SingletonImpl.class));
} else if ("ActionImport".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).
getActionImports().add(jp.readValueAs(ActionImportImpl.class));
} else if ("FunctionImport".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).
getFunctionImports().add(jp.readValueAs(
- org.apache.olingo.client.core.edm.xml.v4.FunctionImportImpl.class));
+ org.apache.olingo.client.core.edm.xml.FunctionImportImpl.class));
} else if ("Annotation".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).getAnnotations().
+ ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).getAnnotations().
add(jp.readValueAs(AnnotationImpl.class));
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerImpl.java
new file mode 100644
index 0000000..238f636
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerImpl.java
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.ActionImport;
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.EntityContainer;
+import org.apache.olingo.client.api.edm.xml.EntitySet;
+import org.apache.olingo.client.api.edm.xml.FunctionImport;
+import org.apache.olingo.client.api.edm.xml.Singleton;
+
+public class EntityContainerImpl extends AbstractEntityContainer implements EntityContainer {
+
+ private static final long serialVersionUID = 5631432527646955795L;
+
+ private final List<EntitySet> entitySets = new ArrayList<EntitySet>();
+
+ private final List<Singleton> singletons = new ArrayList<Singleton>();
+
+ private final List<ActionImport> actionImports = new ArrayList<ActionImport>();
+
+ private final List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public void setDefaultEntityContainer(final boolean defaultEntityContainer) {
+ // no action: a single entity container MUST be available as per OData 4.0
+ }
+
+ @Override
+ public boolean isDefaultEntityContainer() {
+ return true;
+ }
+
+ @Override
+ public EntitySet getEntitySet(final String name) {
+ return (EntitySet) super.getEntitySet(name);
+ }
+
+ @Override
+ public List<EntitySet> getEntitySets() {
+ return entitySets;
+ }
+
+ @Override
+ public List<Singleton> getSingletons() {
+ return singletons;
+ }
+
+ @Override
+ public Singleton getSingleton(final String name) {
+ return getOneByName(name, getSingletons());
+ }
+
+ @Override
+ public FunctionImport getFunctionImport(final String name) {
+ return (FunctionImport) super.getFunctionImport(name);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<FunctionImport> getFunctionImports(final String name) {
+ return (List<FunctionImport>) super.getFunctionImports(name);
+ }
+
+ /**
+ * Gets the first action import with given name.
+ *
+ * @param name name.
+ * @return action import.
+ */
+ @Override
+ public ActionImport getActionImport(final String name) {
+ return getOneByName(name, getActionImports());
+ }
+
+ /**
+ * Gets all action imports with given name.
+ *
+ * @param name name.
+ * @return action imports.
+ */
+ @Override
+ public List<ActionImport> getActionImports(final String name) {
+ return getAllByName(name, getActionImports());
+ }
+
+ @Override
+ public List<ActionImport> getActionImports() {
+ return actionImports;
+ }
+
+ @Override
+ public List<FunctionImport> getFunctionImports() {
+ return functionImports;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
index 08411d6..f4e8cc1 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
@@ -21,8 +21,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyBindingImpl;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -35,7 +33,7 @@ public class EntitySetDeserializer extends AbstractEdmDeserializer<AbstractEntit
protected AbstractEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
throws IOException, JsonProcessingException {
- final AbstractEntitySet entitySet = new org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl();
+ final AbstractEntitySet entitySet = new org.apache.olingo.client.core.edm.xml.EntitySetImpl();
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
final JsonToken token = jp.getCurrentToken();
@@ -45,16 +43,16 @@ public class EntitySetDeserializer extends AbstractEdmDeserializer<AbstractEntit
} else if ("EntityType".equals(jp.getCurrentName())) {
entitySet.setEntityType(jp.nextTextValue());
} else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
- ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).
+ ((org.apache.olingo.client.core.edm.xml.EntitySetImpl) entitySet).
setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
} else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).
+ ((org.apache.olingo.client.core.edm.xml.EntitySetImpl) entitySet).
getNavigationPropertyBindings().add(
jp.readValueAs(NavigationPropertyBindingImpl.class));
} else if ("Annotation".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).getAnnotations().
+ ((org.apache.olingo.client.core.edm.xml.EntitySetImpl) entitySet).getAnnotations().
add(jp.readValueAs(AnnotationImpl.class));
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java
new file mode 100644
index 0000000..ec132dd
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.EntitySet;
+import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding;
+
+public class EntitySetImpl extends AbstractEntitySet implements EntitySet {
+
+ private static final long serialVersionUID = -5553885465204370676L;
+
+ private boolean includeInServiceDocument = true;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
+
+ @Override
+ public boolean isIncludeInServiceDocument() {
+ return includeInServiceDocument;
+ }
+
+ public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
+ this.includeInServiceDocument = includeInServiceDocument;
+ }
+
+ @Override
+ public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
+ return navigationPropertyBindings;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
index 026bb13..79d82f0 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
@@ -21,7 +21,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -34,7 +33,7 @@ public class EntityTypeDeserializer extends AbstractEdmDeserializer<AbstractEnti
protected AbstractEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
throws IOException, JsonProcessingException {
- final AbstractEntityType entityType = new org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl();
+ final AbstractEntityType entityType = new org.apache.olingo.client.core.edm.xml.EntityTypeImpl();
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
final JsonToken token = jp.getCurrentToken();
@@ -54,16 +53,16 @@ public class EntityTypeDeserializer extends AbstractEdmDeserializer<AbstractEnti
entityType.setKey(jp.readValueAs(EntityKeyImpl.class));
} else if ("Property".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).
- getProperties().add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.v4.PropertyImpl.class));
+ ((org.apache.olingo.client.core.edm.xml.EntityTypeImpl) entityType).
+ getProperties().add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.PropertyImpl.class));
} else if ("NavigationProperty".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).
+ ((org.apache.olingo.client.core.edm.xml.EntityTypeImpl) entityType).
getNavigationProperties().add(jp.readValueAs(
- org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyImpl.class));
+ org.apache.olingo.client.core.edm.xml.NavigationPropertyImpl.class));
} else if ("Annotation".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).getAnnotations().
+ ((org.apache.olingo.client.core.edm.xml.EntityTypeImpl) entityType).getAnnotations().
add(jp.readValueAs(AnnotationImpl.class));
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java
new file mode 100644
index 0000000..2e0c7fa
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.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.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.EntityType;
+import org.apache.olingo.client.api.edm.xml.NavigationProperty;
+import org.apache.olingo.client.api.edm.xml.Property;
+
+public class EntityTypeImpl extends AbstractEntityType implements EntityType {
+
+ private static final long serialVersionUID = -3986417775876689669L;
+
+ private final List<Property> properties = new ArrayList<Property>();
+
+ private final List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>();
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public Property getProperty(final String name) {
+ return (Property) super.getProperty(name);
+ }
+
+ @Override
+ public List<Property> getProperties() {
+ return properties;
+ }
+
+ @Override
+ public NavigationProperty getNavigationProperty(final String name) {
+ return (NavigationProperty) super.getNavigationProperty(name);
+ }
+
+ @Override
+ public List<NavigationProperty> getNavigationProperties() {
+ return navigationProperties;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
index 3936137..8b70c13 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
@@ -21,7 +21,6 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -34,7 +33,7 @@ public class EnumTypeDeserializer extends AbstractEdmDeserializer<AbstractEnumTy
protected AbstractEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
throws IOException, JsonProcessingException {
- final AbstractEnumType enumType = new org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl();
+ final AbstractEnumType enumType = new org.apache.olingo.client.core.edm.xml.EnumTypeImpl();
for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
final JsonToken token = jp.getCurrentToken();
@@ -47,12 +46,12 @@ public class EnumTypeDeserializer extends AbstractEdmDeserializer<AbstractEnumTy
enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
} else if ("Member".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl) enumType).
+ ((org.apache.olingo.client.core.edm.xml.EnumTypeImpl) enumType).
getMembers().add(jp.readValueAs(
- org.apache.olingo.client.core.edm.xml.v4.MemberImpl.class));
+ org.apache.olingo.client.core.edm.xml.MemberImpl.class));
} else if ("Annotation".equals(jp.getCurrentName())) {
jp.nextToken();
- ((org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl) enumType).getAnnotations().
+ ((org.apache.olingo.client.core.edm.xml.EnumTypeImpl) enumType).getAnnotations().
add(jp.readValueAs(AnnotationImpl.class));
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java
new file mode 100644
index 0000000..68e0fb6
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotatable;
+import org.apache.olingo.client.api.edm.xml.Annotation;
+
+public class EnumTypeImpl extends AbstractEnumType implements Annotatable {
+
+ private static final long serialVersionUID = 9191189755592743333L;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionDeserializer.java
new file mode 100644
index 0000000..9d753fb
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionDeserializer.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 org.apache.commons.lang3.BooleanUtils;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+public class FunctionDeserializer extends AbstractEdmDeserializer<FunctionImpl> {
+
+ @Override
+ protected FunctionImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final FunctionImpl functionImpl = new FunctionImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ functionImpl.setName(jp.nextTextValue());
+ } else if ("IsBound".equals(jp.getCurrentName())) {
+ functionImpl.setBound(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("IsComposable".equals(jp.getCurrentName())) {
+ functionImpl.setComposable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("EntitySetPath".equals(jp.getCurrentName())) {
+ functionImpl.setEntitySetPath(jp.nextTextValue());
+ } else if ("Parameter".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ functionImpl.getParameters().add(jp.readValueAs(ParameterImpl.class));
+ } else if ("ReturnType".equals(jp.getCurrentName())) {
+ functionImpl.setReturnType(parseReturnType(jp, "Function"));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ functionImpl.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return functionImpl;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImpl.java
new file mode 100644
index 0000000..9c67d09
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImpl.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import org.apache.olingo.client.api.edm.xml.Function;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = FunctionDeserializer.class)
+public class FunctionImpl extends ActionImpl implements Function {
+
+ private static final long serialVersionUID = -5494898295282843362L;
+
+ private boolean composable = false;
+
+ @Override
+ public boolean isComposable() {
+ return composable;
+ }
+
+ public void setComposable(final boolean composable) {
+ this.composable = composable;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportDeserializer.java
new file mode 100644
index 0000000..c6af641
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportDeserializer.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml;
+
+import java.io.IOException;
+
+import org.apache.commons.lang3.BooleanUtils;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+
+public class FunctionImportDeserializer extends AbstractEdmDeserializer<FunctionImportImpl> {
+
+ @Override
+ protected FunctionImportImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final FunctionImportImpl functImpImpl = new FunctionImportImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ 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(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return functImpImpl;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportImpl.java
new file mode 100644
index 0000000..21b0d12
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/FunctionImportImpl.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 java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.FunctionImport;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = FunctionImportDeserializer.class)
+public class FunctionImportImpl implements FunctionImport {
+
+ private static final long serialVersionUID = -1686801084142932402L;
+
+ private String name;
+
+ private String function;
+
+ private String entitySet;
+
+ private boolean includeInServiceDocument = false;
+
+ private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getFunction() {
+ return function;
+ }
+
+ public void setFunction(final String function) {
+ this.function = function;
+ }
+
+ @Override
+ public String getEntitySet() {
+ return entitySet;
+ }
+
+ @Override
+ public void setEntitySet(final String entitySet) {
+ this.entitySet = entitySet;
+ }
+
+ @Override
+ public boolean isIncludeInServiceDocument() {
+ return includeInServiceDocument;
+ }
+
+ public void setIncludeInServiceDocument(final boolean includeInServiceDocument) {
+ this.includeInServiceDocument = includeInServiceDocument;
+ }
+
+ @Override
+ public List<Annotation> getAnnotations() {
+ return annotations;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/109c33ba/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeAnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeAnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeAnnotationsImpl.java
new file mode 100644
index 0000000..03cd3e6
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/IncludeAnnotationsImpl.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 org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class IncludeAnnotationsImpl extends AbstractEdmItem implements IncludeAnnotations {
+
+ private static final long serialVersionUID = -8157841387011422396L;
+
+ @JsonProperty(value = "TermNamespace", required = true)
+ private String termNamespace;
+
+ @JsonProperty(value = "Qualifier")
+ private String qualifier;
+
+ @JsonProperty(value = "TargetNamespace")
+ 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 setTargeyNamespace(final String targeyNamespace) {
+ this.targetNamespace = targeyNamespace;
+ }
+
+}