From c0ec631cda0ea7fbef159ea6fdda3182b09c4790 Mon Sep 17 00:00:00 2001 From: Christian Amend Date: Wed, 13 Nov 2013 15:27:57 +0100 Subject: [PATCH] [OLINGO-60] Deleted unnecessary EdmLiteral and moved EdmMapping Moved EdmMapping since it is a helper and not mentioned inside the specification. EdmLiteral was a helper but is propably not needed in V4 anymore so I deleted it. --- .../olingo/commons/api/edm/EdmLiteral.java | 63 ------------------- .../olingo/commons/api/edm/EdmParameter.java | 2 + .../olingo/commons/api/edm/EdmProperty.java | 2 + .../api/edm/{ => helper}/EdmMappable.java | 2 +- .../api/edm/{ => helper}/EdmMapping.java | 2 +- .../core/edm/provider/EdmPropertyImpl.java | 2 +- 6 files changed, 7 insertions(+), 66 deletions(-) delete mode 100644 odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmLiteral.java rename odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/{ => helper}/EdmMappable.java (96%) rename odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/{ => helper}/EdmMapping.java (96%) diff --git a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmLiteral.java b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmLiteral.java deleted file mode 100644 index ba2b56a90..000000000 --- a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmLiteral.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - ******************************************************************************/ -package org.apache.olingo.commons.api.edm; - -/** - *

Representation of a simple-typed literal.

- *

The literal is in default representation. The URI representation differs - * from the default representation mainly in the additional presence of type - * indicator prefixes; since the type information is stored here separately, - * the default representation is more appropriate. - * Should the URI representation be needed, it can be re-created by calling {@link EdmPrimitiveType#toUriLiteral}.

- */ -public final class EdmLiteral { - private final EdmPrimitiveType type; - private final String literal; - - /** - * Creates an {@link EdmLiteral} object out of the simple type and the literal string. - * @param type {@link EdmPrimitiveType} simple type - * @param literal String literal in default (not URI) representation - */ - public EdmLiteral(final EdmPrimitiveType type, final String literal) { - this.type = type; - this.literal = literal; - } - - /** - * Gets the simple type of the literal. - * @return {@link EdmPrimitiveType} object - */ - public EdmPrimitiveType getType() { - return type; - } - - /** - * Gets the literal String. - * @return {@link String} literal in default (not URI) representation - */ - public String getLiteral() { - return literal; - } - - @Override - public String toString() { - return "type=" + type + ", literal=" + literal; - } -} diff --git a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java index 533f0eb46..e1119f5b0 100644 --- a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java +++ b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java @@ -18,6 +18,8 @@ ******************************************************************************/ package org.apache.olingo.commons.api.edm; +import org.apache.olingo.commons.api.edm.helper.EdmMappable; + /** * A CSDL parameter element */ diff --git a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java index d6ae859a7..347badf4d 100644 --- a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java +++ b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java @@ -18,6 +18,8 @@ ******************************************************************************/ package org.apache.olingo.commons.api.edm; +import org.apache.olingo.commons.api.edm.helper.EdmMappable; + /** * A CSDL Property element *

EdmProperty defines a simple type or a complex type. diff --git a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/helper/EdmMappable.java similarity index 96% rename from odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java rename to odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/helper/EdmMappable.java index 1791887fb..675994635 100644 --- a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java +++ b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/helper/EdmMappable.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. ******************************************************************************/ -package org.apache.olingo.commons.api.edm; +package org.apache.olingo.commons.api.edm.helper; /** * EdmMappable can be applied to CSDL elements to associate additional information. diff --git a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/helper/EdmMapping.java similarity index 96% rename from odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java rename to odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/helper/EdmMapping.java index f27713d88..5529b7dcb 100644 --- a/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java +++ b/odata4-lib/odata4-commons-api/src/main/java/org/apache/olingo/commons/api/edm/helper/EdmMapping.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. ******************************************************************************/ -package org.apache.olingo.commons.api.edm; +package org.apache.olingo.commons.api.edm.helper; /** * EdmMapping holds custom mapping information which can be applied to a CSDL element. diff --git a/odata4-lib/odata4-commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmPropertyImpl.java b/odata4-lib/odata4-commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmPropertyImpl.java index 9891a90f8..782f72292 100644 --- a/odata4-lib/odata4-commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmPropertyImpl.java +++ b/odata4-lib/odata4-commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmPropertyImpl.java @@ -18,9 +18,9 @@ ******************************************************************************/ package org.apache.olingo.commons.core.edm.provider; -import org.apache.olingo.commons.api.edm.EdmMapping; import org.apache.olingo.commons.api.edm.EdmProperty; import org.apache.olingo.commons.api.edm.EdmType; +import org.apache.olingo.commons.api.edm.helper.EdmMapping; import org.apache.olingo.commons.api.edm.provider.Property; public class EdmPropertyImpl extends EdmElementImpl implements EdmProperty {