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/10/16 14:14:06 UTC
[1/4] olingo-odata4 git commit: [OLINGO-786] Make annotaion csdl
classes spec compliant`
Repository: olingo-odata4
Updated Branches:
refs/heads/olingo786 576acf466 -> 67ccbf9dd
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java
index f7aca3b..bbe0dbc 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantAnnotationExpressionImpl.java
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -31,7 +31,7 @@ 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.provider.annotation.ConstantAnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
public class EdmConstantAnnotationExpressionImpl implements EdmConstantAnnotationExpression {
@@ -39,8 +39,8 @@ public class EdmConstantAnnotationExpressionImpl implements EdmConstantAnnotatio
private final Valuable value;
private final EdmPrimitiveType type;
- public EdmConstantAnnotationExpressionImpl(final ConstantAnnotationExpression constExprConstruct) {
- if (constExprConstruct.getType() == ConstantAnnotationExpression.Type.EnumMember) {
+ public EdmConstantAnnotationExpressionImpl(final CsdlConstantExpression constExprConstruct) {
+ if (constExprConstruct.getType() == CsdlConstantExpression.ConstantExpressionType.EnumMember) {
final List<Property> enumValues = new ArrayList<Property>();
String enumTypeName = null;
for (String split : StringUtils.split(constExprConstruct.getValue(), ' ')) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmEqImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmEqImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmEqImpl.java
index f2df85f..bd88887 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmEqImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmEqImpl.java
@@ -18,12 +18,12 @@
*/
package org.apache.olingo.commons.core.edm.annotation;
-import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmEq;
public class EdmEqImpl extends AbstractEdmTwoParamsOpDynamicAnnotationExpression implements EdmEq {
- public EdmEqImpl(final EdmDynamicAnnotationExpression left, final EdmDynamicAnnotationExpression right) {
+ public EdmEqImpl(final EdmAnnotationExpression left, final EdmAnnotationExpression right) {
super(left, right);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGeImpl.java
index 7bef6bb..ace7a33 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGeImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGeImpl.java
@@ -18,12 +18,12 @@
*/
package org.apache.olingo.commons.core.edm.annotation;
-import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmGe;
public class EdmGeImpl extends AbstractEdmTwoParamsOpDynamicAnnotationExpression implements EdmGe {
- public EdmGeImpl(final EdmDynamicAnnotationExpression left, final EdmDynamicAnnotationExpression right) {
+ public EdmGeImpl(final EdmAnnotationExpression left, final EdmAnnotationExpression right) {
super(left, right);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGtImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGtImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGtImpl.java
index d6b1bb7..feed77c 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGtImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmGtImpl.java
@@ -18,12 +18,12 @@
*/
package org.apache.olingo.commons.core.edm.annotation;
-import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmGt;
public class EdmGtImpl extends AbstractEdmTwoParamsOpDynamicAnnotationExpression implements EdmGt {
- public EdmGtImpl(final EdmDynamicAnnotationExpression left, final EdmDynamicAnnotationExpression right) {
+ public EdmGtImpl(final EdmAnnotationExpression left, final EdmAnnotationExpression right) {
super(left, right);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java
index 8b13788..9732a0a 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java
@@ -23,20 +23,20 @@ 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.api.edm.provider.annotation.IsOf;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlIsOf;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
public class EdmIsOfImpl extends AbstractEdmAnnotatableDynamicAnnotationExpression implements EdmIsOf {
private final Edm edm;
- private final IsOf isOf;
+ private final CsdlIsOf isOf;
private final EdmDynamicAnnotationExpression value;
private EdmType type;
- public EdmIsOfImpl(final Edm edm, final IsOf isOf, final EdmDynamicAnnotationExpression value) {
+ public EdmIsOfImpl(final Edm edm, final CsdlIsOf isOf, final EdmDynamicAnnotationExpression value) {
this.edm = edm;
this.isOf = isOf;
this.value = value;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLeImpl.java
index cfca96b..9a1f51d 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLeImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLeImpl.java
@@ -18,12 +18,13 @@
*/
package org.apache.olingo.commons.core.edm.annotation;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmLe;
public class EdmLeImpl extends AbstractEdmTwoParamsOpDynamicAnnotationExpression implements EdmLe {
- public EdmLeImpl(final EdmDynamicAnnotationExpression left, final EdmDynamicAnnotationExpression right) {
+ public EdmLeImpl(final EdmAnnotationExpression left, final EdmAnnotationExpression right) {
super(left, right);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLtImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLtImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLtImpl.java
index 83ac2e6..c59b877 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLtImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLtImpl.java
@@ -18,12 +18,12 @@
*/
package org.apache.olingo.commons.core.edm.annotation;
-import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmLt;
public class EdmLtImpl extends AbstractEdmTwoParamsOpDynamicAnnotationExpression implements EdmLt {
- public EdmLtImpl(final EdmDynamicAnnotationExpression left, final EdmDynamicAnnotationExpression right) {
+ public EdmLtImpl(final EdmAnnotationExpression left, final EdmAnnotationExpression right) {
super(left, right);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNeImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNeImpl.java
index 67679eb..aebadf2 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNeImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNeImpl.java
@@ -18,12 +18,12 @@
*/
package org.apache.olingo.commons.core.edm.annotation;
-import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmNe;
public class EdmNeImpl extends AbstractEdmTwoParamsOpDynamicAnnotationExpression implements EdmNe {
- public EdmNeImpl(final EdmDynamicAnnotationExpression left, final EdmDynamicAnnotationExpression right) {
+ public EdmNeImpl(final EdmAnnotationExpression left, final EdmAnnotationExpression right) {
super(left, right);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNotImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNotImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNotImpl.java
index cce2cbe..b34c255 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNotImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNotImpl.java
@@ -18,19 +18,20 @@
*/
package org.apache.olingo.commons.core.edm.annotation;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmNot;
public class EdmNotImpl extends AbstractEdmDynamicAnnotationExpression implements EdmNot {
- private final EdmDynamicAnnotationExpression expression;
+ private final EdmAnnotationExpression expression;
- public EdmNotImpl(final EdmDynamicAnnotationExpression expression) {
+ public EdmNotImpl(final EdmAnnotationExpression expression) {
this.expression = expression;
}
@Override
- public EdmDynamicAnnotationExpression getExpression() {
+ public EdmAnnotationExpression getExpression() {
return expression;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmOrImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmOrImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmOrImpl.java
index 3746300..30cc51d 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmOrImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmOrImpl.java
@@ -18,12 +18,12 @@
*/
package org.apache.olingo.commons.core.edm.annotation;
-import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmOr;
public class EdmOrImpl extends AbstractEdmTwoParamsOpDynamicAnnotationExpression implements EdmOr {
- public EdmOrImpl(final EdmDynamicAnnotationExpression left, final EdmDynamicAnnotationExpression right) {
+ public EdmOrImpl(final EdmAnnotationExpression left, final EdmAnnotationExpression right) {
super(left, right);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
index 413dac4..d6f371d 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
@@ -22,18 +22,17 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
-import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantAnnotationExpression;
-import org.apache.olingo.commons.api.ex.ODataException;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlActionImport;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
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.CsdlFunctionImport;
import org.apache.olingo.commons.api.edm.provider.CsdlNavigationPropertyBinding;
import org.apache.olingo.commons.api.edm.provider.CsdlSingleton;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
+import org.apache.olingo.commons.api.ex.ODataException;
public class ContainerProvider {
@@ -169,18 +168,18 @@ public class ContainerProvider {
.asList(new CsdlNavigationPropertyBinding().setPath("NavPropertyETTwoPrimOne").setTarget("ESTwoPrim"),
new CsdlNavigationPropertyBinding().setPath("NavPropertyETTwoPrimMany").setTarget("ESTwoPrim")))
.setAnnotations(Arrays.asList(new CsdlAnnotation().setTerm("Core.Description").setExpression(
- new CsdlConstantAnnotationExpression(ConstantAnnotationExpression.Type.String,
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String,
"Contains entities with all primitive types")),
new CsdlAnnotation().setTerm("Core.LongDescription").setQualifier("EnabledForEntitySet").setExpression(
- new CsdlConstantAnnotationExpression(ConstantAnnotationExpression.Type.String,
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String,
"System Query Options: $filter, $count, $orderby, $skip, $top, $expand, $select, $format; "
+ "Operations: Create, Create with Deep Insert, Create with Bind Operation, Read")),
new CsdlAnnotation().setTerm("Core.LongDescription").setQualifier("EnabledForEntity").setExpression(
- new CsdlConstantAnnotationExpression(ConstantAnnotationExpression.Type.String,
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String,
"System Query Options: $expand, $select, $format; Operations: "
+ "Read, Update, Update with Bind Operation, Delete")),
new CsdlAnnotation().setTerm("Core.LongDescription").setQualifier("EnabledNavigationProperties")
- .setExpression(new CsdlConstantAnnotationExpression(ConstantAnnotationExpression.Type.String,
+ .setExpression(new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String,
"NavPropertyETTwoPrimOne, NavPropertyETTwoPrimMany"))));
} else if (name.equals("ESCollAllPrim")) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TermProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TermProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TermProvider.java
index 8e2ae19..74fcd13 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TermProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TermProvider.java
@@ -18,13 +18,12 @@
*/
package org.apache.olingo.server.tecsvc.provider;
+import java.util.Arrays;
+
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
import org.apache.olingo.commons.api.edm.provider.CsdlTerm;
-import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantAnnotationExpression;
-
-import java.util.Arrays;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
/**
*/
@@ -48,13 +47,13 @@ public class TermProvider {
if(TERM_DESCRIPTION.equals(termName)) {
return new CsdlTerm().setName("Description").setType("Edm.String")
.setAnnotations(Arrays.asList(new CsdlAnnotation().setTerm("Core.Description").setExpression(
- new CsdlConstantAnnotationExpression(ConstantAnnotationExpression.Type.String,
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String,
"A brief description of a model element")),
new CsdlAnnotation().setTerm("Core.IsLanguageDependent")));
} else if(TERM_LONG_DESCRIPTION.equals(termName)) {
return new CsdlTerm().setName("LongDescription").setType("Edm.String")
.setAnnotations(Arrays.asList(new CsdlAnnotation().setTerm("Core.Description").setExpression(
- new CsdlConstantAnnotationExpression(ConstantAnnotationExpression.Type.String,
+ new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String,
"A lengthy description of a model element")),
new CsdlAnnotation().setTerm("Core.IsLanguageDependent")));
}
[2/4] olingo-odata4 git commit: [OLINGO-786] Make annotaion csdl
classes spec compliant`
Posted by ch...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlExpression.java
new file mode 100644
index 0000000..6c9e88c
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlExpression.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.commons.api.edm.provider.annotation;
+
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
+
+public abstract class CsdlExpression extends CsdlAbstractEdmItem {
+
+ private static final long serialVersionUID = 4731101778893577444L;
+
+ /**
+ * Return true if the expression is constant
+ * @return true if the expression is constant
+ */
+ public boolean isConstant() {
+ return this instanceof CsdlConstantExpression;
+ }
+
+ /**
+ * Casts the expression to {@link org.apache.olingo.commons.api.edm.annotation.CsdlConstantExpression}
+ * @return Constant Expression
+ */
+ public CsdlConstantExpression asConstant() {
+ return isConstant() ? (CsdlConstantExpression) this : null;
+ }
+
+ /**
+ * Return true if the expression is dynamic
+ * @return true if the expression is dynamic
+ */
+ public boolean isDynamic() {
+ return this instanceof CsdlDynamicExpression;
+ }
+
+ /**
+ * Cast the expression to {@link org.apache.olingo.commons.api.edm.annotation.CsdlDynamicExpression}
+ * @return Dynamic Expression
+ */
+ public CsdlDynamicExpression asDynamic() {
+ return isDynamic() ? (CsdlDynamicExpression) this : null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIf.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIf.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIf.java
new file mode 100644
index 0000000..b010fb7
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIf.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+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;
+
+/**
+ * Represents a edm:If expression
+ */
+public class CsdlIf extends CsdlDynamicExpression implements CsdlAnnotatable {
+
+ private static final long serialVersionUID = -8571383625077590656L;
+
+ private CsdlExpression guard;
+ private CsdlExpression _then;
+ private CsdlExpression _else;
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlIf setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+
+ /**
+ * Returns the first expression of the edm:If expression.
+ * This expression represents the condition of the if expression
+ *
+ * @return First expression of the if expression
+ */
+ public CsdlExpression getGuard() {
+ return guard;
+ }
+
+ public CsdlIf setGuard(final CsdlExpression guard) {
+ this.guard = guard;
+ return this;
+ }
+
+ /**
+ * Return the second expression of the edm:If expression.
+ * If the condition of the condition is evaluated to true,
+ * this expression as to be executed.
+ *
+ * @return Second Expression of the edm:If expression
+ */
+ public CsdlExpression getThen() {
+ return _then;
+ }
+
+ public CsdlIf setThen(final CsdlExpression _then) {
+ this._then = _then;
+ return this;
+ }
+
+ /**
+ * Return the third expression of the edm:If expression.
+ * If the condition of the condition is evaluated to false,
+ * this expression as to be executed.
+ *
+ * @return Third Expression of the edm:If expression
+ */
+ public CsdlExpression getElse() {
+ return _else;
+ }
+
+ public CsdlIf setElse(final CsdlExpression _else) {
+ this._else = _else;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIsOf.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIsOf.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIsOf.java
new file mode 100644
index 0000000..4236e1a
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlIsOf.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
+
+/**
+ * The edm:IsOf expression evaluates a child expression and returns a Boolean value indicating whether
+ * the child expression returns the specified type
+ */
+public class CsdlIsOf extends CsdlDynamicExpression implements CsdlAnnotatable {
+
+ private static final long serialVersionUID = -893355856129761174L;
+
+ private String type;
+ private Integer maxLength;
+ private Integer precision;
+ private Integer scale;
+ private SRID srid;
+ private CsdlExpression value;
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlIsOf setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+ /**
+ * The type which is checked again the child expression
+ * @return EdmType type
+ */
+ public String getType() {
+ return type;
+ }
+
+ public CsdlIsOf setType(final String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Facet MaxLength
+ * @return fact MaxLength
+ */
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public CsdlIsOf setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ return this;
+ }
+
+ /**
+ * Facet Precision
+ * @return fact Precision
+ */
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public CsdlIsOf setPrecision(final Integer precision) {
+ this.precision = precision;
+return this;
+ }
+
+ /**
+ * Facet Scale
+ * @return facet Scale
+ */
+ public Integer getScale() {
+ return scale;
+ }
+
+ public CsdlIsOf setScale(final Integer scale) {
+ this.scale = scale;
+ return this;
+ }
+
+ /**
+ * Facet SRID
+ * @return facet SRID
+ */
+ public SRID getSrid() {
+ return srid;
+ }
+
+ public CsdlIsOf setSrid(final SRID srid) {
+ this.srid = srid;
+ return this;
+ }
+
+ /**
+ * Returns the child expression
+ * @return Returns the child expression
+ */
+ public CsdlExpression getValue() {
+ return value;
+ }
+
+ public CsdlIsOf setValue(final CsdlExpression value) {
+ this.value = value;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElement.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElement.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElement.java
new file mode 100644
index 0000000..dfbd09e
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElement.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.commons.api.edm.provider.annotation;
+
+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;
+
+/**
+ * The edm:LabeledElement expression assigns a name to a child expression. The value of the child expression can
+ * then be reused elsewhere with an edm:LabeledElementReference (See {@link CsdlLabeledElementReference}) expression.
+ */
+public class CsdlLabeledElement extends CsdlDynamicExpression implements CsdlAnnotatable{
+
+ private static final long serialVersionUID = -5885321101447070204L;
+
+ private String name;
+ private CsdlExpression value;
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlLabeledElement setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+
+ /**
+ * Returns the assigned name
+ * @return assigned name
+ */
+ public String getName() {
+ return name;
+ }
+
+ public CsdlLabeledElement setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Returns the child expression
+ *
+ * @return child expression
+ */
+ public CsdlExpression getValue() {
+ return value;
+ }
+
+ public CsdlLabeledElement setValue(final CsdlExpression value) {
+ this.value = value;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElementReference.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElementReference.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElementReference.java
new file mode 100644
index 0000000..a309c49
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLabeledElementReference.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+/**
+ * The edm:LabeledElementReference expression returns the value of an
+ * edm:LabeledElement (see {@link LabeledElement}) expression.
+ */
+public class CsdlLabeledElementReference extends CsdlDynamicExpression {
+ private static final long serialVersionUID = -4793707024628773226L;
+
+ private String value;
+
+ /**
+ * Returns the value of the edm:LabeledElement expression
+ * @return value of the edm:LabeledElement expression
+ */
+ public String getValue() {
+ return value;
+ }
+
+ public CsdlLabeledElementReference setValue(final String value) {
+ this.value = value;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLogicalOrComparisonExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLogicalOrComparisonExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLogicalOrComparisonExpression.java
new file mode 100644
index 0000000..3fcf6a2
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlLogicalOrComparisonExpression.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+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;
+
+public class CsdlLogicalOrComparisonExpression extends CsdlDynamicExpression implements CsdlAnnotatable {
+
+ private static final long serialVersionUID = -8268617065621508270L;
+
+ private final LogicalOrComparisonExpressionType type;
+ private CsdlExpression left;
+ private CsdlExpression right;
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ public CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType type) {
+ this.type = type;
+ }
+
+ /**
+ * Type of the constant expression
+ */
+ public enum LogicalOrComparisonExpressionType {
+ // Logical Operators
+ /**
+ * Type Edm.And must have two operands which must evaluate to a boolean value
+ */
+ And,
+ /**
+ * Type Edm.Or must have two operands which must evaluate to a boolean value
+ */
+ Or,
+ /**
+ * Type Edm.Or must have one operand
+ */
+ Not,
+
+ // Comparison Operators
+ /**
+ * Type Edm.Eq must have two operands which must evaluate to a boolean value
+ */
+ Eq,
+ /**
+ * Type Edm.Ne must have two operands which must evaluate to a boolean value
+ */
+ Ne,
+ /**
+ * Type Edm.Gt must have two operands which must evaluate to a boolean value
+ */
+ Gt,
+ /**
+ * Type Edm.Ge must have two operands which must evaluate to a boolean value
+ */
+ Ge,
+ /**
+ * Type Edm.Lt must have two operands which must evaluate to a boolean value
+ */
+ Lt,
+ /**
+ * Type Edm.Le must have two operands which must evaluate to a boolean value
+ */
+ Le;
+
+ /**
+ * Creates a new type by a given string e.g. "And".
+ * Will NOT throw an IlligalArgumentException for invalid types. If needed use the valueOf method.
+ * @param value Type as string
+ * @return Type type
+ */
+ public static LogicalOrComparisonExpressionType fromString(final String value) {
+ LogicalOrComparisonExpressionType result = null;
+ try {
+ result = valueOf(value);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ return result;
+ }
+ }
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlLogicalOrComparisonExpression setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+
+ /**
+ * Returns the type of the logical expression
+ * @return type of the logical expression
+ */
+ public LogicalOrComparisonExpressionType getType() {
+ return type;
+ }
+
+ /**
+ * The left expression. In case this is of type Edm.Not the left expression will be the same as the right expression.
+ * @return The left expression.
+ */
+ public CsdlExpression getLeft() {
+ return left;
+ }
+
+ public CsdlLogicalOrComparisonExpression setLeft(CsdlExpression left) {
+ this.left = left;
+ if (getType() == LogicalOrComparisonExpressionType.Not) {
+ this.right = left;
+ }
+ return this;
+ }
+
+ /**
+ * The right expression. In case this is of type Edm.Not the left expression will be the same as the right expression.
+ * @return The right expression.
+ */
+ public CsdlExpression getRight() {
+ return right;
+ }
+
+ public CsdlLogicalOrComparisonExpression setRight(CsdlExpression right) {
+ this.right = right;
+ if (getType() == LogicalOrComparisonExpressionType.Not) {
+ this.left = right;
+ }
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNavigationPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNavigationPropertyPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNavigationPropertyPath.java
new file mode 100644
index 0000000..a5ee684
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNavigationPropertyPath.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+/**
+ * The edm:NavigationPropertyPath expression provides a value for terms or term properties that specify the
+ * built-in abstract type Edm.NavigationPropertyPath
+ */
+public class CsdlNavigationPropertyPath extends CsdlDynamicExpression {
+ private static final long serialVersionUID = -8047231485537503181L;
+
+ private String value;
+
+ /**
+ * Returns the navigation property path itself.
+ *
+ * @return navigation property
+ */
+ public String getValue() {
+ return value;
+ }
+
+ public CsdlNavigationPropertyPath setValue(final String value) {
+ this.value = value;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNull.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNull.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNull.java
new file mode 100644
index 0000000..5350f2e
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlNull.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+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;
+
+/**
+ * The edm:Null expression returns an untyped null value.
+ */
+public class CsdlNull extends CsdlDynamicExpression implements CsdlAnnotatable {
+
+ private static final long serialVersionUID = 3696395405429914435L;
+
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlNull setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPath.java
new file mode 100644
index 0000000..244aa72
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPath.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+/**
+ * The edm:Path expression enables a value to be obtained by traversing an object graph.
+ * It can be used in annotations that target entity containers, entity sets, entity types, complex types,
+ * navigation properties of structured types, and properties of structured types.
+ */
+public class CsdlPath extends CsdlDynamicExpression {
+ private static final long serialVersionUID = 6458406537881061846L;
+
+ private String value;
+
+ /**
+ * Returns the target value of the expression
+ *
+ * @return target value of the expression
+ */
+ public String getValue() {
+ return value;
+ }
+
+ public CsdlPath setValue(final String value) {
+ this.value = value;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyPath.java
new file mode 100644
index 0000000..9a8689b
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyPath.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+/**
+ * The edm:PropertyPath expression provides a value for terms or term properties that specify the built-in
+ * abstract type Edm.PropertyPath.
+ */
+public class CsdlPropertyPath extends CsdlDynamicExpression {
+ private static final long serialVersionUID = -8182384289259575448L;
+
+ private String value;
+
+ /**
+ * Returns the property path itself.
+ * @return the property path itself
+ */
+ public String getValue() {
+ return value;
+ }
+
+ public CsdlPropertyPath setValue(final String value) {
+ this.value = value;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
new file mode 100644
index 0000000..2be2891
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+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;
+
+
+/**
+ * The edm:PropertyValue element supplies a value to a property on the type instantiated by an
+ * edm:Record expression (See {@link org.apache.olingo.commons.api.edm.annotation.EdmRecord}).
+ * The value is obtained by evaluating an expression.
+ */
+public class CsdlPropertyValue extends CsdlDynamicExpression implements CsdlAnnotatable{
+
+ private static final long serialVersionUID = -6671376680245613990L;
+
+ private String property;
+ private CsdlExpression value;
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlPropertyValue setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+
+ /**
+ * Property name
+ * @return Property name
+ */
+ public String getProperty() {
+ return property;
+ }
+
+ public CsdlPropertyValue setProperty(final String property) {
+ this.property = property;
+ return this;
+ }
+
+ /**
+ * Evaluated value of the expression (property value)
+ * @return evaluated value of the expression
+ */
+ public CsdlExpression getValue() {
+ return value;
+ }
+
+ public CsdlPropertyValue setValue(final CsdlExpression value) {
+ this.value = value;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlRecord.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlRecord.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlRecord.java
new file mode 100644
index 0000000..da9271d
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlRecord.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+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;
+
+/**
+ * The edm:Record expression enables a new entity type or complex type instance to be constructed.
+ * A record expression contains zero or more edm:PropertyValue (See {@link CsdlRecord} )elements.
+ */
+public class CsdlRecord extends CsdlDynamicExpression implements CsdlAnnotatable {
+
+ private static final long serialVersionUID = 8557849619469577884L;
+ private String type;
+ private List<CsdlPropertyValue> propertyValues = new ArrayList<CsdlPropertyValue>();
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlRecord setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+
+ /**
+ * Returns the entity type or complex type to be constructed.
+ * @return Entity type or complex type
+ */
+ public String getType() {
+ return type;
+ }
+
+ public CsdlRecord setType(final String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * List of edm:PropertyValues (See {@link CsdlPropertyValue}
+ * @return List of edm:PropertyValues (See
+ */
+ public List<CsdlPropertyValue> getPropertyValues() {
+ return propertyValues;
+ }
+
+ public CsdlRecord setPropertyValues(List<CsdlPropertyValue> propertyValues) {
+ this.propertyValues = propertyValues;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlUrlRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlUrlRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlUrlRef.java
new file mode 100644
index 0000000..1d2dc7b
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlUrlRef.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+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;
+
+/**
+ * The edm:UrlRef expression enables a value to be obtained by sending a GET request to the value of
+ * the UrlRef expression.
+ */
+public class CsdlUrlRef extends CsdlDynamicExpression implements CsdlAnnotatable{
+
+ private static final long serialVersionUID = 3781479172952387841L;
+ private CsdlExpression value;
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlUrlRef setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+
+ /**
+ * Returns a expression of type Edm.String
+ * @return expression of type Edm.String
+ */
+ public CsdlExpression getValue() {
+ return value;
+ }
+
+ public CsdlUrlRef setValue(final CsdlExpression value) {
+ this.value = value;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java
deleted file mode 100644
index f209c7a..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * Represents a dynamic expression
- */
-public interface DynamicAnnotationExpression extends AnnotationExpression {
-
- /**
- * Returns true if the expression is a logical edm:Not expression
- * @return true if the expression is a logical edm:Not expression
- */
- boolean isNot();
-
- /**
- * Casts the expression to a {@link Not} expression
- * @return Not expression
- */
- Not asNot();
-
- /**
- * Returns true iff the annotation is an expression with two operands.
- * If so, the expression is one of:
- * <ul>
- * <li>And</li>
- * <li>Or</li>
- * <li>Eq</li>
- * <li>Ne</li>
- * <li>Gt</li>
- * <li>Ge</li>
- * <li>Lt</li>
- * <li>Le</li>
- *
- * @return true iff the annotation is an expression with two operands.
- */
- boolean isTwoParamsOp();
-
- /**
- * Casts the expression as {@link TwoParamsOpDynamicAnnotationExpression}
- * @return TwoParamsOpDynamicAnnotationExpression two params op dynamic annotation expression
- */
- TwoParamsOpDynamicAnnotationExpression asTwoParamsOp();
-
- /**
- * Returns true if the expression is a edm:AnnotationPath expression
- * @return true if the expression is a edm:AnnotationPath expression
- */
- boolean isAnnotationPath();
-
- /**
- * Casts the expression to a {@link AnnotationPath} expression
- * @return AnnotationPath expression
- */
- AnnotationPath asAnnotationPath();
-
- /**
- * Returns true if the expression is a edm:Apply expression
- * @return true if the expression is a edm:Apply expression
- */
- boolean isApply();
-
- /**
- * Casts the expression to a {@link Apply} expression
- * @return Apply expression
- */
- Apply asApply();
-
- /**
- * Returns true if the expression is a edm:Cast expression
- * @return true if the expression is a edm:Cast expression
- */
- boolean isCast();
-
- /**
- * Casts the expression to a {@link Cast} expression
- * @return Cast expression
- */
- Cast asCast();
-
- /**
- * Returns true if the expression is a edm:Collection expression
- * @return true if the expression is a edm:Collection expression
- */
- boolean isCollection();
-
- /**
- * Casts the expression to a {@link Collection} expression
- * @return Collection expression
- */
- Collection asCollection();
-
- /**
- * Returns true if the expression is a edm:If expression
- * @return true if the expression is a edm:If expression
- */
- boolean isIf();
-
- /**
- * Casts the expression to a {@link If} expression
- * @return If expression
- */
- If asIf();
-
- /**
- * Returns true if the expression is a edm:IsOf expression
- * @return true if the expression is a edm:IsOf expression
- */
- boolean isIsOf();
-
- /**
- * Casts the expression to a {@link IsOf} expression
- * @return IsOf expression
- */
- IsOf asIsOf();
-
- /**
- * Returns true if the expression is a edm:LabeledElement expression
- * @return true if the expression is a edm:LabeledElement expression
- */
- boolean isLabeledElement();
-
- /**
- * Casts the expression to a {@link LabeledElement} expression
- * @return LabeledElement expression
- */
- LabeledElement asLabeledElement();
-
- /**
- * Returns true if the expression is a edm:LabeledElementReference expression
- * @return true if the expression is a edm:LabeledElementReference expression
- */
- boolean isLabeledElementReference();
-
- /**
- * Casts the expression to a {@link LabeledElementReference} expression
- * @return LabeledElementReference expression
- */
- LabeledElementReference asLabeledElementReference();
-
- /**
- * Returns true if the expression is a edm:Null expression
- * @return true if the expression is a edm:Null expression
- */
- boolean isNull();
-
- /**
- * Casts the expression to a {@link Null} expression
- * @return Null expression
- */
- Null asNull();
-
- /**
- * Returns true if the expression is a edm:NavigationPropertyPath expression
- * @return true if the expression is a edm:NavigationPropertyPath expression
- */
- boolean isNavigationPropertyPath();
-
- /**
- * Casts the expression to a {@link NavigationPropertyPath} expression
- * @return NavigationPropertyPath expression
- */
- NavigationPropertyPath asNavigationPropertyPath();
-
- /**
- * Returns true if the expression is a edm:Path expression
- * @return true if the expression is a edm:Path expression
- */
- boolean isPath();
-
- /**
- * Casts the expression to a {@link Path} expression
- * @return Path expression
- */
- Path asPath();
-
- /**
- * Returns true if the expression is a edm:PropertyPath expression
- * @return true if the expression is a edm:PropertyPath expression
- */
- boolean isPropertyPath();
-
- /**
- * Casts the expression to a {@link PropertyPath} expression
- * @return PropertyPath expression
- */
- PropertyPath asPropertyPath();
-
- /**
- * Returns true if the expression is a edm:PropertyValue expression
- * @return true if the expression is a edm:PropertyValue expression
- */
- boolean isPropertyValue();
-
- /**
- * Casts the expression to a {@link PropertyValue} expression
- * @return PropertyValue expression
- */
- PropertyValue asPropertyValue();
-
- /**
- * Returns true if the expression is a edm:Record expression
- * @return true if the expression is a edm:Record expression
- */
- boolean isRecord();
-
- /**
- * Casts the expression to a {@link Record} expression
- * @return Record expression
- */
- Record asRecord();
-
- /**
- * Returns true if the expression is a edm:UrlRef expression
- * @return true if the expression is a edm:UrlRef expression
- */
- boolean isUrlRef();
-
- /**
- * Casts the expression to a {@link UrlRef} expression
- * @return UrlRef expression
- */
- UrlRef asUrlRef();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java
deleted file mode 100644
index 50be557..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.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.commons.api.edm.provider.annotation;
-
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-
-/**
- * Represents a edm:If expression
- */
-public interface If extends DynamicAnnotationExpression, CsdlAnnotatable {
-
- /**
- * Returns the first expression of the edm:If expression.
- * This expression represents the condition of the if expression
- *
- * @return First expression of the if expression
- */
- AnnotationExpression getGuard();
-
- /**
- * Return the second expression of the edm:If expression.
- * If the condition of the condition is evaluated to true,
- * this expression as to be executed.
- *
- * @return Second Expression of the edm:If expression
- */
- AnnotationExpression getThen();
-
- /**
- * Return the third expression of the edm:If expression.
- * If the condition of the condition is evaluated to false,
- * this expression as to be executed.
- *
- * @return Third Expression of the edm:If expression
- */
- AnnotationExpression getElse();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java
deleted file mode 100644
index ef08189..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.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.commons.api.edm.provider.annotation;
-
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-
-/**
- * The edm:IsOf expression evaluates a child expression and returns a Boolean value indicating whether
- * the child expression returns the specified type
- */
-public interface IsOf extends DynamicAnnotationExpression, CsdlAnnotatable {
-
- /**
- * Facet MaxLength
- * @return fact MaxLength
- */
- Integer getMaxLength();
-
- /**
- * Facet Precision
- * @return fact Precision
- */
- Integer getPrecision();
-
- /**
- * Facet Scale
- * @return facet Scale
- */
- Integer getScale();
-
- /**
- * Facet SRID
- * @return facet SRID
- */
- SRID getSrid();
-
- /**
- * The type which is checked again the child expression
- * @return EdmType type
- */
- String getType();
-
- /**
- * Returns true if the child expression returns the specified typed
- * @return Returns true if the child expression returns the specified typed
- */
- DynamicAnnotationExpression getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java
deleted file mode 100644
index 0a1977d..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-
-/**
- * The edm:LabeledElement expression assigns a name to a child expression. The value of the child expression can
- * then be reused elsewhere with an edm:LabeledElementReference (See {@link LabeledElementReference}) expression.
- */
-public interface LabeledElement extends DynamicAnnotationExpression, CsdlAnnotatable {
-
- /**
- * Returns the assigned name
- * @return assigned name
- */
- String getName();
-
- /**
- * Returns the child expression
- *
- * @return child expression
- */
- DynamicAnnotationExpression getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java
deleted file mode 100644
index 5d4adf1..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * The edm:LabeledElementReference expression returns the value of an
- * edm:LabeledElement (see {@link LabeledElement}) expression.
- */
-public interface LabeledElementReference extends DynamicAnnotationExpression {
-
- /**
- * Returns the value of the edm:LabeledElement expression
- * @return value of the edm:LabeledElement expression
- */
- String getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/NavigationPropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/NavigationPropertyPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/NavigationPropertyPath.java
deleted file mode 100644
index 9c7d5b1..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/NavigationPropertyPath.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * The edm:NavigationPropertyPath expression provides a value for terms or term properties that specify the
- * built-in abstract type Edm.NavigationPropertyPath
- */
-public interface NavigationPropertyPath extends DynamicAnnotationExpression {
- /**
- * Returns the navigation property path itself.
- *
- * @return navigation property
- */
- String getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Not.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Not.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Not.java
deleted file mode 100644
index 4dfebde..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Not.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * Represents a logical edm:Le expression
- */
-public interface Not extends DynamicAnnotationExpression {
-
- /**
- * Returns a boolean value
- * @return either true or false
- */
- DynamicAnnotationExpression getExpression();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java
deleted file mode 100644
index 84fafde..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Null.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-
-/**
- * The edm:Null expression returns an untyped null value.
- */
-public interface Null extends DynamicAnnotationExpression, CsdlAnnotatable {
- // No additional methods needed for now.
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Path.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Path.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Path.java
deleted file mode 100644
index abc4689..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Path.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * The edm:Path expression enables a value to be obtained by traversing an object graph.
- * It can be used in annotations that target entity containers, entity sets, entity types, complex types,
- * navigation properties of structured types, and properties of structured types.
- */
-public interface Path extends DynamicAnnotationExpression {
-
- /**
- * Returns the target value of the expression
- *
- * @return target value of the expression
- */
- String getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyPath.java
deleted file mode 100644
index d8c1e7e..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyPath.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * The edm:PropertyPath expression provides a value for terms or term properties that specify the built-in
- * abstract type Edm.PropertyPath.
- */
-public interface PropertyPath extends DynamicAnnotationExpression {
-
- /**
- * Returns the property path itself.
- * @return the property path itself
- */
- String getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java
deleted file mode 100644
index 41447e9..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/PropertyValue.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-
-/**
- * The edm:PropertyValue element supplies a value to a property on the type instantiated by an
- * edm:Record expression (See {@link org.apache.olingo.commons.api.edm.annotation.EdmRecord}).
- * The value is obtained by evaluating an expression.
- */
-public interface PropertyValue extends DynamicAnnotationExpression, CsdlAnnotatable {
-
- /**
- * Property name
- * @return Property name
- */
- String getProperty();
-
- /**
- * Evaluated value of the expression (property value)
- * @return evaluated value of the expression
- */
- AnnotationExpression getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java
deleted file mode 100644
index db042e4..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Record.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-import java.util.List;
-
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-
-/**
- * The edm:Record expression enables a new entity type or complex type instance to be constructed.
- * A record expression contains zero or more edm:PropertyValue (See {@link Record} )elements.
- */
-public interface Record extends DynamicAnnotationExpression, CsdlAnnotatable {
-
- /**
- * List of edm:PropertyValues (See {@link PropertyValue}
- * @return List of edm:PropertyValues (See
- */
- List<PropertyValue> getPropertyValues();
-
- /**
- * Returns the entity type or complex type to be constructed.
- * @return Entity type or complex type
- */
- String getType();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/TwoParamsOpDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/TwoParamsOpDynamicAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/TwoParamsOpDynamicAnnotationExpression.java
deleted file mode 100644
index 91f49af..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/TwoParamsOpDynamicAnnotationExpression.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * Represents a generic expression with two child exprssions
- */
-public interface TwoParamsOpDynamicAnnotationExpression extends DynamicAnnotationExpression {
-
- /**
- * Type (Operator) of the expression
- */
- public static enum Type {
- /**
- * Logical And
- */
- And,
- /**
- * Logical Or
- */
- Or,
- /**
- * Equals
- */
- Eq,
- /**
- * Not equals
- */
- Ne,
- /**
- * Greater than
- */
- Gt,
- /**
- * Greater or equals than
- */
- Ge,
- /**
- * Less than
- */
- Lt,
- /**
- * Less or equals than
- */
- Le;
-
- /**
- * Creates the type(Operator) of a expressin
- * @param value Value of the operator like "And" or "Eq"
- * @return Type(Operator) of the expression
- */
- public static Type fromString(final String value) {
- Type result = null;
- for (Type type : values()) {
- if (value.equals(type.name())) {
- result = type;
- }
- }
- return result;
- }
- }
-
- /**
- * Returns the type of the expression result
- * @return Type of the result
- */
- Type getType();
-
- /**
- * Returns the first expression (left child)
- * @return Child expression
- */
- DynamicAnnotationExpression getLeftExpression();
-
- /**
- * Returns the second expression (right child)
- * @return Child expression
- */
- DynamicAnnotationExpression getRightExpression();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/UrlRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/UrlRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/UrlRef.java
deleted file mode 100644
index c6bd824..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/UrlRef.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * The edm:UrlRef expression enables a value to be obtained by sending a GET request to the value of
- * the UrlRef expression.
- */
-public interface UrlRef extends DynamicAnnotationExpression {
-
- /**
- * Returns a expression of type Edm.String
- * @return expression of type Edm.String
- */
- AnnotationExpression getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationImpl.java
index d867885..53fbfde 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmAnnotationImpl.java
@@ -31,9 +31,9 @@ import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpressi
import org.apache.olingo.commons.api.edm.annotation.EdmPropertyValue;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.DynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.PropertyValue;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlDynamicExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPropertyValue;
import org.apache.olingo.commons.core.edm.annotation.EdmAndImpl;
import org.apache.olingo.commons.core.edm.annotation.EdmAnnotationPathImpl;
import org.apache.olingo.commons.core.edm.annotation.EdmApplyImpl;
@@ -84,7 +84,7 @@ public class EdmAnnotationImpl extends AbstractEdmAnnotatable implements EdmAnno
return annotation.getQualifier();
}
- private EdmAnnotationExpression getExpression(final AnnotationExpression exp) {
+ private EdmAnnotationExpression getExpression(final CsdlExpression exp) {
EdmAnnotationExpression _expression = null;
if (exp.isConstant()) {
@@ -96,59 +96,60 @@ public class EdmAnnotationImpl extends AbstractEdmAnnotatable implements EdmAnno
return _expression;
}
- private EdmDynamicAnnotationExpression getDynamicExpression(final DynamicAnnotationExpression exp) {
+ private EdmDynamicAnnotationExpression getDynamicExpression(final CsdlDynamicExpression exp) {
EdmDynamicAnnotationExpression _expression = null;
- if (exp.isNot()) {
- _expression = new EdmNotImpl(getDynamicExpression(exp.asNot().getExpression()));
- } else if (exp.isTwoParamsOp()) {
- switch (exp.asTwoParamsOp().getType()) {
+ if (exp.isLogicalOrComparison()) {
+ switch (exp.asLogicalOrComparison().getType()) {
+ case Not:
+ _expression = new EdmNotImpl(getExpression(exp.asLogicalOrComparison().getLeft()));
+ break;
case And:
_expression = new EdmAndImpl(
- getDynamicExpression(exp.asTwoParamsOp().getLeftExpression()),
- getDynamicExpression(exp.asTwoParamsOp().getRightExpression()));
+ getExpression(exp.asLogicalOrComparison().getLeft()),
+ getExpression(exp.asLogicalOrComparison().getRight()));
break;
case Or:
_expression = new EdmOrImpl(
- getDynamicExpression(exp.asTwoParamsOp().getLeftExpression()),
- getDynamicExpression(exp.asTwoParamsOp().getRightExpression()));
+ getExpression(exp.asLogicalOrComparison().getLeft()),
+ getExpression(exp.asLogicalOrComparison().getRight()));
break;
case Eq:
_expression = new EdmEqImpl(
- getDynamicExpression(exp.asTwoParamsOp().getLeftExpression()),
- getDynamicExpression(exp.asTwoParamsOp().getRightExpression()));
+ getExpression(exp.asLogicalOrComparison().getLeft()),
+ getExpression(exp.asLogicalOrComparison().getRight()));
break;
case Ne:
_expression = new EdmNeImpl(
- getDynamicExpression(exp.asTwoParamsOp().getLeftExpression()),
- getDynamicExpression(exp.asTwoParamsOp().getRightExpression()));
+ getExpression(exp.asLogicalOrComparison().getLeft()),
+ getExpression(exp.asLogicalOrComparison().getRight()));
break;
case Ge:
_expression = new EdmGeImpl(
- getDynamicExpression(exp.asTwoParamsOp().getLeftExpression()),
- getDynamicExpression(exp.asTwoParamsOp().getRightExpression()));
+ getExpression(exp.asLogicalOrComparison().getLeft()),
+ getExpression(exp.asLogicalOrComparison().getRight()));
break;
case Gt:
_expression = new EdmGtImpl(
- getDynamicExpression(exp.asTwoParamsOp().getLeftExpression()),
- getDynamicExpression(exp.asTwoParamsOp().getRightExpression()));
+ getExpression(exp.asLogicalOrComparison().getLeft()),
+ getExpression(exp.asLogicalOrComparison().getRight()));
break;
case Le:
_expression = new EdmLeImpl(
- getDynamicExpression(exp.asTwoParamsOp().getLeftExpression()),
- getDynamicExpression(exp.asTwoParamsOp().getRightExpression()));
+ getExpression(exp.asLogicalOrComparison().getLeft()),
+ getExpression(exp.asLogicalOrComparison().getRight()));
break;
case Lt:
_expression = new EdmLtImpl(
- getDynamicExpression(exp.asTwoParamsOp().getLeftExpression()),
- getDynamicExpression(exp.asTwoParamsOp().getRightExpression()));
+ getExpression(exp.asLogicalOrComparison().getLeft()),
+ getExpression(exp.asLogicalOrComparison().getRight()));
break;
default:
@@ -158,7 +159,7 @@ public class EdmAnnotationImpl extends AbstractEdmAnnotatable implements EdmAnno
} else if (exp.isApply()) {
final List<EdmAnnotationExpression> parameters =
new ArrayList<EdmAnnotationExpression>(exp.asApply().getParameters().size());
- for (AnnotationExpression param : exp.asApply().getParameters()) {
+ for (CsdlExpression param : exp.asApply().getParameters()) {
parameters.add(getExpression(param));
}
_expression = new EdmApplyImpl(exp.asApply().getFunction(), parameters);
@@ -167,7 +168,7 @@ public class EdmAnnotationImpl extends AbstractEdmAnnotatable implements EdmAnno
} else if (exp.isCollection()) {
final List<EdmAnnotationExpression> items =
new ArrayList<EdmAnnotationExpression>(exp.asCollection().getItems().size());
- for (AnnotationExpression param : exp.asCollection().getItems()) {
+ for (CsdlExpression param : exp.asCollection().getItems()) {
items.add(getExpression(param));
}
_expression = new EdmCollectionImpl(items);
@@ -177,10 +178,10 @@ public class EdmAnnotationImpl extends AbstractEdmAnnotatable implements EdmAnno
getExpression(exp.asIf().getThen()),
getExpression(exp.asIf().getElse()));
} else if (exp.isIsOf()) {
- _expression = new EdmIsOfImpl(edm, exp.asIsOf(), getDynamicExpression(exp.asIsOf().getValue()));
+ _expression = new EdmIsOfImpl(edm, exp.asIsOf(), getDynamicExpression(exp.asIsOf().getValue().asDynamic()));
} else if (exp.isLabeledElement()) {
_expression = new EdmLabeledElementImpl(
- exp.asLabeledElement().getName(), getDynamicExpression(exp.asLabeledElement().getValue()));
+ exp.asLabeledElement().getName(), getDynamicExpression(exp.asLabeledElement().getValue().asDynamic()));
} else if (exp.isLabeledElementReference()) {
_expression = new EdmLabeledElementReferenceImpl(exp.asLabeledElementReference().getValue());
} else if (exp.isNull()) {
@@ -197,7 +198,7 @@ public class EdmAnnotationImpl extends AbstractEdmAnnotatable implements EdmAnno
} else if (exp.isRecord()) {
final List<EdmPropertyValue> propertyValues =
new ArrayList<EdmPropertyValue>(exp.asRecord().getPropertyValues().size());
- for (PropertyValue propertyValue : exp.asRecord().getPropertyValues()) {
+ for (CsdlPropertyValue propertyValue : exp.asRecord().getPropertyValues()) {
propertyValues.add(new EdmPropertyValueImpl(
propertyValue.getProperty(), getExpression(propertyValue.getValue())));
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmTwoParamsOpDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmTwoParamsOpDynamicAnnotationExpression.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmTwoParamsOpDynamicAnnotationExpression.java
index 78bb35a..2c5a289 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmTwoParamsOpDynamicAnnotationExpression.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmTwoParamsOpDynamicAnnotationExpression.java
@@ -18,30 +18,31 @@
*/
package org.apache.olingo.commons.core.edm.annotation;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmTwoParamsOpDynamicAnnotationExpression;
public abstract class AbstractEdmTwoParamsOpDynamicAnnotationExpression
extends AbstractEdmDynamicAnnotationExpression implements EdmTwoParamsOpDynamicAnnotationExpression {
- private final EdmDynamicAnnotationExpression left;
+ private final EdmAnnotationExpression left;
- private final EdmDynamicAnnotationExpression right;
+ private final EdmAnnotationExpression right;
public AbstractEdmTwoParamsOpDynamicAnnotationExpression(
- final EdmDynamicAnnotationExpression left, final EdmDynamicAnnotationExpression right) {
+ final EdmAnnotationExpression left, final EdmAnnotationExpression right) {
this.left = left;
this.right = right;
}
@Override
- public EdmDynamicAnnotationExpression getLeftExpression() {
+ public EdmAnnotationExpression getLeftExpression() {
return left;
}
@Override
- public EdmDynamicAnnotationExpression getRightExpression() {
+ public EdmAnnotationExpression getRightExpression() {
return right;
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAndImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAndImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAndImpl.java
index 02e4b48..0b75297 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAndImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAndImpl.java
@@ -19,11 +19,12 @@
package org.apache.olingo.commons.core.edm.annotation;
import org.apache.olingo.commons.api.edm.annotation.EdmAnd;
+import org.apache.olingo.commons.api.edm.annotation.EdmAnnotationExpression;
import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
public class EdmAndImpl extends AbstractEdmTwoParamsOpDynamicAnnotationExpression implements EdmAnd {
- public EdmAndImpl(final EdmDynamicAnnotationExpression left, final EdmDynamicAnnotationExpression right) {
+ public EdmAndImpl(final EdmAnnotationExpression left, final EdmAnnotationExpression right) {
super(left, right);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java
index 086bdf2..8989200 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java
@@ -23,20 +23,20 @@ import org.apache.olingo.commons.api.edm.EdmType;
import org.apache.olingo.commons.api.edm.annotation.EdmCast;
import org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression;
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.CsdlCast;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
public class EdmCastImpl extends AbstractEdmAnnotatableDynamicAnnotationExpression implements EdmCast {
private final Edm edm;
- private final Cast cast;
+ private final CsdlCast cast;
private final EdmDynamicAnnotationExpression value;
private EdmType type;
- public EdmCastImpl(final Edm edm, final Cast cast, final EdmDynamicAnnotationExpression value) {
+ public EdmCastImpl(final Edm edm, final CsdlCast cast, final EdmDynamicAnnotationExpression value) {
this.edm = edm;
this.cast = cast;
this.value = value;
[4/4] olingo-odata4 git commit: [OLINGO-786] Make annotaion csdl
classes spec compliant`
Posted by ch...@apache.org.
[OLINGO-786] Make annotaion csdl classes spec compliant`
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/67ccbf9d
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/67ccbf9d
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/67ccbf9d
Branch: refs/heads/olingo786
Commit: 67ccbf9ddb22b6f51a05acfc5213a41fdfddf39b
Parents: 576acf4
Author: Christian Amend <ch...@sap.com>
Authored: Fri Oct 16 14:12:24 2015 +0200
Committer: Christian Amend <ch...@sap.com>
Committed: Fri Oct 16 14:12:24 2015 +0200
----------------------------------------------------------------------
...lAnnotatableDynamicAnnotationExpression.java | 38 --
...ctClientCsdlDynamicAnnotationExpression.java | 357 -------------------
.../xml/AbstractClientCsdlEdmDeserializer.java | 26 +-
...tClientCsdlElementOrAttributeExpression.java | 37 --
.../core/edm/xml/ClientCsdlAnnotation.java | 9 +-
.../core/edm/xml/ClientCsdlAnnotationPath.java | 27 --
.../client/core/edm/xml/ClientCsdlApply.java | 80 -----
.../client/core/edm/xml/ClientCsdlCast.java | 137 -------
.../core/edm/xml/ClientCsdlCollection.java | 64 ----
.../ClientCsdlConstantAnnotationExpression.java | 27 --
.../client/core/edm/xml/ClientCsdlIf.java | 61 ----
.../client/core/edm/xml/ClientCsdlIsOf.java | 136 -------
.../core/edm/xml/ClientCsdlLabeledElement.java | 79 ----
.../xml/ClientCsdlLabeledElementReference.java | 28 --
.../xml/ClientCsdlNavigationPropertyPath.java | 28 --
.../client/core/edm/xml/ClientCsdlNot.java | 39 --
.../client/core/edm/xml/ClientCsdlNull.java | 51 ---
.../client/core/edm/xml/ClientCsdlPath.java | 27 --
.../core/edm/xml/ClientCsdlPropertyPath.java | 27 --
.../core/edm/xml/ClientCsdlPropertyValue.java | 81 -----
.../client/core/edm/xml/ClientCsdlRecord.java | 76 ----
...lTwoParamsOpDynamicAnnotationExpression.java | 62 ----
.../client/core/edm/xml/ClientCsdlUrlRef.java | 65 ----
.../edm/xml/annotation/ClientCsdlApply.java | 61 ++++
.../core/edm/xml/annotation/ClientCsdlCast.java | 72 ++++
.../xml/annotation/ClientCsdlCollection.java | 55 +++
.../annotation/ClientCsdlDynamicExpression.java | 162 +++++++++
.../core/edm/xml/annotation/ClientCsdlIsOf.java | 71 ++++
.../annotation/ClientCsdlLabeledElement.java | 57 +++
.../core/edm/xml/annotation/ClientCsdlNull.java | 53 +++
.../xml/annotation/ClientCsdlPropertyValue.java | 59 +++
.../edm/xml/annotation/ClientCsdlRecord.java | 57 +++
.../edm/xml/annotation/ClientCsdlUrlRef.java | 54 +++
.../apache/olingo/client/core/MetadataTest.java | 47 +--
.../commons/api/edm/annotation/EdmNot.java | 6 +-
...mTwoParamsOpDynamicAnnotationExpression.java | 4 +-
.../api/edm/provider/CsdlAnnotation.java | 12 +-
.../api/edm/provider/CsdlExpression.java | 26 --
.../AbstractCsdlAnnotationExpression.java | 49 ---
.../annotation/AnnotationExpression.java | 52 ---
.../edm/provider/annotation/AnnotationPath.java | 31 --
.../api/edm/provider/annotation/Apply.java | 49 ---
.../api/edm/provider/annotation/Cast.java | 65 ----
.../api/edm/provider/annotation/Collection.java | 36 --
.../ConstantAnnotationExpression.java | 118 ------
.../provider/annotation/CsdlAnnotationPath.java | 41 +++
.../api/edm/provider/annotation/CsdlApply.java | 77 ++++
.../api/edm/provider/annotation/CsdlCast.java | 124 +++++++
.../edm/provider/annotation/CsdlCollection.java | 50 +++
.../CsdlConstantAnnotationExpression.java | 58 ---
.../annotation/CsdlConstantExpression.java | 142 ++++++++
.../annotation/CsdlDynamicExpression.java | 282 +++++++++++++++
.../edm/provider/annotation/CsdlExpression.java | 58 +++
.../api/edm/provider/annotation/CsdlIf.java | 95 +++++
.../api/edm/provider/annotation/CsdlIsOf.java | 131 +++++++
.../provider/annotation/CsdlLabeledElement.java | 74 ++++
.../annotation/CsdlLabeledElementReference.java | 42 +++
.../CsdlLogicalOrComparisonExpression.java | 150 ++++++++
.../annotation/CsdlNavigationPropertyPath.java | 43 +++
.../api/edm/provider/annotation/CsdlNull.java | 45 +++
.../api/edm/provider/annotation/CsdlPath.java | 44 +++
.../provider/annotation/CsdlPropertyPath.java | 42 +++
.../provider/annotation/CsdlPropertyValue.java | 76 ++++
.../api/edm/provider/annotation/CsdlRecord.java | 73 ++++
.../api/edm/provider/annotation/CsdlUrlRef.java | 59 +++
.../annotation/DynamicAnnotationExpression.java | 241 -------------
.../commons/api/edm/provider/annotation/If.java | 54 ---
.../api/edm/provider/annotation/IsOf.java | 66 ----
.../edm/provider/annotation/LabeledElement.java | 42 ---
.../annotation/LabeledElementReference.java | 33 --
.../annotation/NavigationPropertyPath.java | 33 --
.../api/edm/provider/annotation/Not.java | 31 --
.../api/edm/provider/annotation/Null.java | 28 --
.../api/edm/provider/annotation/Path.java | 35 --
.../edm/provider/annotation/PropertyPath.java | 33 --
.../edm/provider/annotation/PropertyValue.java | 42 ---
.../api/edm/provider/annotation/Record.java | 43 ---
.../TwoParamsOpDynamicAnnotationExpression.java | 96 -----
.../api/edm/provider/annotation/UrlRef.java | 33 --
.../commons/core/edm/EdmAnnotationImpl.java | 61 ++--
...mTwoParamsOpDynamicAnnotationExpression.java | 11 +-
.../commons/core/edm/annotation/EdmAndImpl.java | 3 +-
.../core/edm/annotation/EdmCastImpl.java | 6 +-
.../EdmConstantAnnotationExpressionImpl.java | 10 +-
.../commons/core/edm/annotation/EdmEqImpl.java | 4 +-
.../commons/core/edm/annotation/EdmGeImpl.java | 4 +-
.../commons/core/edm/annotation/EdmGtImpl.java | 4 +-
.../core/edm/annotation/EdmIsOfImpl.java | 6 +-
.../commons/core/edm/annotation/EdmLeImpl.java | 3 +-
.../commons/core/edm/annotation/EdmLtImpl.java | 4 +-
.../commons/core/edm/annotation/EdmNeImpl.java | 4 +-
.../commons/core/edm/annotation/EdmNotImpl.java | 7 +-
.../commons/core/edm/annotation/EdmOrImpl.java | 4 +-
.../tecsvc/provider/ContainerProvider.java | 15 +-
.../server/tecsvc/provider/TermProvider.java | 11 +-
95 files changed, 2484 insertions(+), 2947 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index 68e98ae..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlAnnotatableDynamicAnnotationExpression.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 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/67ccbf9d/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
deleted file mode 100644
index 4202471..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlDynamicAnnotationExpression.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express 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.AbstractCsdlAnnotationExpression;
-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 AbstractCsdlAnnotationExpression 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 AbstractCsdlAnnotationExpression parseConstOrEnumExpression(final JsonParser jp) throws IOException {
- AbstractCsdlAnnotationExpression 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/67ccbf9d/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
index c96654c..a6943d1 100644
--- 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
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -20,21 +20,23 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
+
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> {
+public abstract class AbstractClientCsdlEdmDeserializer<T> extends JsonDeserializer<T> {
protected boolean isAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
- return ClientCsdlConstantAnnotationExpression.Type.fromString(jp.getCurrentName()) != null;
+ return CsdlConstantExpression.ConstantExpressionType.fromString(jp.getCurrentName()) != null;
}
- protected ClientCsdlConstantAnnotationExpression parseAnnotationConstExprConstruct(final JsonParser jp)
+ protected CsdlConstantExpression parseAnnotationConstExprConstruct(final JsonParser jp)
throws IOException {
- final ClientCsdlConstantAnnotationExpression constExpr = new ClientCsdlConstantAnnotationExpression();
- constExpr.setType(ClientCsdlConstantAnnotationExpression.Type.fromString(jp.getCurrentName()));
+ final CsdlConstantExpression constExpr = new CsdlConstantExpression();
+ constExpr.setType(CsdlConstantExpression.ConstantExpressionType.fromString(jp.getCurrentName()));
constExpr.setValue(jp.nextTextValue());
return constExpr;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index 6c4c5cf..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractClientCsdlElementOrAttributeExpression.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 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/67ccbf9d/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
index 5413444..131b6c9 100644
--- 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
@@ -20,15 +20,16 @@ package org.apache.olingo.client.core.edm.xml;
import java.io.IOException;
+import org.apache.olingo.client.core.edm.xml.annotation.ClientCsdlDynamicExpression;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
+
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 {
+public class ClientCsdlAnnotation extends CsdlAnnotation {
private static final long serialVersionUID = 5464714417411058033L;
@@ -55,7 +56,7 @@ class ClientCsdlAnnotation extends CsdlAnnotation {
annotation.setExpression(parseAnnotationConstExprConstruct(jp));
} else {
// Dynamic Expressions
- annotation.setExpression(jp.readValueAs(AbstractClientCsdlDynamicAnnotationExpression.class));
+ annotation.setExpression(jp.readValueAs(ClientCsdlDynamicExpression.class));
}
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index 195f24b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlAnnotationPath.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 ClientCsdlAnnotationPath extends AbstractClientCsdlElementOrAttributeExpression implements AnnotationPath {
-
- private static final long serialVersionUID = 5360735207353494466L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index 2d80c98..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlApply.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 = 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/67ccbf9d/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
deleted file mode 100644
index 384f6fa..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCast.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 = 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/67ccbf9d/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
deleted file mode 100644
index cc9832b..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlCollection.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 = 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/67ccbf9d/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
deleted file mode 100644
index 97ac1cc..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlConstantAnnotationExpression.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.CsdlConstantAnnotationExpression;
-
-class ClientCsdlConstantAnnotationExpression
- extends CsdlConstantAnnotationExpression {
-
- private static final long serialVersionUID = 5618680702707972904L;
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index 1289637..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIf.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 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/67ccbf9d/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
deleted file mode 100644
index 58b34e0..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlIsOf.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 = 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/67ccbf9d/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
deleted file mode 100644
index db1a734..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElement.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 = 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/67ccbf9d/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
deleted file mode 100644
index b3f1e5a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlLabeledElementReference.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 ClientCsdlLabeledElementReference
- extends AbstractClientCsdlElementOrAttributeExpression implements LabeledElementReference {
-
- private static final long serialVersionUID = 7560525604021670529L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index 039af20..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNavigationPropertyPath.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 ClientCsdlNavigationPropertyPath extends AbstractClientCsdlElementOrAttributeExpression
- implements NavigationPropertyPath {
-
- private static final long serialVersionUID = 879840502446301312L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index b417341..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNot.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 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/67ccbf9d/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
deleted file mode 100644
index 5181c0f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlNull.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 = 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/67ccbf9d/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
deleted file mode 100644
index ed4d2bc..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPath.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 ClientCsdlPath extends AbstractClientCsdlElementOrAttributeExpression implements Path {
-
- private static final long serialVersionUID = 6020168217561402545L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index 45b66dc..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyPath.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 ClientCsdlPropertyPath extends AbstractClientCsdlElementOrAttributeExpression implements PropertyPath {
-
- private static final long serialVersionUID = -9133862135834738470L;
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index d1cec62..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlPropertyValue.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.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/67ccbf9d/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
deleted file mode 100644
index f1176c9..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlRecord.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 = 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/67ccbf9d/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
deleted file mode 100644
index b4d3732..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlTwoParamsOpDynamicAnnotationExpression.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 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;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/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
deleted file mode 100644
index 280e1af..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientCsdlUrlRef.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 = 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/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlApply.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlApply.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlApply.java
new file mode 100644
index 0000000..4e2a000
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlApply.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.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlApply;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlApply.ApplyDeserializer.class)
+class ClientCsdlApply extends CsdlApply {
+
+ private static final long serialVersionUID = 4358398303405059879L;
+
+ 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(ClientCsdlDynamicExpression.class));
+ }
+ }
+ }
+
+ return apply;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCast.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCast.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCast.java
new file mode 100644
index 0000000..7880fb8
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCast.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.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlCast;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlCast.CastDeserializer.class)
+class ClientCsdlCast extends CsdlCast {
+
+ private static final long serialVersionUID = 3312415984116005313L;
+
+ 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(ClientCsdlDynamicExpression.class));
+ }
+ }
+ }
+ return cast;
+ }
+ }
+}
[3/4] olingo-odata4 git commit: [OLINGO-786] Make annotaion csdl
classes spec compliant`
Posted by ch...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCollection.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCollection.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCollection.java
new file mode 100644
index 0000000..e76dddd
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlCollection.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlCollection;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlCollection.CollectionDeserializer.class)
+class ClientCsdlCollection extends CsdlCollection {
+
+ private static final long serialVersionUID = -724749123749715643L;
+
+ 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(ClientCsdlDynamicExpression.class));
+ }
+ }
+ }
+
+ return collection;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlDynamicExpression.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlDynamicExpression.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlDynamicExpression.java
new file mode 100644
index 0000000..d332649
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlDynamicExpression.java
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlDynamicExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlIf;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlLogicalOrComparisonExpression;
+//CHECKSTYLE:OFF
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlLogicalOrComparisonExpression.LogicalOrComparisonExpressionType;
+//CHECKSTYLE:ON
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlNavigationPropertyPath;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPath;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPropertyPath;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlDynamicExpression.DynamicExpressionDeserializer.class)
+public abstract class ClientCsdlDynamicExpression extends CsdlDynamicExpression {
+
+ private static final long serialVersionUID = 1093411847477874348L;
+
+ static class DynamicExpressionDeserializer
+ extends AbstractClientCsdlEdmDeserializer<CsdlDynamicExpression> {
+
+ // TODO: Search for constants
+ private static final String APPLY = "Apply";
+ private static final String CAST = "Cast";
+ private static final String COLLECTION = "Collection";
+ private static final String IF = "If";
+ private static final String IS_OF = "IsOf";
+ private static final String LABELED_ELEMENT = "LabeledElement";
+ private static final String NULL = "Null";
+ private static final String RECORD = "Record";
+ private static final String URL_REF = "UrlRef";
+
+ private static final String ANNOTATION_PATH = "AnnotationPath";
+ private static final String NAVIGATION_PROPERTY_PATH = "NavigationPropertyPath";
+ private static final String PATH = "Path";
+ private static final String PROPERTY_PATH = "PropertyPath";
+
+ private CsdlExpression parseConstOrEnumExpression(final JsonParser jp) throws IOException {
+ CsdlExpression result;
+ if (isAnnotationConstExprConstruct(jp)) {
+ result = parseAnnotationConstExprConstruct(jp);
+ } else {
+ result = jp.readValueAs(ClientCsdlDynamicExpression.class);
+ }
+ jp.nextToken();
+
+ return result;
+ }
+
+ @Override
+ protected CsdlDynamicExpression doDeserialize(final JsonParser jp,
+ final DeserializationContext ctxt) throws IOException {
+
+ CsdlDynamicExpression expression = null;
+
+ if ("Not".equals(jp.getCurrentName())) {
+ final CsdlLogicalOrComparisonExpression not =
+ new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.Not);
+ jp.nextToken();
+ // Search for field name
+ while (jp.getCurrentToken() != JsonToken.FIELD_NAME) {
+ jp.nextToken();
+ }
+ not.setLeft(jp.readValueAs(ClientCsdlDynamicExpression.class));
+ // Search for end object
+ while (jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals("Not")) {
+ jp.nextToken();
+ }
+
+ expression = not;
+ } else if (LogicalOrComparisonExpressionType.fromString(jp.getCurrentName()) != null) {
+ final CsdlLogicalOrComparisonExpression logicalOrComparissonExp =
+ new CsdlLogicalOrComparisonExpression(LogicalOrComparisonExpressionType.fromString(jp.getCurrentName()));
+ jp.nextToken();
+ // Search for field name
+ while (jp.getCurrentToken() != JsonToken.FIELD_NAME) {
+ jp.nextToken();
+ }
+ // TODO: Read as expression
+ logicalOrComparissonExp.setLeft(jp.readValueAs(ClientCsdlDynamicExpression.class));
+ logicalOrComparissonExp.setRight(jp.readValueAs(ClientCsdlDynamicExpression.class));
+ // Search for expression
+ while (jp.getCurrentToken() != JsonToken.END_OBJECT || !jp.getCurrentName().equals(logicalOrComparissonExp
+ .getType().name())) {
+ jp.nextToken();
+ }
+
+ expression = logicalOrComparissonExp;
+ } else if (PATH.equals(jp.getCurrentName())) {
+ expression = new CsdlPath().setValue(jp.nextTextValue());
+ } else if (NAVIGATION_PROPERTY_PATH.equals(jp.getCurrentName())) {
+ expression = new CsdlNavigationPropertyPath().setValue(jp.nextTextValue());
+ } else if (PROPERTY_PATH.equals(jp.getCurrentName())) {
+ expression = new CsdlPropertyPath().setValue(jp.nextTextValue());
+ } else if (ANNOTATION_PATH.equals(jp.getCurrentName())) {
+ expression = new CsdlPath().setValue(jp.nextTextValue());
+ } 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 CsdlIf ifImpl = new CsdlIf();
+ 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/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlIsOf.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlIsOf.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlIsOf.java
new file mode 100644
index 0000000..31ec91a
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlIsOf.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlIsOf;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlIsOf.IsOfDeserializer.class)
+class ClientCsdlIsOf extends CsdlIsOf{
+
+ private static final long serialVersionUID = -893355856129761174L;
+
+ 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(ClientCsdlDynamicExpression.class));
+ }
+ }
+ }
+ return isof;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlLabeledElement.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlLabeledElement.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlLabeledElement.java
new file mode 100644
index 0000000..fdef249
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlLabeledElement.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.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlLabeledElement;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlLabeledElement.LabeledElementDeserializer.class)
+class ClientCsdlLabeledElement extends CsdlLabeledElement {
+
+ private static final long serialVersionUID = 4909387630253341824L;
+
+ 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(ClientCsdlDynamicExpression.class));
+ }
+ }
+ }
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlNull.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlNull.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlNull.java
new file mode 100644
index 0000000..d8ebb0c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlNull.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.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlNull;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlNull.NullDeserializer.class)
+class ClientCsdlNull extends CsdlNull {
+
+ 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/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlPropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlPropertyValue.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlPropertyValue.java
new file mode 100644
index 0000000..078f66c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlPropertyValue.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.edm.xml.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPropertyValue;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlPropertyValue.PropertyValueDeserializer.class)
+class ClientCsdlPropertyValue extends CsdlPropertyValue {
+
+ private static final long serialVersionUID = -8437649215282645228L;
+
+ 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(ClientCsdlDynamicExpression.class));
+ }
+ }
+ }
+ return propValue;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlRecord.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlRecord.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlRecord.java
new file mode 100644
index 0000000..10d2f50
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlRecord.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.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.ClientCsdlAnnotation;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlRecord;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlRecord.RecordDeserializer.class)
+class ClientCsdlRecord extends CsdlRecord {
+
+ private static final long serialVersionUID = 4275271751615410709L;
+
+ 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/67ccbf9d/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlUrlRef.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlUrlRef.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlUrlRef.java
new file mode 100644
index 0000000..2a4ebc8
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/annotation/ClientCsdlUrlRef.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.annotation;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.core.edm.xml.AbstractClientCsdlEdmDeserializer;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlUrlRef;
+
+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;
+
+@JsonDeserialize(using = ClientCsdlUrlRef.UrlRefDeserializer.class)
+class ClientCsdlUrlRef extends CsdlUrlRef {
+
+ private static final long serialVersionUID = -7693224811739000440L;
+
+ 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(ClientCsdlDynamicExpression.class));
+ }
+ }
+ }
+ return urlref;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java
index 740ba7f..99aa7bd 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java
@@ -56,12 +56,14 @@ 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.annotation.Apply;
-import org.apache.olingo.commons.api.edm.provider.annotation.Collection;
-import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.Path;
-import org.apache.olingo.commons.api.edm.provider.annotation.TwoParamsOpDynamicAnnotationExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.UrlRef;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlApply;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlCollection;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
+//CHECKSTYLE:OFF
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlLogicalOrComparisonExpression.LogicalOrComparisonExpressionType;
+//CHECKSTYLE:ON
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPath;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlUrlRef;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.commons.core.edm.primitivetype.EdmDecimal;
import org.apache.olingo.commons.core.edm.primitivetype.EdmInt32;
@@ -146,7 +148,7 @@ public class MetadataTest extends AbstractTest {
final CsdlAnnotations annots = metadata.getSchema(0).getAnnotationGroup("ODataDemo.DemoService/Suppliers", null);
assertNotNull(annots);
assertFalse(annots.getAnnotations().isEmpty());
- assertEquals(ConstantAnnotationExpression.Type.String,
+ assertEquals(CsdlConstantExpression.ConstantExpressionType.String,
annots.getAnnotation("Org.OData.Publication.V1.PrivacyPolicyUrl").getExpression().asConstant().getType());
assertEquals("http://www.odata.org/",
annots.getAnnotation("Org.OData.Publication.V1.PrivacyPolicyUrl").getExpression().asConstant().getValue());
@@ -290,19 +292,19 @@ public class MetadataTest extends AbstractTest {
assertTrue(displayName.getExpression().isDynamic());
assertTrue(displayName.getExpression().asDynamic().isApply());
- final Apply apply = displayName.getExpression().asDynamic().asApply();
+ final CsdlApply apply = displayName.getExpression().asDynamic().asApply();
assertEquals(Constants.CANONICAL_FUNCTION_CONCAT, apply.getFunction());
assertEquals(3, apply.getParameters().size());
- Path path = (Path) apply.getParameters().get(0);
+ CsdlPath path = (CsdlPath) apply.getParameters().get(0);
assertEquals("Name", path.getValue());
- ConstantAnnotationExpression expression =
- (ConstantAnnotationExpression) apply.getParameters().get(1);
+ CsdlConstantExpression expression =
+ (CsdlConstantExpression) apply.getParameters().get(1);
assertEquals(" in ", expression.getValue());
- assertEquals(ConstantAnnotationExpression.Type.String, expression.getType());
+ assertEquals(CsdlConstantExpression.ConstantExpressionType.String, expression.getType());
- Path thirdArg = (Path) apply.getParameters().get(2);
+ CsdlPath thirdArg = (CsdlPath) apply.getParameters().get(2);
assertEquals("Address/CountryName", thirdArg.getValue());
// Check Tags
@@ -312,9 +314,10 @@ public class MetadataTest extends AbstractTest {
assertTrue(tags.getExpression().isDynamic());
assertTrue(tags.getExpression().asDynamic().isCollection());
- final Collection collection = tags.getExpression().asDynamic().asCollection();
+ final CsdlCollection collection = tags.getExpression().asDynamic().asCollection();
assertEquals(1, collection.getItems().size());
- assertEquals(ConstantAnnotationExpression.Type.String, collection.getItems().get(0).asConstant().getType());
+ assertEquals(CsdlConstantExpression.ConstantExpressionType.String, collection.getItems().get(0).asConstant()
+ .getType());
assertEquals("MasterData", collection.getItems().get(0).asConstant().getValue());
}
@@ -355,16 +358,16 @@ public class MetadataTest extends AbstractTest {
annotation = group.getAnnotation("And");
assertTrue(annotation.getExpression().isDynamic());
- assertTrue(annotation.getExpression().asDynamic().isTwoParamsOp());
- assertEquals(TwoParamsOpDynamicAnnotationExpression.Type.And,
- annotation.getExpression().asDynamic().asTwoParamsOp().getType());
- assertTrue(annotation.getExpression().asDynamic().asTwoParamsOp().getLeftExpression().isPath());
+ assertTrue(annotation.getExpression().asDynamic().isLogicalOrComparison());
+ assertEquals(LogicalOrComparisonExpressionType.And,
+ annotation.getExpression().asDynamic().asLogicalOrComparison().getType());
+ assertTrue(annotation.getExpression().asDynamic().asLogicalOrComparison().getLeft().asDynamic().isPath());
annotation = group.getAnnotation("Vocab.Supplier");
assertNotNull(annotation);
assertTrue(annotation.getExpression().isDynamic());
assertTrue(annotation.getExpression().asDynamic().isUrlRef());
- final UrlRef urlRef = annotation.getExpression().asDynamic().asUrlRef();
+ final CsdlUrlRef urlRef = annotation.getExpression().asDynamic().asUrlRef();
assertTrue(urlRef.getValue().isDynamic());
assertTrue(urlRef.getValue().asDynamic().isApply());
@@ -383,7 +386,7 @@ public class MetadataTest extends AbstractTest {
edmAnnotation = edmGroup.getAnnotations().get(1);
assertTrue(edmAnnotation.getExpression().isDynamic());
assertTrue(edmAnnotation.getExpression().asDynamic().isAnd());
- assertTrue(edmAnnotation.getExpression().asDynamic().asAnd().getLeftExpression().isPath());
+ assertTrue(edmAnnotation.getExpression().asDynamic().asAnd().getLeftExpression().asDynamic().isPath());
edmAnnotation = edmGroup.getAnnotations().get(edmGroup.getAnnotations().size() - 2);
assertNotNull(edmAnnotation);
@@ -398,7 +401,7 @@ public class MetadataTest extends AbstractTest {
public void metadataWithCapabilities() throws Exception {
InputStream input = getClass().getResourceAsStream("Metadata-With-Capabilities.xml");
final XMLMetadata metadata = getClient().getDeserializer(ContentType.APPLICATION_XML).
- toMetadata(input);
+ toMetadata(input);
CsdlSchema schema = metadata.getSchema("Capabilities");
assertNotNull(schema);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmNot.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmNot.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmNot.java
index 5e4441d..7c302f4 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmNot.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmNot.java
@@ -24,8 +24,8 @@ package org.apache.olingo.commons.api.edm.annotation;
public interface EdmNot extends EdmDynamicAnnotationExpression {
/**
- * Returns a boolean value
- * @return either true or false
+ * Returns an expression which should be inverted
+ * @return the expression which must be inverted
*/
- EdmDynamicAnnotationExpression getExpression();
+ EdmAnnotationExpression getExpression();
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmTwoParamsOpDynamicAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmTwoParamsOpDynamicAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmTwoParamsOpDynamicAnnotationExpression.java
index 60fecb5..5fc5edf 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmTwoParamsOpDynamicAnnotationExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmTwoParamsOpDynamicAnnotationExpression.java
@@ -27,11 +27,11 @@ public interface EdmTwoParamsOpDynamicAnnotationExpression extends EdmDynamicAnn
* Returns the first expression (left child)
* @return Child expression
*/
- EdmDynamicAnnotationExpression getLeftExpression();
+ EdmAnnotationExpression getLeftExpression();
/**
* Returns the second expression (right child)
* @return Child expression
*/
- EdmDynamicAnnotationExpression getRightExpression();
+ EdmAnnotationExpression getRightExpression();
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java
index a1f838e..e5d1ddb 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java
@@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,7 +21,7 @@ package org.apache.olingo.commons.api.edm.provider;
import java.util.ArrayList;
import java.util.List;
-import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlExpression;
/**
* Represents a CSDL annotation
@@ -36,13 +36,13 @@ public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatab
private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
- private AnnotationExpression annotationExpression;
+ private CsdlExpression annotationExpression;
/**
* Returns the annotated expression
* @return expression annotated expression
*/
- public AnnotationExpression getExpression() {
+ public CsdlExpression getExpression() {
return annotationExpression;
}
@@ -50,7 +50,7 @@ public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatab
* Sets the annotated expression
* @param annotationExpression annotated expression
*/
- public CsdlAnnotation setExpression(final AnnotationExpression annotationExpression) {
+ public CsdlAnnotation setExpression(final CsdlExpression annotationExpression) {
this.annotationExpression = annotationExpression;
return this;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java
deleted file mode 100644
index f555343..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider;
-
-/**
- * The type Csdl expression.
- */
-public class CsdlExpression {
- // TODO: Expression implementation
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AbstractCsdlAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AbstractCsdlAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AbstractCsdlAnnotationExpression.java
deleted file mode 100644
index 0c0f1d5..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AbstractCsdlAnnotationExpression.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.commons.api.edm.provider.annotation;
-
-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;
-
-public abstract class AbstractCsdlAnnotationExpression 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/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java
deleted file mode 100644
index e9a5d69..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.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.commons.api.edm.provider.annotation;
-
-import java.io.Serializable;
-
-/**
- * Super type of all annotation expressions
- * A expression is either constant or dynamic
- */
-public interface AnnotationExpression extends Serializable {
-
- /**
- * Return true if the expression is constant
- * @return true if the expression is constant
- */
- boolean isConstant();
-
- /**
- * Casts the expression to {@link org.apache.olingo.commons.api.edm.annotation.EdmConstantAnnotationExpression}
- * @return Constant Expression
- */
- ConstantAnnotationExpression asConstant();
-
- /**
- * Return true if the expression is dynamic
- * @return true if the expression is dynamic
- */
- boolean isDynamic();
-
- /**
- * Cast the expression to {@link org.apache.olingo.commons.api.edm.annotation.EdmDynamicAnnotationExpression}
- * @return Dynamic Expression
- */
- DynamicAnnotationExpression asDynamic();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java
deleted file mode 100644
index 03cd8de..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * Represents an annotation path
- */
-public interface AnnotationPath extends DynamicAnnotationExpression {
-
- /**
- * Value of the path
- * @return value of the path
- */
- String getValue();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java
deleted file mode 100644
index 69fbf2d..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.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.commons.api.edm.provider.annotation;
-
-import java.util.List;
-
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-
-/**
- * Represents an Edm:Apply expression
- */
-public interface Apply extends DynamicAnnotationExpression, CsdlAnnotatable {
-
- /**
- * A QualifiedName specifying the name of the client-side function to apply.
- * <br/>
- * OData defines three canonical functions. Services MAY support additional functions that MUST be qualified with a
- * namespace or alias other than odata. Function names qualified with odata are reserved for this specification and
- * its future versions.
- *
- * @return function full qualified name
- * @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_CONCAT
- * @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_FILLURITEMPLATE
- * @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_URIENCODE
- */
- String getFunction();
-
- /**
- * Returns the expressions applied to the parameters of the function
- * @return List of expression
- */
- List<AnnotationExpression> getParameters();
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java
deleted file mode 100644
index c7f0092..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.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.commons.api.edm.provider.annotation;
-
-import org.apache.olingo.commons.api.edm.geo.SRID;
-import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
-
-/**
- * Represents an edm:Cast expression.
- * Casts the value obtained from its single child expression to the specified type
- */
-public interface Cast extends DynamicAnnotationExpression, CsdlAnnotatable {
- /**
- * Returns the facet attribute MaxLength
- * @return Returns the facet attribute MaxLength
- */
- Integer getMaxLength();
-
- /**
- * Returns the facet attribute Precision
- * @return Returns the facet attribute Precision
- */
- Integer getPrecision();
-
- /**
- * Returns the facet attribute Scale
- * @return Returns the facet attribute Scale
- */
- Integer getScale();
-
- /**
- * Returns the facet attribute SRID
- * @return Returns the facet attribute SRID
- */
- SRID getSrid();
-
- /**
- * Value cast to
- * @return value cast to
- */
- String getType();
-
- /**
- * Cast value of the expression
- * @return Cast value
- */
- DynamicAnnotationExpression getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java
deleted file mode 100644
index 30eadac..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-import java.util.List;
-
-/**
- * The edm:Collection expression enables a value to be obtained from zero or more child expressions.
- * The value calculated by the collection expression is the collection of the values calculated
- * by each of the child expressions.
- */
-public interface Collection extends DynamicAnnotationExpression {
-
- /**
- * Returns a list of child expression
- * @return List of child expression
- */
- List<AnnotationExpression> getItems();
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java
deleted file mode 100644
index 65d818c..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.api.edm.provider.annotation;
-
-/**
- * Represents a constant expression
- */
-public interface ConstantAnnotationExpression extends AnnotationExpression {
-
- /**
- * Type of the constant expression
- */
- public enum Type {
- /**
- * Type Edm.binary
- */
- Binary,
- /**
- * Type Edm.Bool
- */
- Bool,
- /**
- * Type Edm.Date
- */
- Date,
- /**
- * Type Edm.DateTimeOffset
- */
- DateTimeOffset,
- /**
- * Type Edm.Decimal
- */
- Decimal,
- /**
- * Type Edm.Duration
- */
- Duration,
- /**
- * Type Edm.EnumMeber
- */
- EnumMember,
- /**
- * Type Edm.Float
- */
- Float,
- /**
- * Type Edm.GUID
- */
- Guid,
- /**
- * Type Integer
- */
- Int,
- /**
- * Type Edm.String
- */
- String,
- /**
- * Type Edm.TimeOfDay
- */
- TimeOfDay;
-
- /**
- * Creates a new type by a given string e.g. "TimeOfDay"
- * @param value Type as string
- * @return Type type
- */
- public static Type fromString(final String value) {
- Type result = null;
- try {
- result = valueOf(value);
- } catch (IllegalArgumentException e) {
- // ignore
- }
- return result;
- }
- }
-
- /**
- * Returns the type of the constant exprssion
- * @return type of the constant expresion
- */
- Type getType();
-
- /**
- * Sets the type of the constant expression
- * @param type type of the constant expression
- */
- void setType(Type type);
-
- /**
- * Value of the constant expression
- * @return value of the constant expression as String
- */
- String getValue();
-
- /**
- * Sets the value of the constant expression
- * @param value value of the constant expression
- */
- void setValue(String value);
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlAnnotationPath.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlAnnotationPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlAnnotationPath.java
new file mode 100644
index 0000000..ed9b31f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlAnnotationPath.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.commons.api.edm.provider.annotation;
+
+/**
+ * Represents an annotation path
+ */
+public class CsdlAnnotationPath extends CsdlDynamicExpression {
+ private static final long serialVersionUID = 1588336268773032932L;
+
+ private String value;
+
+ public CsdlAnnotationPath setValue(final String value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Value of the path
+ * @return value of the path
+ */
+ public String getValue() {
+ return value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlApply.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlApply.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlApply.java
new file mode 100644
index 0000000..2c637a5
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlApply.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+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;
+
+public class CsdlApply extends CsdlDynamicExpression implements CsdlAnnotatable{
+ private static final long serialVersionUID = 3555689860643577136L;
+
+ private String function;
+ private List<CsdlExpression> parameters = new ArrayList<CsdlExpression>();
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlApply setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+
+ /**
+ * A QualifiedName specifying the name of the client-side function to apply.
+ * <br/>
+ * OData defines three canonical functions. Services MAY support additional functions that MUST be qualified with a
+ * namespace or alias other than odata. Function names qualified with odata are reserved for this specification and
+ * its future versions.
+ *
+ * @return function full qualified name
+ * @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_CONCAT
+ * @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_FILLURITEMPLATE
+ * @see org.apache.olingo.commons.api.Constants#CANONICAL_FUNCTION_URIENCODE
+ */
+ public String getFunction() {
+ return function;
+ }
+
+ public CsdlApply setFunction(final String function) {
+ this.function = function;
+ return this;
+ }
+
+ /**
+ * Returns the expressions applied to the parameters of the function
+ * @return List of expression
+ */
+ public List<CsdlExpression> getParameters() {
+ return parameters;
+ }
+
+ public CsdlApply setParameters(List<CsdlExpression> parameters) {
+ this.parameters = parameters;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
new file mode 100644
index 0000000..a2dc7e7
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.geo.SRID;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
+
+/**
+ * Represents an edm:Cast expression.
+ * Casts the value obtained from its single child expression to the specified type
+ */
+public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable{
+ private static final long serialVersionUID = 7664148202663405946L;
+
+ private String type;
+ private Integer maxLength;
+ private Integer precision;
+ private Integer scale;
+ private SRID srid;
+ private CsdlDynamicExpression value;
+ private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>();
+
+ @Override
+ public List<CsdlAnnotation> getAnnotations() {
+ return annotations;
+ }
+
+ public CsdlCast setAnnotations(List<CsdlAnnotation> annotations) {
+ this.annotations = annotations;
+ return this;
+ }
+
+ /**
+ * Value cast to
+ * @return value cast to
+ */
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ /**
+ * Returns the facet attribute MaxLength
+ * @return Returns the facet attribute MaxLength
+ */
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public void setMaxLength(final Integer maxLength) {
+ this.maxLength = maxLength;
+ }
+
+ /**
+ * Returns the facet attribute Precision
+ * @return Returns the facet attribute Precision
+ */
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ public void setPrecision(final Integer precision) {
+ this.precision = precision;
+ }
+
+ /**
+ * Returns the facet attribute Scale
+ * @return Returns the facet attribute Scale
+ */
+ public Integer getScale() {
+ return scale;
+ }
+
+ public void setScale(final Integer scale) {
+ this.scale = scale;
+ }
+
+ /**
+ * Returns the facet attribute SRID
+ * @return Returns the facet attribute SRID
+ */
+ public SRID getSrid() {
+ return srid;
+ }
+
+ public void setSrid(final SRID srid) {
+ this.srid = srid;
+ }
+
+ /**
+ * Cast value of the expression
+ * @return Cast value
+ */
+ public CsdlDynamicExpression getValue() {
+ return value;
+ }
+
+ public void setValue(final CsdlDynamicExpression value) {
+ this.value = value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCollection.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCollection.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCollection.java
new file mode 100644
index 0000000..d1dd9c0
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCollection.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The edm:Collection expression enables a value to be obtained from zero or more child expressions.
+ * The value calculated by the collection expression is the collection of the values calculated
+ * by each of the child expressions.
+ */
+public class CsdlCollection extends CsdlDynamicExpression {
+ private static final long serialVersionUID = 3792880963089015493L;
+
+ private List<CsdlExpression> items = new ArrayList<CsdlExpression>();
+
+ /**
+ * Returns a list of child expression
+ * @return List of child expression
+ */
+ public List<CsdlExpression> getItems() {
+ return items;
+ }
+
+ /**
+ * Returns a list of child expression
+ * @return List of child expression
+ */
+ public CsdlCollection setItems(List<CsdlExpression> items) {
+ this.items = items;
+ return this;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantAnnotationExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantAnnotationExpression.java
deleted file mode 100644
index 1f70276..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantAnnotationExpression.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.commons.api.edm.provider.annotation;
-
-public class CsdlConstantAnnotationExpression
- extends AbstractCsdlAnnotationExpression implements ConstantAnnotationExpression {
-
- private static final long serialVersionUID = 5618680702707972904L;
-
- private Type type;
-
- private String value;
-
- public CsdlConstantAnnotationExpression() {
- }
-
- public CsdlConstantAnnotationExpression(Type type, String value) {
- this.type = type;
- this.value = 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/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantExpression.java
new file mode 100644
index 0000000..8e8d5cd
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlConstantExpression.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+
+public class CsdlConstantExpression extends CsdlExpression {
+
+ private static final long serialVersionUID = 5618680702707972904L;
+
+ private ConstantExpressionType type;
+ private String value;
+
+ /**
+ * Type of the constant expression
+ */
+ public enum ConstantExpressionType {
+ /**
+ * Type Edm.binary
+ */
+ Binary,
+ /**
+ * Type Edm.Bool
+ */
+ Bool,
+ /**
+ * Type Edm.Date
+ */
+ Date,
+ /**
+ * Type Edm.DateTimeOffset
+ */
+ DateTimeOffset,
+ /**
+ * Type Edm.Decimal
+ */
+ Decimal,
+ /**
+ * Type Edm.Duration
+ */
+ Duration,
+ /**
+ * Type Edm.EnumMeber
+ */
+ EnumMember,
+ /**
+ * Type Edm.Float
+ */
+ Float,
+ /**
+ * Type Edm.GUID
+ */
+ Guid,
+ /**
+ * Type Integer
+ */
+ Int,
+ /**
+ * Type Edm.String
+ */
+ String,
+ /**
+ * Type Edm.TimeOfDay
+ */
+ TimeOfDay;
+
+ /**
+ * Creates a new type by a given string e.g. "TimeOfDay".
+ * Will NOT throw an IlligalArgumentException for invalid types. If needed use the valueOf method.
+ * @param value Type as string
+ * @return Type type
+ */
+ public static ConstantExpressionType fromString(final String value) {
+ ConstantExpressionType result = null;
+ try {
+ result = valueOf(value);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+ return result;
+ }
+ }
+
+ public CsdlConstantExpression() {}
+
+ public CsdlConstantExpression(ConstantExpressionType type, String value) {
+ this.type = type;
+ this.value = value;
+ }
+
+ /**
+ * Returns the type of the constant expression
+ * @return type of the constant expression
+ */
+ public ConstantExpressionType getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type of the constant expression
+ * @param type type of the constant expression
+ * @return this for method chaining
+ */
+ public CsdlConstantExpression setType(final ConstantExpressionType type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Value of the constant expression
+ * @return value of the constant expression as String
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the constant expression
+ * @param value value of the constant expression
+ * @return this for method chaining
+ */
+ public CsdlConstantExpression setValue(final String value) {
+ this.value = value;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/67ccbf9d/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
new file mode 100644
index 0000000..3ee1468
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
@@ -0,0 +1,282 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm.provider.annotation;
+
+import java.util.Collection;
+
+public abstract class CsdlDynamicExpression extends CsdlExpression {
+
+ private static final long serialVersionUID = 179628476369962030L;
+
+ /**
+ * Returns true if the expression is a logical expression
+ * @return true if the expression is a logical expression
+ */
+ public boolean isLogicalOrComparison() {
+ return this instanceof CsdlLogicalOrComparisonExpression;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlLogicalOrComparisonExpression} expression
+ * @return CsdlLogicalExpression expression
+ */
+ public CsdlLogicalOrComparisonExpression asLogicalOrComparison() {
+ return isLogicalOrComparison() ? (CsdlLogicalOrComparisonExpression) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:AnnotationPath expression
+ * @return true if the expression is a edm:AnnotationPath expression
+ */
+ public boolean isAnnotationPath() {
+ return this instanceof CsdlAnnotationPath;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlAnnotationPath} expression
+ * @return AnnotationPath expression
+ */
+ public CsdlAnnotationPath asAnnotationPath() {
+ return isAnnotationPath() ? (CsdlAnnotationPath) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:Apply expression
+ * @return true if the expression is a edm:Apply expression
+ */
+ public boolean isApply() {
+ return this instanceof CsdlApply;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlApply} expression
+ * @return Apply expression
+ */
+ public CsdlApply asApply() {
+ return isApply() ? (CsdlApply) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:Cast expression
+ * @return true if the expression is a edm:Cast expression
+ */
+ public boolean isCast() {
+ return this instanceof CsdlCast;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlCast} expression
+ * @return Cast expression
+ */
+ public CsdlCast asCast() {
+ return isCast() ? (CsdlCast) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:Collection expression
+ * @return true if the expression is a edm:Collection expression
+ */
+ public boolean isCollection() {
+ return this instanceof CsdlCollection;
+ }
+
+ /**
+ * Casts the expression to a {@link Collection} expression
+ * @return Collection expression
+ */
+ public CsdlCollection asCollection() {
+ return isCollection() ? (CsdlCollection) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:If expression
+ * @return true if the expression is a edm:If expression
+ */
+ public boolean isIf() {
+ return this instanceof CsdlIf;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlIf} expression
+ * @return If expression
+ */
+ public CsdlIf asIf() {
+ return isIf() ? (CsdlIf) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:IsOf expression
+ * @return true if the expression is a edm:IsOf expression
+ */
+ public boolean isIsOf() {
+ return this instanceof CsdlIsOf;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlIsOf} expression
+ * @return IsOf expression
+ */
+ public CsdlIsOf asIsOf() {
+ return isIsOf() ? (CsdlIsOf) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:LabeledElement expression
+ * @return true if the expression is a edm:LabeledElement expression
+ */
+ public boolean isLabeledElement() {
+ return this instanceof CsdlLabeledElement;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlLabeledElement} expression
+ * @return LabeledElement expression
+ */
+ public CsdlLabeledElement asLabeledElement() {
+ return isLabeledElement() ? (CsdlLabeledElement) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:LabeledElementReference expression
+ * @return true if the expression is a edm:LabeledElementReference expression
+ */
+ public boolean isLabeledElementReference() {
+ return this instanceof CsdlLabeledElementReference;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlLabeledElementReference} expression
+ * @return LabeledElementReference expression
+ */
+ public CsdlLabeledElementReference asLabeledElementReference() {
+ return isLabeledElementReference() ? (CsdlLabeledElementReference) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:Null expression
+ * @return true if the expression is a edm:Null expression
+ */
+ public boolean isNull() {
+ return this instanceof CsdlNull;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlNull} expression
+ * @return Null expression
+ */
+ public CsdlNull asNull() {
+ return isNull() ? (CsdlNull) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:NavigationPropertyPath expression
+ * @return true if the expression is a edm:NavigationPropertyPath expression
+ */
+ public boolean isNavigationPropertyPath() {
+ return this instanceof CsdlNavigationPropertyPath;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlNavigationPropertyPath} expression
+ * @return NavigationPropertyPath expression
+ */
+ public CsdlNavigationPropertyPath asNavigationPropertyPath() {
+ return isNavigationPropertyPath() ? (CsdlNavigationPropertyPath) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:Path expression
+ * @return true if the expression is a edm:Path expression
+ */
+ public boolean isPath() {
+ return this instanceof CsdlPath;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlPath} expression
+ * @return Path expression
+ */
+ public CsdlPath asPath() {
+ return isPath() ? (CsdlPath) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:PropertyPath expression
+ * @return true if the expression is a edm:PropertyPath expression
+ */
+ public boolean isPropertyPath() {
+ return this instanceof CsdlPropertyPath;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlPropertyPath} expression
+ * @return PropertyPath expression
+ */
+ public CsdlPropertyPath asPropertyPath() {
+ return isPropertyPath() ? (CsdlPropertyPath) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:PropertyValue expression
+ * @return true if the expression is a edm:PropertyValue expression
+ */
+ public boolean isPropertyValue() {
+ return this instanceof CsdlPropertyValue;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlPropertyValue} expression
+ * @return PropertyValue expression
+ */
+ public CsdlPropertyValue asPropertyValue() {
+ return isPropertyValue() ? (CsdlPropertyValue) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:Record expression
+ * @return true if the expression is a edm:Record expression
+ */
+ public boolean isRecord() {
+ return this instanceof CsdlRecord;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlRecord} expression
+ * @return Record expression
+ */
+ public CsdlRecord asRecord() {
+ return isRecord() ? (CsdlRecord) this : null;
+ }
+
+ /**
+ * Returns true if the expression is a edm:UrlRef expression
+ * @return true if the expression is a edm:UrlRef expression
+ */
+ public boolean isUrlRef() {
+ return this instanceof CsdlUrlRef;
+ }
+
+ /**
+ * Casts the expression to a {@link CsdlUrlRef} expression
+ * @return UrlRef expression
+ */
+ public CsdlUrlRef asUrlRef() {
+ return isUrlRef() ? (CsdlUrlRef) this : null;
+ }
+}