You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/03/10 10:02:34 UTC
[18/51] [abbrv] [partial] [OLINGO-192] rename java packages
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotatable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotatable.java
new file mode 100644
index 0000000..1ba20cd
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotatable.java
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+/**
+ * EdmAnnotatable can be applied to CSDL elements as described in the Conceptual Schema Definition Language.
+ */
+public interface EdmAnnotatable {
+
+ EdmAnnotations getAnnotations();
+
+ // TODO: enhance annotations
+ Object getAnnotation();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotations.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotations.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotations.java
new file mode 100644
index 0000000..2aea695
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmAnnotations.java
@@ -0,0 +1,24 @@
+/*
+ * 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;
+
+//TODO: EDM Annotation Interfaces
+public interface EdmAnnotations {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
new file mode 100644
index 0000000..87c9d34
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmBindingTarget.java
@@ -0,0 +1,48 @@
+/*
+ * 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;
+
+/**
+ * Entity Sets or Singletons can be bound to each other using a navigation property binding so an
+ * {@link EdmBindingTarget} can either be an {@link EdmEntitySet} or an {@link EdmSingleton}.
+ */
+public interface EdmBindingTarget extends EdmNamed {
+
+ /**
+ * Returns the target for a given path.
+ *
+ * @param path
+ * @return {@link EdmBindingTarget}
+ */
+ EdmBindingTarget getRelatedBindingTarget(String path);
+
+ /**
+ * Returns the entity container this target is contained in.
+ *
+ * @return {@link EdmEntityContainer}
+ */
+ EdmEntityContainer getEntityContainer();
+
+ /**
+ * Get the entity type.
+ *
+ * @return {@link EdmEntityType}
+ */
+ EdmEntityType getEntityType();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmComplexType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmComplexType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmComplexType.java
new file mode 100644
index 0000000..56e6e0b
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmComplexType.java
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+/**
+ * A CSDL ComplexType element.
+ * <br/>
+ * EdmComplexType holds a set of related information like {@link EdmPrimitiveType} properties and EdmComplexType
+ * properties.
+ */
+public interface EdmComplexType extends EdmStructuredType {
+
+ @Override
+ EdmComplexType getBaseType();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmElement.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmElement.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmElement.java
new file mode 100644
index 0000000..3076d22
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmElement.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * An {@link EdmElement} can either be an {@link EdmNavigationProperty}, an {@link EdmProperty} or an
+ * {@link EdmParameter}.
+ */
+public interface EdmElement extends EdmNamed, EdmTyped {
+//Should we introduce an element kind?
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityContainer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityContainer.java
new file mode 100644
index 0000000..d30d700
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityContainer.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * A CSDL EntityContainer element.
+ *
+ * <br/>
+ * EdmEntityContainer hold the information of EntitySets, Singletons, ActionImports and FunctionImports contained
+ */
+public interface EdmEntityContainer extends EdmNamed {
+
+ /**
+ * @return namespace of this entity container
+ */
+ String getNamespace();
+
+ /**
+ * Get contained Singleton by name.
+ *
+ * @param name
+ * @return {@link EdmSingleton}
+ */
+ EdmSingleton getSingleton(String name);
+
+ /**
+ * Get contained EntitySet by name.
+ *
+ * @param name
+ * @return {@link EdmEntitySet}
+ */
+ EdmEntitySet getEntitySet(String name);
+
+ /**
+ * Get contained ActionImport by name.
+ *
+ * @param name
+ * @return {@link EdmActionImport}
+ */
+ EdmActionImport getActionImport(String name);
+
+ /**
+ * Get contained FunctionImport by name.
+ *
+ * @param name
+ * @return {@link EdmFunctionImport}
+ */
+ EdmFunctionImport getFunctionImport(String name);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySet.java
new file mode 100644
index 0000000..3e7b66f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySet.java
@@ -0,0 +1,29 @@
+/*
+ * 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;
+
+/**
+ * A CSDL EntitySet element.
+ * <br/>
+ * EdmEntitySet is the container for entity type instances as described in the OData protocol. It can be the target of a
+ * navigation property binding.
+ */
+public interface EdmEntitySet extends EdmBindingTarget {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySetInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySetInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySetInfo.java
new file mode 100644
index 0000000..fe19708
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntitySetInfo.java
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+import java.net.URI;
+
+/**
+ * Objects of this class contain information about one entity set inside the EntityDataModel.
+ */
+public interface EdmEntitySetInfo {
+
+ // TODO: Either make this a class or alias info an interface!
+ /**
+ * @return the entity container name which contains this entity set.
+ */
+ String getEntityContainerName();
+
+ /**
+ * @return the entity set name
+ */
+ String getEntitySetName();
+
+ /**
+ * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
+ * toASCIIString() method can be used.
+ *
+ * @return the uri to this entity set e.g. "Employees"
+ */
+ URI getEntitySetUri();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityType.java
new file mode 100644
index 0000000..362215d
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEntityType.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+import java.util.List;
+
+/**
+ * A CSDL EntityType element.
+ */
+public interface EdmEntityType extends EdmStructuredType {
+
+ /**
+ * Gets all key predicate names. In case an alias is defined for a key predicate this will be returned.
+ *
+ * @return collection of key property names of type List<String>
+ */
+ List<String> getKeyPredicateNames();
+
+ /**
+ * Get all key properties references as list of {@link EdmKeyPropertyRef}.
+ *
+ * @return collection of key properties of type List<EdmKeyPropertyRef>
+ */
+ List<EdmKeyPropertyRef> getKeyPropertyRefs();
+
+ /**
+ * Get a key property ref by its name.
+ *
+ * @param keyPredicateName
+ * @return {@link EdmKeyPropertyRef} for given name
+ */
+ EdmKeyPropertyRef getKeyPropertyRef(String keyPredicateName);
+
+ /**
+ * Indicates if the entity type is treated as Media Link Entry with associated Media Resource.
+ *
+ * @return <code>true</code> if the entity type is a Media Link Entry
+ */
+ boolean hasStream();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.olingo.api.edm.EdmStructuralType#getBaseType()
+ */
+ @Override
+ EdmEntityType getBaseType();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEnumType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEnumType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEnumType.java
new file mode 100644
index 0000000..cca20d9
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmEnumType.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+import java.util.List;
+
+/**
+ * An EdmEnumType represents a set of related values.
+ */
+public interface EdmEnumType extends EdmPrimitiveType {
+
+ /**
+ * @param name
+ * @return {@link EdmMember} for the given name
+ */
+ EdmMember getMember(String name);
+
+ /**
+ * @return member names as a list
+ */
+ List<String> getMemberNames();
+
+ /**
+ * @return the {@link EdmPrimitiveType} this {@link EdmEnumType} is based upon
+ */
+ EdmPrimitiveType getUnderlyingType();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmException.java
new file mode 100644
index 0000000..bf3f119
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmException.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+public class EdmException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ public EdmException(final Exception cause) {
+ super(cause);
+ }
+
+ public EdmException(final String msg) {
+ super(msg);
+ }
+
+ public EdmException(final String string, final Exception cause) {
+ super(string, cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunction.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunction.java
new file mode 100644
index 0000000..c7d01b0
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunction.java
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+/**
+ * An EdmFunction as described in the OData specification
+ */
+public interface EdmFunction extends EdmOperation {
+
+ /**
+ * @return true if this function is composable
+ */
+ boolean isComposable();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImport.java
new file mode 100644
index 0000000..31b1c2c
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImport.java
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+import java.util.List;
+
+/**
+ * A CSDL FunctionImport element
+ */
+public interface EdmFunctionImport extends EdmOperationImport {
+
+ EdmFunction getFunction(List<String> parameterNames);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImportInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImportInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImportInfo.java
new file mode 100644
index 0000000..104a756
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmFunctionImportInfo.java
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+import java.net.URI;
+
+/**
+ * Objects of this class contain information about one function import inside the EntityDataModel.
+ */
+public interface EdmFunctionImportInfo extends EdmOperationImportInfo {
+
+ /**
+ * @return the function import name
+ */
+ String getFunctionImportName();
+
+ /**
+ * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
+ * toASCIIString() method can be used.
+ *
+ * @return the uri to this function import
+ */
+ URI getFunctionImportUri();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmKeyPropertyRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmKeyPropertyRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmKeyPropertyRef.java
new file mode 100644
index 0000000..18cbd9b
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmKeyPropertyRef.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+public interface EdmKeyPropertyRef {
+
+ /**
+ * @return name of the key predicate
+ */
+ String getKeyPropertyName();
+
+ /**
+ * @return alias of this reference or null if not set
+ */
+ String getAlias();
+
+ /**
+ * @return path to the property
+ */
+ String getPath();
+
+ /**
+ * @return the property this property ref points to
+ */
+ EdmProperty getProperty();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java
new file mode 100644
index 0000000..d53b847
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMappable.java
@@ -0,0 +1,32 @@
+/*
+ * 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;
+
+/**
+ * EdmMappable can be applied to CSDL elements to associate additional information.
+ */
+public interface EdmMappable {
+
+ /**
+ * Get mapping information applied to an EDM element
+ *
+ * @return {@link EdmMapping}
+ */
+ EdmMapping getMapping();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java
new file mode 100644
index 0000000..7c59540
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMapping.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * EdmMapping holds custom mapping information which can be applied to a CSDL element.
+ */
+public interface EdmMapping {
+
+ /**
+ * Get the mapping value
+ *
+ * @return mapping name as String
+ */
+ String getInternalName();
+
+ /**
+ * Get the set object for this mapping
+ *
+ * @return {@link Object} object
+ */
+ Object getObject();
+
+ /**
+ * Gets the key under which the resource source value can be found in the data map.
+ *
+ * @return the key of the media resource source
+ */
+ String getMediaResourceSourceKey();
+
+ /**
+ * Gets the key under which the resource mime type can be found in the data map.
+ *
+ * @return the key of the media resource type
+ */
+ String getMediaResourceMimeTypeKey();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMember.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMember.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMember.java
new file mode 100644
index 0000000..888fe77
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmMember.java
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+/**
+ * An {@link EdmEnumType} member element.
+ */
+public interface EdmMember extends EdmNamed {
+
+ /**
+ * @return value of this member as string
+ */
+ String getValue();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNamed.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNamed.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNamed.java
new file mode 100644
index 0000000..503d881
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNamed.java
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+/**
+ * EdmNamed is the base interface for nearly all CSDL constructs.
+ */
+public interface EdmNamed {
+
+ /**
+ * @return name as String
+ */
+ String getName();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java
new file mode 100644
index 0000000..52c645f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmNavigationProperty.java
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+/**
+ * A CSDL NavigationProperty element
+ * <br/>
+ * EdmNavigationProperty allows navigation from one entity type to another via a relationship.
+ */
+public interface EdmNavigationProperty extends EdmElement {
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the partner navigation property
+ */
+ EdmNavigationProperty getPartner();
+
+ String getReferencingPropertyName(String referencedPropertyName);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperation.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperation.java
new file mode 100644
index 0000000..c653411
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperation.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+import java.util.List;
+
+/**
+ * A EdmOperation can either be an {@link EdmAction} or an {@link EdmFunction}.
+ */
+public interface EdmOperation extends EdmType {
+
+ /**
+ * @param name
+ * @return {@link EdmParameter} for this name
+ */
+ EdmParameter getParameter(String name);
+
+ /**
+ * @return a list of all parameter names
+ */
+ List<String> getParameterNames();
+
+ /**
+ * @param bindingParameterEntitySet
+ * @return {@link EdmEntitySet} for this binding
+ */
+ EdmEntitySet getReturnedEntitySet(EdmEntitySet bindingParameterEntitySet);
+
+ /**
+ * @return {@link EdmReturnType} of this operation
+ */
+ EdmReturnType getReturnType();
+
+ /**
+ * For more information on bound operations please refer to the OData V4 specification.
+ *
+ * @return true if bound
+ */
+ boolean isBound();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImport.java
new file mode 100644
index 0000000..84f2859
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImport.java
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+/**
+ * An EdmOperationImport can be an EdmActionImport or an EdmFunctionImport.
+ */
+public interface EdmOperationImport extends EdmNamed {
+
+ /**
+ * @return {@link EdmEntitySet} of this OperationImport
+ */
+ EdmEntitySet getReturnedEntitySet();
+
+ /**
+ * @return {@link EdmEntityContainer} of this EdmOperationImport
+ */
+ EdmEntityContainer getEntityContainer();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImportInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImportInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImportInfo.java
new file mode 100644
index 0000000..0b96113
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmOperationImportInfo.java
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+/**
+ * Objects of this class contain information about one action or function import inside the EntityDataModel.
+ */
+public interface EdmOperationImportInfo {
+
+ /**
+ * @return the entity container name which contains this function import.
+ */
+ String getEntityContainerName();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java
new file mode 100644
index 0000000..a0cfe67
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmParameter.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * A CSDL parameter element
+ */
+public interface EdmParameter extends EdmElement, EdmMappable {
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveType.java
new file mode 100644
index 0000000..7ce5c9a
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveType.java
@@ -0,0 +1,166 @@
+/*
+ * 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;
+
+/**
+ * EdmPrimitiveType is a primitive type as defined in the Entity Data Model (EDM).
+ * <br/>
+ * There are methods to convert EDM primitive types from and to Java objects, respectively. The following Java types are
+ * supported:
+ * <table frame="hsides" rules="groups">
+ * <thead>
+ * <tr><th>EDM primitive type</th><th>Java types</th></tr>
+ * </thead>
+ * <tbody>
+ * <tr><td>Binary</td><td>byte[], {@link Byte}[]</td></tr>
+ * <tr><td>Boolean</td><td>{@link Boolean}</td></tr>
+ * <tr><td>Byte</td><td>{@link Short}, {@link Byte}, {@link Integer}, {@link Long}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>Date</td><td>{@link java.util.Calendar}, {@link java.util.Date}, {@link Long}</td></tr>
+ * <tr><td>DateTimeOffset</td><td>{@link java.util.Calendar}, {@link java.util.Date}, {@link Long}</td></tr>
+ * <tr><td>Decimal</td><td>{@link java.math.BigDecimal}, {@link java.math.BigInteger}, {@link Double}, {@link Float},
+ * {@link Byte}, {@link Short}, {@link Integer}, {@link Long}</td></tr>
+ * <tr><td>Double</td><td>{@link Double}, {@link Float}, {@link java.math.BigDecimal}, {@link Byte}, {@link Short},
+ * {@link Integer}, {@link Long}</td></tr>
+ * <tr><td>Duration</td><td>{@link java.math.BigDecimal}, {@link java.math.BigInteger}, {@link Double}, {@link Float},
+ * {@link Byte}, {@link Short}, {@link Integer}, {@link Long}</td></tr>
+ * <tr><td>Guid</td><td>{@link java.util.UUID}</td></tr>
+ * <tr><td>Int16</td><td>{@link Short}, {@link Byte}, {@link Integer}, {@link Long}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>Int32</td><td>{@link Integer}, {@link Byte}, {@link Short}, {@link Long}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>Int64</td><td>{@link Long}, {@link Byte}, {@link Short}, {@link Integer}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>SByte</td><td>{@link Byte}, {@link Short}, {@link Integer}, {@link Long}, {@link java.math.BigInteger}
+ * </td></tr>
+ * <tr><td>Single</td><td>{@link Float}, {@link Double}, {@link java.math.BigDecimal}, {@link Byte}, {@link Short},
+ * {@link Integer}, {@link Long}</td></tr>
+ * <tr><td>String</td><td>{@link String}</td></tr>
+ * <tr><td>TimeOfDay</td><td>{@link java.util.Calendar}, {@link java.util.Date}, {@link Long}</td></tr>
+ * </tbody>
+ * </table>
+ * <p>
+ * The first Java type is the default type for the respective EDM primitive type.
+ * </p>
+ * <p>
+ * For all EDM primitive types, the <code>Nullable</code> facet is taken into account. For <code>Binary</code> and
+ * <code>String</code>, <code>MaxLength</code> is also applicable. For <code>String</code>, the facet
+ * <code>Unicode</code> is considered additionally. The EDM primitive types <code>DateTimeOffset</code>,
+ * <code>Decimal</code>, <code>Duration</code>, and <code>TimeOfDay</code> can have a <code>Precision</code> facet.
+ * Additionally, <code>Decimal</code> can have the facet <code>Scale</code>.
+ * </p>
+ */
+public interface EdmPrimitiveType extends EdmType {
+
+ static final String EDM_NAMESPACE = "Edm";
+
+ static final String SYSTEM_NAMESPACE = "System";
+
+ /**
+ * Checks type compatibility.
+ *
+ * @param primitiveType the {@link EdmPrimitiveType} to be tested for compatibility
+ * @return <code>true</code> if the provided type is compatible to this type
+ */
+ boolean isCompatible(EdmPrimitiveType primitiveType);
+
+ /**
+ * Returns the default Java type for this EDM primitive type as described in the documentation of
+ * {@link EdmPrimitiveType}.
+ *
+ * @return the default Java type
+ */
+ Class<?> getDefaultType();
+
+ /**
+ * Validates literal value.
+ *
+ * @param value the literal value
+ * @param isNullable whether the <code>null</code> value is allowed
+ * @param maxLength the maximum length
+ * @param precision the precision
+ * @param scale the scale
+ * @param isUnicode whether non-ASCII characters are allowed (relevant only for Edm.String)
+ * @return <code>true</code> if the validation is successful
+ */
+ boolean validate(String value,
+ Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode);
+
+ /**
+ * Converts literal representation of value to system data type.
+ *
+ * @param value the literal representation of value
+ * @param isNullable whether the <code>null</code> value is allowed
+ * @param maxLength the maximum length
+ * @param precision the precision
+ * @param scale the scale
+ * @param isUnicode whether non-ASCII characters are allowed (relevant only for Edm.String)
+ * @param returnType the class of the returned value; it must be one of the list in the documentation of
+ * {@link EdmPrimitiveType}
+ * @throws EdmPrimitiveTypeException
+ * @return the value as an instance of the class the parameter <code>returnType</code> indicates
+ */
+ <T> T valueOfString(String value,
+ Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode,
+ Class<T> returnType) throws EdmPrimitiveTypeException;
+
+ /**
+ * Converts system data type to literal representation of value.
+ * <p>
+ * Returns <code>null</code> if value is <code>null</code> and <code>null</code> is an allowed value.
+ * </p>
+ *
+ * @param value the Java value as Object; its type must be one of the list in the documentation of
+ * {@link EdmPrimitiveType}
+ * @param isNullable whether the <code>null</code> value is allowed
+ * @param maxLength the maximum length
+ * @param precision the precision
+ * @param scale the scale
+ * @param isUnicode whether non-ASCII characters are allowed (relevant only for Edm.String)
+ * @throws EdmPrimitiveTypeException
+ * @return literal representation as String
+ */
+ String valueToString(Object value,
+ Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode)
+ throws EdmPrimitiveTypeException;
+
+ /**
+ * Converts default literal representation to URI literal representation.
+ * <p>
+ * Returns <code>null</code> if the literal is <code>null</code>. Does not perform any validation.
+ * </p>
+ *
+ * @param literal the literal in default representation
+ * @return URI literal representation as String
+ */
+ String toUriLiteral(String literal);
+
+ /**
+ * Converts URI literal representation to default literal representation.
+ * <p>
+ * Returns <code>null</code> if the literal is <code>null</code>. Checks the presence of a required prefix and of
+ * required surrounding quotation marks but does not perform any further validation.
+ * </p>
+ *
+ * @param literal the literal in URI representation
+ * @return default literal representation as String
+ * @throws EdmPrimitiveTypeException if a required prefix or required surrounding quotation marks are missing
+ */
+ String fromUriLiteral(String literal) throws EdmPrimitiveTypeException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
new file mode 100644
index 0000000..d9edae5
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
@@ -0,0 +1,32 @@
+/*
+ * 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;
+
+public class EdmPrimitiveTypeException extends Exception {
+
+ private static final long serialVersionUID = -93578822384514620L;
+
+ public EdmPrimitiveTypeException(final String msg) {
+ super(msg);
+ }
+
+ public EdmPrimitiveTypeException(final String msg, final Exception cause) {
+ super(msg, cause);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java
new file mode 100644
index 0000000..fdaf67e
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmProperty.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * A CSDL Property element.
+ * <br/>
+ * EdmProperty defines a simple type or a complex type.
+ */
+public interface EdmProperty extends EdmElement, EdmMappable {
+
+ /**
+ * Gets the related MIME type for the property.
+ *
+ * @return MIME type as String
+ */
+ String getMimeType();
+
+ /**
+ * Gets the info if the property is a primitive property.
+ *
+ * @return true, if it is a primitive property
+ */
+ boolean isPrimitive();
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+
+ /**
+ * @return true if unicode or null if not specified
+ */
+ Boolean isUnicode();
+
+ /**
+ * @return the default value as a String or null if not specified
+ */
+ String getDefaultValue();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java
new file mode 100644
index 0000000..9bb849f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmReturnType.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * An {@link EdmReturnType} of an {@link EdmOperation}.
+ */
+public interface EdmReturnType extends EdmTyped {
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmServiceMetadata.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmServiceMetadata.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmServiceMetadata.java
new file mode 100644
index 0000000..b186fdd
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmServiceMetadata.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+import java.io.InputStream;
+import java.util.List;
+
+/**
+ * This interface gives access to the metadata of a service, the calculated Data Service Version and an info list of all
+ * entity sets, singletons, and function imports inside this EntityDataModel.
+ */
+public interface EdmServiceMetadata {
+
+ /**
+ * @return {@link InputStream} containing the metadata document
+ */
+ InputStream getMetadata();
+
+ /**
+ * @return <b>String</b> data service version of this service
+ */
+ String getDataServiceVersion();
+
+ /**
+ * @return a list of {@link EdmEntitySetInfo} objects inside the data model
+ */
+ List<EdmEntitySetInfo> getEntitySetInfos();
+
+ /**
+ * @return a list of {@link EdmSingletonInfo} objects inside the data model
+ */
+ List<EdmSingletonInfo> getSingletonInfos();
+
+ /**
+ * @return a list of {@link EdmActionImportInfo} objects inside the data model
+ */
+ List<EdmActionImportInfo> getActionImportInfos();
+
+ /**
+ * @return a list of {@link EdmFunctionImportInfo} objects inside the data model
+ */
+ List<EdmFunctionImportInfo> getFunctionImportInfos();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingleton.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingleton.java
new file mode 100644
index 0000000..135f189
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingleton.java
@@ -0,0 +1,26 @@
+/*
+ * 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;
+
+/**
+ * An {@link EdmSingleton} represents a single entity inside the entity model.
+ */
+public interface EdmSingleton extends EdmBindingTarget {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingletonInfo.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingletonInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingletonInfo.java
new file mode 100644
index 0000000..faf3835
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmSingletonInfo.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+import java.net.URI;
+
+/**
+ * Objects of this class contain information about one singleton inside the EntityDataModel.
+ */
+public interface EdmSingletonInfo {
+
+ /**
+ * @return the entity container name which contains this singleton.
+ */
+ String getEntityContainerName();
+
+ /**
+ * @return the singleton name
+ */
+ String getSingletonName();
+
+ /**
+ * We use a {@link URI} object here to ensure the right encoding. If a string representation is needed the
+ * toASCIIString() method can be used.
+ *
+ * @return the uri to this singleton e.g. "EmployeeOfTheMonth"
+ */
+ URI getEntitySetUri();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmStructuredType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmStructuredType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmStructuredType.java
new file mode 100644
index 0000000..3c823dc
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmStructuredType.java
@@ -0,0 +1,82 @@
+/*
+ * 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;
+
+import java.util.List;
+
+/**
+ * EdmStructuralType is the base for a complex type or an entity type.
+ *
+ * Complex types and entity types are described in the Conceptual Schema Definition of the OData protocol.
+ */
+public interface EdmStructuredType extends EdmType {
+
+ /**
+ * Get property by name
+ *
+ * @param name
+ * @return simple, complex or navigation property as {@link EdmTyped}
+ */
+ EdmElement getProperty(String name);
+
+ /**
+ * Get all simple and complex property names.
+ *
+ * @return property names as type List<String>
+ */
+ List<String> getPropertyNames();
+
+ /**
+ * Get structural property by name.
+ *
+ * @param name
+ * @return simple or complex property as {@link EdmTyped}
+ */
+ EdmProperty getStructuralProperty(String name);
+
+ /**
+ * Get navigation property by name.
+ *
+ * @param name
+ * @return navigation property as {@link EdmTyped}
+ */
+ EdmNavigationProperty getNavigationProperty(String name);
+
+ /**
+ * Get all navigation property names.
+ *
+ * @return navigation property names as type List<String>
+ */
+ List<String> getNavigationPropertyNames();
+
+ /**
+ * Base types are described in the OData protocol specification.
+ *
+ * @return {@link EdmStructuredType}
+ */
+ EdmStructuredType getBaseType();
+
+ /**
+ * Checks if this type is convertible to parameter {@link targetType}
+ *
+ * @param targetType
+ * @return true if this type is compatible to the testType ( i.e. this type is a subtype of targetType )
+ */
+ boolean compatibleTo(EdmType targetType);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTerm.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTerm.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTerm.java
new file mode 100644
index 0000000..25a2459
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTerm.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * An {@link EdmTerm} defines a term in a vocabulary.
+ */
+public interface EdmTerm extends EdmNamed {
+
+ /**
+ * @return true if nullable or null if not specified
+ */
+ Boolean isNullable();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+
+ /**
+ * @return the default value as a String or null if not specified
+ */
+ String getDefaultValue();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmType.java
new file mode 100644
index 0000000..985e101
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmType.java
@@ -0,0 +1,40 @@
+/*
+ * 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;
+
+import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+
+/**
+ * EdmType holds the namespace of a given type and its type as {@link EdmTypeKind}.
+ */
+public interface EdmType extends EdmNamed {
+
+ /**
+ * Namespace of this {@link EdmType}.
+ *
+ * @return namespace as String
+ */
+ String getNamespace();
+
+ /**
+ * @return {@link EdmTypeKind} of this {@link EdmType}
+ */
+ EdmTypeKind getKind();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTypeDefinition.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTypeDefinition.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTypeDefinition.java
new file mode 100644
index 0000000..c16ed85
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTypeDefinition.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * An {@link EdmTypeDefinition} defines a specialization of one of the possible primitive types.
+ * <br/>
+ * For more information on primitive types refer to {@link EdmPrimitiveType}.
+ */
+public interface EdmTypeDefinition extends EdmPrimitiveType {
+
+ /**
+ * @return {@link EdmPrimitiveType} this type definition is based upon
+ */
+ EdmPrimitiveType getUnderlyingType();
+
+ /**
+ * @return the maximum length as an Integer or null if not specified
+ */
+ Integer getMaxLength();
+
+ /**
+ * @return the precision as an Integer or null if not specified
+ */
+ Integer getPrecision();
+
+ /**
+ * @return the scale as an Integer or null if not specified
+ */
+ Integer getScale();
+
+ /**
+ * @return true if unicode or null if not specified
+ */
+ Boolean isUnicode();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTyped.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTyped.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTyped.java
new file mode 100644
index 0000000..366e359
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmTyped.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * EdmTyped indicates if an EDM element is of a special type and holds the multiplicity of that type.
+ */
+public interface EdmTyped {
+
+ /**
+ * See {@link EdmType} for more information about possible types.
+ *
+ * @return {@link EdmType}
+ */
+ EdmType getType();
+
+ /**
+ * @return true if this typed element is a collection
+ */
+ boolean isCollection();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
new file mode 100644
index 0000000..f993c23
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/FullQualifiedName.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+/**
+ * A full qualified name of any element in the EDM consists of a name and a namespace.
+ */
+public class FullQualifiedName {
+
+ private final String namespace;
+
+ private final String name;
+
+ private final String fqn;
+
+ /**
+ * @param namespace
+ * @param name
+ */
+ public FullQualifiedName(final String namespace, final String name) {
+ this.namespace = namespace;
+ this.name = name;
+ fqn = namespace + "." + name;
+ }
+
+ /**
+ * @return namespace
+ */
+ public String getNamespace() {
+ return namespace;
+ }
+
+ /**
+ * @return name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return namespace.name
+ */
+ public String getFullQualifiedNameAsString() {
+ return fqn;
+ }
+
+ @Override
+ public int hashCode() {
+ return toString().hashCode();
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if ((obj == null) || !(obj instanceof FullQualifiedName)) {
+ return false;
+ }
+ final FullQualifiedName other = (FullQualifiedName) obj;
+ return namespace.equals(other.getNamespace()) && name.equals(other.getName());
+ }
+
+ @Override
+ public String toString() {
+ return fqn;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java
new file mode 100644
index 0000000..3bee0bd
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/Target.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.commons.api.edm;
+
+public class Target {
+
+ private String targetName;
+
+ private FullQualifiedName entityContainer;
+
+ public static class Builder {
+
+ private final Target instance;
+
+ public Builder(final String target, final EdmEntityContainer defaultContainer) {
+ final String[] bindingTargetParts = target.split("/");
+
+ instance = new Target();
+ if (bindingTargetParts.length == 1) {
+ instance.
+ setEntityContainer(new FullQualifiedName(defaultContainer.getNamespace(), defaultContainer.getName())).
+ setTargetName(bindingTargetParts[0]);
+ } else {
+ final int idx = bindingTargetParts[0].lastIndexOf('.');
+ instance.
+ setEntityContainer(new FullQualifiedName(
+ bindingTargetParts[0].substring(0, idx), bindingTargetParts[0].substring(idx))).
+ setTargetName(bindingTargetParts[1]);
+ }
+ }
+
+ public Target build() {
+ return instance;
+ }
+ }
+
+ public String getTargetName() {
+ return targetName;
+ }
+
+ public Target setTargetName(final String targetPathName) {
+ targetName = targetPathName;
+ return this;
+ }
+
+ public FullQualifiedName getEntityContainer() {
+ return entityContainer;
+ }
+
+ public Target setEntityContainer(final FullQualifiedName entityContainer) {
+ this.entityContainer = entityContainer;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ConcurrencyMode.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ConcurrencyMode.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ConcurrencyMode.java
new file mode 100644
index 0000000..73f5c38
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/ConcurrencyMode.java
@@ -0,0 +1,26 @@
+/*
+ * 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.constants;
+
+public enum ConcurrencyMode {
+
+ None,
+ Fixed
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmContentKind.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmContentKind.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmContentKind.java
new file mode 100644
index 0000000..9331f89
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmContentKind.java
@@ -0,0 +1,30 @@
+/*
+ * 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.constants;
+
+/**
+ * Specifies the content type of the value of the property being mapped via a customizable feed mapping.
+ */
+public enum EdmContentKind {
+
+ text,
+ html,
+ xhtml;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/897db8ef/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmOnDelete.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmOnDelete.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmOnDelete.java
new file mode 100644
index 0000000..8f9eba2
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/constants/EdmOnDelete.java
@@ -0,0 +1,25 @@
+/*
+ * 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.constants;
+
+public enum EdmOnDelete {
+
+ Cascade, None, SetNull, SetDefault;
+
+}