You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/03/07 10:09:34 UTC
[45/57] [abbrv] [OLINGO-186] client-side implementation of commons
Edm interfaces completed: some refactoring on server-side performed to
extract common abstract implementation
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprConstructDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprConstructDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprConstructDeserializer.java
deleted file mode 100644
index d3d4fd4..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprConstructDeserializer.java
+++ /dev/null
@@ -1,145 +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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.core.JsonLocation;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.ClassUtils;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class DynExprConstructDeserializer extends AbstractEdmDeserializer<DynExprConstructImpl> {
-
- private static final String[] EL_OR_ATTR = { AnnotationPath.class.getSimpleName(), Path.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 AbstractElOrAttrConstruct getElOrAttrInstance(final String simpleClassName) throws JsonParseException {
- try {
- @SuppressWarnings("unchecked")
- Class<? extends AbstractElOrAttrConstruct> elOrAttrClass =
- (Class<? extends AbstractElOrAttrConstruct>) ClassUtils.getClass(
- getClass().getPackage().getName() + "." + simpleClassName);
- return elOrAttrClass.newInstance();
- } catch (Exception e) {
- throw new JsonParseException("Could not instantiate " + simpleClassName, JsonLocation.NA, e);
- }
- }
-
- private ExprConstructImpl parseConstOrEnumExprConstruct(final JsonParser jp) throws IOException {
- ExprConstructImpl result;
- if (isAnnotationConstExprConstruct(jp)) {
- result = parseAnnotationConstExprConstruct(jp);
- } else {
- result = jp.readValueAs( DynExprConstructImpl.class);
- }
- jp.nextToken();
-
- return result;
- }
-
- @Override
- protected DynExprConstructImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- DynExprConstructImpl construct = null;
-
- if (DynExprSingleParamOp.Type.fromString(jp.getCurrentName()) != null) {
- final DynExprSingleParamOp dynExprSingleParamOp = new DynExprSingleParamOp();
- dynExprSingleParamOp.setType(DynExprSingleParamOp.Type.fromString(jp.getCurrentName()));
-
- jp.nextToken();
- jp.nextToken();
- dynExprSingleParamOp.setExpression(jp.readValueAs( DynExprConstructImpl.class));
-
- construct = dynExprSingleParamOp;
- } else if (DynExprDoubleParamOp.Type.fromString(jp.getCurrentName()) != null) {
- final DynExprDoubleParamOp dynExprDoubleParamOp = new DynExprDoubleParamOp();
- dynExprDoubleParamOp.setType(DynExprDoubleParamOp.Type.fromString(jp.getCurrentName()));
-
- jp.nextToken();
- jp.nextToken();
- dynExprDoubleParamOp.setLeft(jp.readValueAs( DynExprConstructImpl.class));
- dynExprDoubleParamOp.setRight(jp.readValueAs( DynExprConstructImpl.class));
-
- construct = dynExprDoubleParamOp;
- } else if (ArrayUtils.contains(EL_OR_ATTR, jp.getCurrentName())) {
- final AbstractElOrAttrConstruct elOrAttr = getElOrAttrInstance(jp.getCurrentName());
- elOrAttr.setValue(jp.nextTextValue());
-
- construct = elOrAttr;
- } else if (APPLY.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Apply.class);
- } else if (CAST.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Cast.class);
- } else if (COLLECTION.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Collection.class);
- } else if (IF.equals(jp.getCurrentName())) {
- jp.nextToken();
- jp.nextToken();
-
- final If _if = new If();
- _if.setGuard(parseConstOrEnumExprConstruct(jp));
- _if.setThen(parseConstOrEnumExprConstruct(jp));
- _if.setElse(parseConstOrEnumExprConstruct(jp));
-
- construct = _if;
- } else if (IS_OF.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( IsOf.class);
- } else if (LABELED_ELEMENT.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( LabeledElement.class);
- } else if (NULL.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Null.class);
- } else if (RECORD.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( Record.class);
- } else if (URL_REF.equals(jp.getCurrentName())) {
- jp.nextToken();
- construct = jp.readValueAs( UrlRef.class);
- }
-
- return construct;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprConstructImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprConstructImpl.java
deleted file mode 100644
index ececbf2..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprConstructImpl.java
+++ /dev/null
@@ -1,29 +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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-@JsonDeserialize(using = DynExprConstructDeserializer.class)
-public abstract class DynExprConstructImpl extends ExprConstructImpl implements DynExprConstruct {
-
- private static final long serialVersionUID = -642012862023177349L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprDoubleParamOp.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprDoubleParamOp.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprDoubleParamOp.java
deleted file mode 100644
index a455a86..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprDoubleParamOp.java
+++ /dev/null
@@ -1,73 +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.odata4.client.core.edm.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-public class DynExprDoubleParamOp extends DynExprConstructImpl {
-
- private static final long serialVersionUID = -7974475975925167731L;
-
- public static enum Type {
-
- And,
- Or;
-
- public static Type fromString(final String value) {
- Type result = null;
- for (Type type : values()) {
- if (value.equals(type.name())) {
- result = type;
- }
- }
- return result;
- }
- }
-
- private Type type;
-
- private DynExprConstruct left;
-
- private DynExprConstruct right;
-
- public Type getType() {
- return type;
- }
-
- public void setType(final Type type) {
- this.type = type;
- }
-
- public DynExprConstruct getLeft() {
- return left;
- }
-
- public void setLeft(final DynExprConstruct left) {
- this.left = left;
- }
-
- public DynExprConstruct getRight() {
- return right;
- }
-
- public void setRight(final DynExprConstruct right) {
- this.right = right;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprSingleParamOp.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprSingleParamOp.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprSingleParamOp.java
deleted file mode 100644
index fa5862f..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/DynExprSingleParamOp.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-public class DynExprSingleParamOp extends DynExprConstructImpl {
-
- private static final long serialVersionUID = -7974475975925167731L;
-
- public static enum Type {
-
- Not,
- Eq,
- Ne,
- Gt,
- Ge,
- Lt,
- Le;
-
- public static Type fromString(final String value) {
- Type result = null;
- for (Type type : values()) {
- if (value.equals(type.name())) {
- result = type;
- }
- }
- return result;
- }
-
- }
-
- private Type type;
-
- private DynExprConstruct expression;
-
- public Type getType() {
- return type;
- }
-
- public void setType(final Type type) {
- this.type = type;
- }
-
- public DynExprConstruct getExpression() {
- return expression;
- }
-
- public void setExpression(final DynExprConstruct expression) {
- this.expression = expression;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/ExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/ExprConstructImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/ExprConstructImpl.java
deleted file mode 100644
index b628006..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/ExprConstructImpl.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.odata4.client.core.edm.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-
-public abstract class ExprConstructImpl extends AbstractEdmItem implements ExprConstruct {
-
- private static final long serialVersionUID = 7108626008005050492L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/If.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/If.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/If.java
deleted file mode 100644
index f1c285d..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/If.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.v4.annotation;
-
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-
-public class If extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = 6752952406406218936L;
-
- private ExprConstruct guard;
-
- private ExprConstruct _then;
-
- private ExprConstruct _else;
-
- public ExprConstruct getGuard() {
- return guard;
- }
-
- public void setGuard(final ExprConstruct guard) {
- this.guard = guard;
- }
-
- public ExprConstruct getThen() {
- return _then;
- }
-
- public void setThen(final ExprConstruct _then) {
- this._then = _then;
- }
-
- public ExprConstruct getElse() {
- return _else;
- }
-
- public void setElse(final ExprConstruct _else) {
- this._else = _else;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/IsOf.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/IsOf.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/IsOf.java
deleted file mode 100644
index 036a13c..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/IsOf.java
+++ /dev/null
@@ -1,90 +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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.math.BigInteger;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-@JsonDeserialize(using = IsOfDeserializer.class)
-public class IsOf extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = 6958304670385303776L;
-
- private String type;
-
- private String maxLength;
-
- private BigInteger precision;
-
- private BigInteger scale;
-
- private String srid;
-
- private DynExprConstruct value;
-
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- public String getMaxLength() {
- return maxLength;
- }
-
- public void setMaxLength(final String maxLength) {
- this.maxLength = maxLength;
- }
-
- public BigInteger getPrecision() {
- return precision;
- }
-
- public void setPrecision(final BigInteger precision) {
- this.precision = precision;
- }
-
- public BigInteger getScale() {
- return scale;
- }
-
- public void setScale(final BigInteger scale) {
- this.scale = scale;
- }
-
- public String getSrid() {
- return srid;
- }
-
- public void setSrid(final String srid) {
- this.srid = srid;
- }
-
- public DynExprConstruct getValue() {
- return value;
- }
-
- public void setValue(final DynExprConstruct value) {
- this.value = value;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/IsOfDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/IsOfDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/IsOfDeserializer.java
deleted file mode 100644
index 68e5358..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/IsOfDeserializer.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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import java.math.BigInteger;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class IsOfDeserializer extends AbstractEdmDeserializer<IsOf> {
-
- @Override
- protected IsOf doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final IsOf isof = new IsOf();
-
- 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.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else if ("MaxLength".equals(jp.getCurrentName())) {
- isof.setMaxLength(jp.nextTextValue());
- } else if ("Precision".equals(jp.getCurrentName())) {
- isof.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L)));
- } else if ("Scale".equals(jp.getCurrentName())) {
- isof.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
- } else if ("SRID".equals(jp.getCurrentName())) {
- isof.setSrid(jp.nextTextValue());
- } else {
- isof.setValue(jp.readValueAs(DynExprConstructImpl.class));
- }
- }
- }
-
- return isof;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElement.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElement.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElement.java
deleted file mode 100644
index be762a9..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElement.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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
-
-@JsonDeserialize(using = LabeledElementDeserializer.class)
-public class LabeledElement extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = 6938971787086282939L;
-
- private String name;
-
- private DynExprConstruct value;
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public DynExprConstruct getValue() {
- return value;
- }
-
- public void setValue(final DynExprConstruct value) {
- this.value = value;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElementDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElementDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElementDeserializer.java
deleted file mode 100644
index 60d9c57..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElementDeserializer.java
+++ /dev/null
@@ -1,53 +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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class LabeledElementDeserializer extends AbstractEdmDeserializer<LabeledElement> {
-
- @Override
- protected LabeledElement doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final LabeledElement element = new LabeledElement();
-
- 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.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else {
- element.setValue(jp.readValueAs(DynExprConstructImpl.class));
- }
- }
- }
-
- return element;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElementReference.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElementReference.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElementReference.java
deleted file mode 100644
index c6f3b35..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/LabeledElementReference.java
+++ /dev/null
@@ -1,25 +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.odata4.client.core.edm.v4.annotation;
-
-public class LabeledElementReference extends AbstractElOrAttrConstruct {
-
- private static final long serialVersionUID = 3649068436729494270L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/NavigationPropertyPath.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/NavigationPropertyPath.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/NavigationPropertyPath.java
deleted file mode 100644
index 8105b3e..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/NavigationPropertyPath.java
+++ /dev/null
@@ -1,25 +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.odata4.client.core.edm.v4.annotation;
-
-public class NavigationPropertyPath extends AbstractElOrAttrConstruct {
-
- private static final long serialVersionUID = -8066400142504963043L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Null.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Null.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Null.java
deleted file mode 100644
index d6d6bb0..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-
-@JsonDeserialize(using = NullDeserializer.class)
-public class Null extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = -3611384710172781951L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/NullDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/NullDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/NullDeserializer.java
deleted file mode 100644
index 8d7e21e..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/NullDeserializer.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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class NullDeserializer extends AbstractEdmDeserializer<Null> {
-
- @Override
- protected Null doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final Null _null = new Null();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Annotation".equals(jp.getCurrentName())) {
- _null.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- }
- }
- }
-
- return _null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Path.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Path.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Path.java
deleted file mode 100644
index 8416a36..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Path.java
+++ /dev/null
@@ -1,25 +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.odata4.client.core.edm.v4.annotation;
-
-public class Path extends AbstractElOrAttrConstruct {
-
- private static final long serialVersionUID = -2551058493469292082L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyPath.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyPath.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyPath.java
deleted file mode 100644
index 96288e2..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyPath.java
+++ /dev/null
@@ -1,25 +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.odata4.client.core.edm.v4.annotation;
-
-public class PropertyPath extends AbstractElOrAttrConstruct {
-
- private static final long serialVersionUID = 2328584735437885159L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValue.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValue.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValue.java
deleted file mode 100644
index 4411682..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValue.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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-
-@JsonDeserialize(using = PropertyValueDeserializer.class)
-public class PropertyValue extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = 3081968466425707461L;
-
- private String property;
-
- private ExprConstruct value;
-
- public String getProperty() {
- return property;
- }
-
- public void setProperty(final String property) {
- this.property = property;
- }
-
- public ExprConstruct getValue() {
- return value;
- }
-
- public void setValue(final ExprConstruct value) {
- this.value = value;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValueDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValueDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValueDeserializer.java
deleted file mode 100644
index fd3dfae..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/PropertyValueDeserializer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class PropertyValueDeserializer extends AbstractEdmDeserializer<PropertyValue> {
-
- @Override
- protected PropertyValue doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final PropertyValue propValue = new PropertyValue();
-
- 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.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else if (isAnnotationConstExprConstruct(jp)) {
- propValue.setValue(parseAnnotationConstExprConstruct(jp));
- } else {
- propValue.setValue(jp.readValueAs(DynExprConstructImpl.class));
- }
- }
- }
-
- return propValue;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Record.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Record.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Record.java
deleted file mode 100644
index 2bed70c..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/Record.java
+++ /dev/null
@@ -1,46 +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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import java.util.ArrayList;
-import java.util.List;
-
-@JsonDeserialize(using = RecordDeserializer.class)
-public class Record extends AnnotatedDynExprConstruct {
-
- private static final long serialVersionUID = -2886526224721870304L;
-
- private String type;
-
- private final List<PropertyValue> propertyValues = new ArrayList<PropertyValue>();
-
- public String getType() {
- return type;
- }
-
- public void setType(final String type) {
- this.type = type;
- }
-
- public List<PropertyValue> getPropertyValues() {
- return propertyValues;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/RecordDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/RecordDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/RecordDeserializer.java
deleted file mode 100644
index dbd4567..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/RecordDeserializer.java
+++ /dev/null
@@ -1,53 +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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
-
-public class RecordDeserializer extends AbstractEdmDeserializer<Record> {
-
- @Override
- protected Record doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final Record record = new Record();
-
- for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
- final JsonToken token = jp.getCurrentToken();
- if (token == JsonToken.FIELD_NAME) {
- if ("Tyoe".equals(jp.getCurrentName())) {
- record.setType(jp.nextTextValue());
- } else if ("Annotation".equals(jp.getCurrentName())) {
- record.setAnnotation(jp.readValueAs(AnnotationImpl.class));
- } else {
- record.getPropertyValues().add(jp.readValueAs(PropertyValue.class));
- }
- }
- }
-
- return record;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRef.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRef.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRef.java
deleted file mode 100644
index eb32b16..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRef.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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
-
-@JsonDeserialize(using = UrlRefDeserializer.class)
-public class UrlRef extends DynExprConstructImpl {
-
- private static final long serialVersionUID = 3755101394647430897L;
-
- private ExprConstruct value;
-
- public ExprConstruct getValue() {
- return value;
- }
-
- public void setValue(final ExprConstruct value) {
- this.value = value;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRefDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRefDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRefDeserializer.java
deleted file mode 100644
index de91b7c..0000000
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/v4/annotation/UrlRefDeserializer.java
+++ /dev/null
@@ -1,50 +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.odata4.client.core.edm.v4.annotation;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import java.io.IOException;
-import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-
-public class UrlRefDeserializer extends AbstractEdmDeserializer<UrlRef> {
-
- @Override
- protected UrlRef doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- final UrlRef urlref = new UrlRef();
-
- 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( DynExprConstructImpl.class));
- }
- }
- }
-
- return urlref;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmType.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmType.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmType.java
new file mode 100644
index 0000000..48de560
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractEdmType.java
@@ -0,0 +1,262 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.odata4.client.api.data.EdmSimpleType;
+import org.apache.olingo.odata4.client.api.edm.xml.ComplexType;
+import org.apache.olingo.odata4.client.api.edm.EdmType;
+import org.apache.olingo.odata4.client.api.edm.EdmTypeNotFoundException;
+import org.apache.olingo.odata4.client.api.edm.xml.EntityType;
+import org.apache.olingo.odata4.client.api.edm.xml.EnumType;
+import org.apache.olingo.odata4.client.api.edm.xml.Schema;
+import org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata;
+
+/**
+ * Parse type information from metadata into semantic data.
+ */
+public abstract class AbstractEdmType implements EdmType {
+
+ private final String typeExpression;
+
+ private final String baseType;
+
+ private final String namespaceOrAlias;
+
+ private boolean collection;
+
+ private EdmSimpleType simpleType;
+
+ private EnumType enumType;
+
+ private ComplexType complexType;
+
+ private EntityType entityType;
+
+ /**
+ * Constructor.
+ *
+ * @param typeExpression type expression.
+ */
+ public AbstractEdmType(final String typeExpression) {
+ this(null, typeExpression);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param metadata metadata.
+ * @param typeExpression type expression.
+ */
+ public AbstractEdmType(final XMLMetadata metadata, final String typeExpression) {
+ this.typeExpression = typeExpression;
+
+ final int collectionStartIdx = typeExpression.indexOf("Collection(");
+ final int collectionEndIdx = typeExpression.lastIndexOf(')');
+ if (collectionStartIdx == -1) {
+ baseType = typeExpression;
+ } else {
+ if (collectionEndIdx == -1) {
+ throw new IllegalArgumentException("Malformed type: " + typeExpression);
+ }
+
+ this.collection = true;
+ baseType = typeExpression.substring(collectionStartIdx + 11, collectionEndIdx);
+ }
+
+ final int lastDotIdx = baseType.lastIndexOf('.');
+ if (lastDotIdx == -1) {
+ throw new IllegalArgumentException("Cannot find namespace or alias in " + typeExpression);
+ }
+ namespaceOrAlias = baseType.substring(0, lastDotIdx);
+ final String typeName = baseType.substring(lastDotIdx + 1);
+ if (StringUtils.isBlank(typeName)) {
+ throw new IllegalArgumentException("Null or empty type name in " + typeExpression);
+ }
+
+ if (namespaceOrAlias.equals(EdmSimpleType.namespace())) {
+ this.simpleType = EdmSimpleType.fromValue(EdmSimpleType.namespace() + "." + typeName);
+ } else if (metadata != null) {
+ if (!metadata.isNsOrAlias(namespaceOrAlias)) {
+ throw new IllegalArgumentException("Illegal namespace or alias: " + namespaceOrAlias);
+ }
+ final Schema schema = metadata.getSchema(namespaceOrAlias);
+
+ for (EnumType type : schema.getEnumTypes()) {
+ if (typeName.equals(type.getName())) {
+ this.enumType = type;
+ }
+ }
+ if (this.enumType == null) {
+ for (ComplexType type : schema.getComplexTypes()) {
+ if (typeName.equals(type.getName())) {
+ this.complexType = type;
+ }
+ }
+ if (this.complexType == null) {
+ for (EntityType type : schema.getEntityTypes()) {
+ if (typeName.equals(type.getName())) {
+ this.entityType = type;
+ }
+ }
+ }
+ }
+
+ if (!isSimpleType() && !isEnumType() && !isComplexType() && !isEntityType()) {
+ throw new IllegalArgumentException("Could not parse type information out of " + typeExpression);
+ }
+ }
+ }
+
+ /**
+ * Checks if is a collection.
+ *
+ * @return 'TRUE' if is a collection; 'FALSE' otherwise.
+ */
+ @Override
+ public final boolean isCollection() {
+ return this.collection;
+ }
+
+ /**
+ * Checks if is a simple type.
+ *
+ * @return 'TRUE' if is a simple type; 'FALSE' otherwise.
+ */
+ @Override
+ public final boolean isSimpleType() {
+ return this.simpleType != null;
+ }
+
+ /**
+ * Gets type as a simple type.
+ *
+ * @return simple type. An <tt>EdmTypeNotFoundException</tt> will be raised if it is not a simple type.
+ */
+ @Override
+ public final EdmSimpleType getSimpleType() {
+ if (!isSimpleType()) {
+ throw new EdmTypeNotFoundException(EdmSimpleType.class, this.typeExpression);
+ }
+
+ return this.simpleType;
+ }
+
+ /**
+ * Checks if is an enum type.
+ *
+ * @return 'TRUE' if is an enum type; 'FALSE' otherwise.
+ */
+ @Override
+ public final boolean isEnumType() {
+ return this.enumType != null;
+ }
+
+ /**
+ * Gets type as enum type.
+ *
+ * @return enum type. An <tt>EdmTypeNotFoundException</tt> will be raised if it is not an enum type.
+ */
+ @Override
+ public EnumType getEnumType() {
+ if (!isEnumType()) {
+ throw new EdmTypeNotFoundException(AbstractEnumType.class, this.typeExpression);
+ }
+
+ return this.enumType;
+ }
+
+ /**
+ * Checks if is a complex type.
+ *
+ * @return 'TRUE' if is a complex type; 'FALSE' otherwise.
+ */
+ @Override
+ public final boolean isComplexType() {
+ return this.complexType != null;
+ }
+
+ /**
+ * Gets type as complex type.
+ *
+ * @return complex type. An <tt>EdmTypeNotFoundException</tt> will be raised if it is not a complex type.
+ */
+ @Override
+ public ComplexType getComplexType() {
+ if (!isComplexType()) {
+ throw new EdmTypeNotFoundException(AbstractComplexType.class, this.typeExpression);
+ }
+
+ return this.complexType;
+ }
+
+ /**
+ * Checks if is an entity type.
+ *
+ * @return 'TRUE' if is an entity type; 'FALSE' otherwise.
+ */
+ @Override
+ public final boolean isEntityType() {
+ return this.entityType != null;
+ }
+
+ /**
+ * Gets type as entity type.
+ *
+ * @return entity type. An <tt>EdmTypeNotFoundException</tt> will be raised if it is not an entity type.
+ */
+ @Override
+ public EntityType getEntityType() {
+ if (!isEntityType()) {
+ throw new EdmTypeNotFoundException(AbstractEntityType.class, this.typeExpression);
+ }
+
+ return this.entityType;
+ }
+
+ /**
+ * Gets base type.
+ *
+ * @return base type.
+ */
+ @Override
+ public String getBaseType() {
+ return baseType;
+ }
+
+ /**
+ * Gets type expression.
+ *
+ * @return type expression.
+ */
+ @Override
+ public String getTypeExpression() {
+ return typeExpression;
+ }
+
+ /**
+ * Gets namespace or alias retrieved from the provided type expression.
+ *
+ * @return namespace or alias.
+ */
+ @Override
+ public String getNamespaceOrAlias() {
+ return namespaceOrAlias;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractMember.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractMember.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractMember.java
index c1b2f95..95c4c81 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractMember.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractMember.java
@@ -29,7 +29,7 @@ public abstract class AbstractMember extends AbstractEdmItem implements Member {
private String name;
@JsonProperty("Value")
- private Integer value;
+ private String value;
@Override
public String getName() {
@@ -41,11 +41,11 @@ public abstract class AbstractMember extends AbstractEdmItem implements Member {
}
@Override
- public Integer getValue() {
+ public String getValue() {
return value;
}
- public void setValue(final Integer value) {
+ public void setValue(final String value) {
this.value = value;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractParameter.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractParameter.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractParameter.java
index 66f9dea..89c15db 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractParameter.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractParameter.java
@@ -18,31 +18,25 @@
*/
package org.apache.olingo.odata4.client.core.edm.xml;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigInteger;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.apache.olingo.odata4.client.api.edm.xml.CommonParameter;
+@JsonDeserialize(using = ParameterDeserializer.class)
public abstract class AbstractParameter extends AbstractEdmItem implements CommonParameter {
private static final long serialVersionUID = -4305016554930334342L;
- @JsonProperty(value = "Name", required = true)
private String name;
- @JsonProperty(value = "Type", required = true)
private String type;
- @JsonProperty(value = "Nullable")
private boolean nullable = true;
- @JsonProperty("MaxLength")
- private String maxLength;
+ private Integer maxLength;
- @JsonProperty("Precision")
- private BigInteger precision;
+ private Integer precision;
- @JsonProperty("Scale")
- private BigInteger scale;
+ private Integer scale;
@Override
public String getName() {
@@ -75,32 +69,32 @@ public abstract class AbstractParameter extends AbstractEdmItem implements Commo
}
@Override
- public String getMaxLength() {
+ public Integer getMaxLength() {
return maxLength;
}
@Override
- public void setMaxLength(final String maxLength) {
+ public void setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
}
@Override
- public BigInteger getPrecision() {
+ public Integer getPrecision() {
return precision;
}
@Override
- public void setPrecision(final BigInteger precision) {
+ public void setPrecision(final Integer precision) {
this.precision = precision;
}
@Override
- public BigInteger getScale() {
+ public Integer getScale() {
return scale;
}
@Override
- public void setScale(final BigInteger scale) {
+ public void setScale(final Integer scale) {
this.scale = scale;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractProperty.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractProperty.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractProperty.java
index 3f2754a..2535e23 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractProperty.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractProperty.java
@@ -18,53 +18,40 @@
*/
package org.apache.olingo.odata4.client.core.edm.xml;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigInteger;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.apache.olingo.odata4.client.api.edm.xml.CommonProperty;
import org.apache.olingo.odata4.commons.api.edm.constants.ConcurrencyMode;
import org.apache.olingo.odata4.commons.api.edm.constants.StoreGeneratedPattern;
+@JsonDeserialize(using = PropertyDeserializer.class)
public abstract class AbstractProperty extends AbstractEdmItem implements CommonProperty {
private static final long serialVersionUID = -6004492361142315153L;
- @JsonProperty(value = "Name", required = true)
private String name;
- @JsonProperty(value = "Type", required = true)
private String type;
- @JsonProperty(value = "Nullable")
private boolean nullable = true;
- @JsonProperty(value = "DefaultValue")
private String defaultValue;
- @JsonProperty(value = "MaxLength")
- private String maxLength;
+ private Integer maxLength;
- @JsonProperty(value = "FixedLength")
private boolean fixedLength;
- @JsonProperty(value = "Precision")
- private BigInteger precision;
+ private Integer precision;
- @JsonProperty(value = "Scale")
- private BigInteger scale;
+ private Integer scale;
- @JsonProperty(value = "Unicode")
private boolean unicode = true;
- @JsonProperty(value = "Collation")
private String collation;
- @JsonProperty(value = "SRID")
private String srid;
- @JsonProperty(value = "ConcurrencyMode")
private ConcurrencyMode concurrencyMode;
- @JsonProperty("StoreGeneratedPattern")
private StoreGeneratedPattern storeGeneratedPattern = StoreGeneratedPattern.None;
@Override
@@ -108,12 +95,12 @@ public abstract class AbstractProperty extends AbstractEdmItem implements Common
}
@Override
- public String getMaxLength() {
+ public Integer getMaxLength() {
return maxLength;
}
@Override
- public void setMaxLength(final String maxLength) {
+ public void setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
}
@@ -128,22 +115,22 @@ public abstract class AbstractProperty extends AbstractEdmItem implements Common
}
@Override
- public BigInteger getPrecision() {
+ public Integer getPrecision() {
return precision;
}
@Override
- public void setPrecision(final BigInteger precision) {
+ public void setPrecision(final Integer precision) {
this.precision = precision;
}
@Override
- public BigInteger getScale() {
+ public Integer getScale() {
return scale;
}
@Override
- public void setScale(final BigInteger scale) {
+ public void setScale(final Integer scale) {
this.scale = scale;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractXMLMetadata.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractXMLMetadata.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractXMLMetadata.java
new file mode 100644
index 0000000..e052948
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/AbstractXMLMetadata.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.odata4.client.core.edm.xml;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.odata4.client.api.edm.xml.XMLMetadata;
+import org.apache.olingo.odata4.client.api.edm.xml.Edmx;
+import org.apache.olingo.odata4.client.api.edm.xml.Schema;
+
+/**
+ * Entry point for access information about EDM metadata.
+ */
+public abstract class AbstractXMLMetadata extends AbstractEdmItem implements XMLMetadata {
+
+ private static final long serialVersionUID = -1214173426671503187L;
+
+ protected final Edmx edmx;
+
+ protected final Map<String, Schema> schemaByNsOrAlias;
+
+ public AbstractXMLMetadata(final Edmx edmx) {
+ this.edmx = edmx;
+
+ this.schemaByNsOrAlias = new HashMap<String, Schema>();
+ for (Schema schema : edmx.getDataServices().getSchemas()) {
+ this.schemaByNsOrAlias.put(schema.getNamespace(), schema);
+ if (StringUtils.isNotBlank(schema.getAlias())) {
+ this.schemaByNsOrAlias.put(schema.getAlias(), schema);
+ }
+ }
+ }
+
+ /**
+ * Checks whether the given key is a valid namespace or alias in the EdM metadata document.
+ *
+ * @param key namespace or alias
+ * @return true if key is valid namespace or alias
+ */
+ @Override
+ public boolean isNsOrAlias(final String key) {
+ return this.schemaByNsOrAlias.keySet().contains(key);
+ }
+
+ /**
+ * Returns the Schema at the specified position in the EdM metadata document.
+ *
+ * @param index index of the Schema to return
+ * @return the Schema at the specified position in the EdM metadata document
+ */
+ @Override
+ public Schema getSchema(final int index) {
+ return this.edmx.getDataServices().getSchemas().get(index);
+ }
+
+ /**
+ * Returns the Schema with the specified key (namespace or alias) in the EdM metadata document.
+ *
+ * @param key namespace or alias
+ * @return the Schema with the specified key in the EdM metadata document
+ */
+ @Override
+ public Schema getSchema(final String key) {
+ return this.schemaByNsOrAlias.get(key);
+ }
+
+ /**
+ * Returns all Schema objects defined in the EdM metadata document.
+ *
+ * @return all Schema objects defined in the EdM metadata document
+ */
+ @Override
+ public List<? extends Schema> getSchemas() {
+ return this.edmx.getDataServices().getSchemas();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/ParameterDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/ParameterDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/ParameterDeserializer.java
new file mode 100644
index 0000000..e8bd47a
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/ParameterDeserializer.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import java.io.IOException;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.odata4.client.api.edm.xml.v3.ParameterMode;
+import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
+
+public class ParameterDeserializer extends AbstractEdmDeserializer<AbstractParameter> {
+
+ @Override
+ protected AbstractParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractParameter parameter = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.odata4.client.core.edm.xml.v3.ParameterImpl()
+ : new org.apache.olingo.odata4.client.core.edm.xml.v4.ParameterImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ parameter.setName(jp.nextTextValue());
+ } else if ("Type".equals(jp.getCurrentName())) {
+ parameter.setType(jp.nextTextValue());
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ parameter.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ parameter.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ parameter.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ parameter.setScale(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Mode".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.odata4.client.core.edm.xml.v3.ParameterImpl) parameter).
+ setMode(ParameterMode.valueOf(jp.nextTextValue()));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.odata4.client.core.edm.xml.v4.ParameterImpl) parameter).setSrid(jp.nextTextValue());
+ }
+ }
+ }
+
+ return parameter;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyDeserializer.java
new file mode 100644
index 0000000..f45b510
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/PropertyDeserializer.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import java.io.IOException;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.odata4.commons.api.edm.constants.ConcurrencyMode;
+import org.apache.olingo.odata4.commons.api.edm.constants.EdmContentKind;
+import org.apache.olingo.odata4.commons.api.edm.constants.ODataServiceVersion;
+import org.apache.olingo.odata4.commons.api.edm.constants.StoreGeneratedPattern;
+
+public class PropertyDeserializer extends AbstractEdmDeserializer<AbstractProperty> {
+
+ @Override
+ protected AbstractProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractProperty property = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl()
+ : new org.apache.olingo.odata4.client.core.edm.xml.v4.PropertyImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ property.setName(jp.nextTextValue());
+ } else if ("Type".equals(jp.getCurrentName())) {
+ property.setType(jp.nextTextValue());
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ property.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("DefaultValue".equals(jp.getCurrentName())) {
+ property.setDefaultValue(jp.nextTextValue());
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ property.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("FixedLength".equals(jp.getCurrentName())) {
+ property.setFixedLength(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ property.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ property.setScale(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Unicode".equals(jp.getCurrentName())) {
+ property.setUnicode(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Collation".equals(jp.getCurrentName())) {
+ property.setCollation(jp.nextTextValue());
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ property.setSrid(jp.nextTextValue());
+ } else if ("ConcurrencyMode".equals(jp.getCurrentName())) {
+ property.setConcurrencyMode(ConcurrencyMode.valueOf(jp.nextTextValue()));
+ } else if ("StoreGeneratedPattern".equals(jp.getCurrentName())) {
+ property.setStoreGeneratedPattern(StoreGeneratedPattern.valueOf(jp.nextTextValue()));
+ } else if ("FC_SourcePath".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcSourcePath(jp.nextTextValue());
+ } else if ("FC_TargetPath".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcTargetPath(jp.nextTextValue());
+ } else if ("FC_ContentKind".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcContentKind(EdmContentKind.valueOf(jp.nextTextValue()));
+ } else if ("FC_NsPrefix".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcNSPrefix(jp.nextTextValue());
+ } else if ("FC_NsUri".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcNSURI(jp.nextTextValue());
+ } else if ("FC_KeepInContent".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.odata4.client.core.edm.xml.v3.PropertyImpl) property).
+ setFcKeepInContent(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.odata4.client.core.edm.xml.v4.PropertyImpl) property).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return property;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ParameterImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ParameterImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ParameterImpl.java
index d0a8559..0912b46 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ParameterImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/ParameterImpl.java
@@ -19,7 +19,6 @@
package org.apache.olingo.odata4.client.core.edm.xml.v3;
import org.apache.olingo.odata4.client.api.edm.xml.v3.ParameterMode;
-import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.olingo.odata4.client.api.edm.xml.v3.Parameter;
import org.apache.olingo.odata4.client.core.edm.xml.AbstractParameter;
@@ -27,7 +26,6 @@ public class ParameterImpl extends AbstractParameter implements Parameter {
private static final long serialVersionUID = 7596724999614891358L;
- @JsonProperty("Mode")
private ParameterMode mode;
@Override