http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java index e0dd12b..fd79ec4 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ClientTypeDefinition.java @@ -23,14 +23,14 @@ import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import org.apache.commons.lang3.BooleanUtils; import org.apache.olingo.commons.api.edm.geo.SRID; -import org.apache.olingo.commons.api.edm.provider.TypeDefinition; +import org.apache.olingo.commons.api.edm.provider.CsdlTypeDefinition; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import java.io.IOException; @JsonDeserialize(using = ClientTypeDefinition.TypeDefinitionDeserializer.class) -class ClientTypeDefinition extends TypeDefinition { +class ClientTypeDefinition extends CsdlTypeDefinition { private static final long serialVersionUID = -902407149079419602L;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java index f153ddb..c1b4e7c 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java @@ -41,7 +41,7 @@ import org.apache.olingo.commons.api.domain.ODataServiceDocument; import org.apache.olingo.commons.api.domain.ODataValue; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; -import org.apache.olingo.commons.api.edm.provider.Schema; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.serialization.ODataDeserializerException; import org.apache.olingo.commons.core.edm.EdmProviderImpl; @@ -67,7 +67,7 @@ public class ODataReaderImpl implements ODataReader { } @Override - public Edm readMetadata(final Map<String, Schema> xmlSchemas) { + public Edm readMetadata(final Map<String, CsdlSchema> xmlSchemas) { ClientEdmProvider prov = new ClientEdmProvider(xmlSchemas); return new EdmProviderImpl(prov); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java index 2245a14..aad1dc7 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/URIEscapeTest.java @@ -32,7 +32,7 @@ import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.geo.Geospatial; import org.apache.olingo.commons.api.edm.geo.Point; -import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; import org.apache.olingo.commons.core.edm.EdmEnumTypeImpl; import org.junit.Test; @@ -51,7 +51,7 @@ public class URIEscapeTest { @Test public void _enum() throws UnsupportedEncodingException { final EdmEnumType pattern = - new EdmEnumTypeImpl(null, new FullQualifiedName("Sales", "Pattern"), new EnumType()); + new EdmEnumTypeImpl(null, new FullQualifiedName("Sales", "Pattern"), new CsdlEnumType()); assertEquals("Sales.Pattern'Yellow'", URIUtils.escape( pattern.toUriLiteral("Yellow"))); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java index aa94a80..eff892e 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/uri/v4/FilterFactoryTest.java @@ -33,7 +33,7 @@ import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.Constants; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.FullQualifiedName; -import org.apache.olingo.commons.api.edm.provider.EnumType; +import org.apache.olingo.commons.api.edm.provider.CsdlEnumType; import org.apache.olingo.commons.core.edm.EdmEnumTypeImpl; import org.junit.Test; @@ -55,7 +55,7 @@ public class FilterFactoryTest extends AbstractTest { @Test public void has() { final EdmEnumType pattern = - new EdmEnumTypeImpl(null, new FullQualifiedName("Sales", "Pattern"), new EnumType()); + new EdmEnumTypeImpl(null, new FullQualifiedName("Sales", "Pattern"), new CsdlEnumType()); final URIFilter filter = getFilterFactory().has(getFilterArgFactory().property("style"), pattern, "Yellow"); assertEquals("(style has Sales.Pattern'Yellow')", filter.build()); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java index 19b6881..8d359a7 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/MetadataTest.java @@ -48,16 +48,16 @@ import org.apache.olingo.commons.api.edm.EdmTypeDefinition; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.annotation.EdmUrlRef; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; -import org.apache.olingo.commons.api.edm.provider.Annotation; -import org.apache.olingo.commons.api.edm.provider.Annotations; -import org.apache.olingo.commons.api.edm.provider.ComplexType; -import org.apache.olingo.commons.api.edm.provider.EntityContainer; -import org.apache.olingo.commons.api.edm.provider.EntityType; -import org.apache.olingo.commons.api.edm.provider.Function; -import org.apache.olingo.commons.api.edm.provider.FunctionImport; -import org.apache.olingo.commons.api.edm.provider.Schema; -import org.apache.olingo.commons.api.edm.provider.Singleton; -import org.apache.olingo.commons.api.edm.provider.Term; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation; +import org.apache.olingo.commons.api.edm.provider.CsdlAnnotations; +import org.apache.olingo.commons.api.edm.provider.CsdlComplexType; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityContainer; +import org.apache.olingo.commons.api.edm.provider.CsdlEntityType; +import org.apache.olingo.commons.api.edm.provider.CsdlFunction; +import org.apache.olingo.commons.api.edm.provider.CsdlFunctionImport; +import org.apache.olingo.commons.api.edm.provider.CsdlSchema; +import org.apache.olingo.commons.api.edm.provider.CsdlSingleton; +import org.apache.olingo.commons.api.edm.provider.CsdlTerm; import org.apache.olingo.commons.api.edm.provider.annotation.Apply; import org.apache.olingo.commons.api.edm.provider.annotation.Collection; import org.apache.olingo.commons.api.edm.provider.annotation.ConstantAnnotationExpression; @@ -145,7 +145,7 @@ public class MetadataTest extends AbstractTest { assertNotNull(metadata); assertFalse(metadata.getSchema(0).getAnnotationGroups().isEmpty()); - final Annotations annots = metadata.getSchema(0).getAnnotationGroup("ODataDemo.DemoService/Suppliers"); + final CsdlAnnotations annots = metadata.getSchema(0).getAnnotationGroup("ODataDemo.DemoService/Suppliers"); assertNotNull(annots); assertFalse(annots.getAnnotations().isEmpty()); assertEquals(ConstantAnnotationExpression.Type.String, @@ -185,13 +185,13 @@ public class MetadataTest extends AbstractTest { toMetadata(getClass().getResourceAsStream("northwind-metadata.xml")); assertNotNull(metadata); - final Schema first = metadata.getSchema("NorthwindModel"); + final CsdlSchema first = metadata.getSchema("NorthwindModel"); assertNotNull(first); - final Schema second = metadata.getSchema("ODataWebExperimental.Northwind.Model"); + final CsdlSchema second = metadata.getSchema("ODataWebExperimental.Northwind.Model"); assertNotNull(second); - final EntityContainer entityContainer = second.getEntityContainer(); + final CsdlEntityContainer entityContainer = second.getEntityContainer(); assertNotNull(entityContainer); assertEquals("NorthwindEntities", entityContainer.getName()); } @@ -208,31 +208,31 @@ public class MetadataTest extends AbstractTest { assertFalse(metadata.getReferences().isEmpty()); assertEquals("Org.OData.Measures.V1", metadata.getReferences().get(1).getIncludes().get(0).getNamespace()); - final EntityType product = metadata.getSchema(0).getEntityType("Product"); + final CsdlEntityType product = metadata.getSchema(0).getEntityType("Product"); assertTrue(product.hasStream()); assertEquals("UoM.ISOCurrency", product.getProperty("Price").getAnnotations().get(0).getTerm()); assertEquals("Products", product.getNavigationProperty("Supplier").getPartner()); - final EntityType category = metadata.getSchema(0).getEntityType("Category"); + final CsdlEntityType category = metadata.getSchema(0).getEntityType("Category"); assertNotNull(category); - final ComplexType address = metadata.getSchema(0).getComplexType("Address"); + final CsdlComplexType address = metadata.getSchema(0).getComplexType("Address"); assertFalse(address.getNavigationProperty("Country").getReferentialConstraints().isEmpty()); assertEquals("Name", address.getNavigationProperty("Country").getReferentialConstraints().get(0).getReferencedProperty()); - final Function productsByRating = metadata.getSchema(0).getFunctions("ProductsByRating").get(0); + final CsdlFunction productsByRating = metadata.getSchema(0).getFunctions("ProductsByRating").get(0); assertNotNull(productsByRating.getParameter("Rating")); assertEquals("Edm.Int32", productsByRating.getParameter("Rating").getType()); assertEquals("ODataDemo.Product", productsByRating.getReturnType().getType()); assertTrue(productsByRating.getReturnType().isCollection()); - final Singleton contoso = metadata.getSchema(0).getEntityContainer().getSingleton("Contoso"); + final CsdlSingleton contoso = metadata.getSchema(0).getEntityContainer().getSingleton("Contoso"); assertNotNull(contoso); assertFalse(contoso.getNavigationPropertyBindings().isEmpty()); assertEquals("Products", contoso.getNavigationPropertyBindings().get(0).getPath()); - final FunctionImport functionImport = metadata.getSchema(0).getEntityContainer(). + final CsdlFunctionImport functionImport = metadata.getSchema(0).getEntityContainer(). getFunctionImport("ProductsByRating"); assertNotNull(functionImport); assertEquals(metadata.getSchema(0).getNamespace() + "." + productsByRating.getName(), @@ -286,7 +286,7 @@ public class MetadataTest extends AbstractTest { assertNotNull(metadata); // Check displayName - final Annotation displayName = metadata.getSchema(0).getAnnotationGroup("ODataDemo.Supplier"). + final CsdlAnnotation displayName = metadata.getSchema(0).getAnnotationGroup("ODataDemo.Supplier"). getAnnotation("Vocabulary1.DisplayName"); assertNotNull(displayName); assertTrue(displayName.getExpression().isDynamic()); @@ -308,7 +308,7 @@ public class MetadataTest extends AbstractTest { assertEquals("Address/CountryName", thirdArg.getValue()); // Check Tags - final Annotation tags = metadata.getSchema(0).getAnnotationGroup("ODataDemo.Product"). + final CsdlAnnotation tags = metadata.getSchema(0).getAnnotationGroup("ODataDemo.Product"). getAnnotation("Vocabulary1.Tags"); assertNotNull(tags); assertTrue(tags.getExpression().isDynamic()); @@ -347,10 +347,10 @@ public class MetadataTest extends AbstractTest { toMetadata(getClass().getResourceAsStream("fromdoc4-metadata.xml")); assertNotNull(metadata); - final Annotations group = metadata.getSchema(0).getAnnotationGroups().get(0); + final CsdlAnnotations group = metadata.getSchema(0).getAnnotationGroups().get(0); assertNotNull(group); - Annotation annotation = group.getAnnotations().get(0); + CsdlAnnotation annotation = group.getAnnotations().get(0); assertTrue(annotation.getExpression().isDynamic()); assertTrue(annotation.getExpression().asDynamic().isCast()); assertEquals("Edm.Decimal", annotation.getExpression().asDynamic().asCast().getType()); @@ -402,11 +402,11 @@ public class MetadataTest extends AbstractTest { final XMLMetadata metadata = getClient().getDeserializer(ODataFormat.XML). toMetadata(input); - Schema schema = metadata.getSchema("Capabilities"); + CsdlSchema schema = metadata.getSchema("Capabilities"); assertNotNull(schema); assertEquals(23, schema.getTerms().size()); - final Term deleteRestrictions = schema.getTerm("DeleteRestrictions"); + final CsdlTerm deleteRestrictions = schema.getTerm("DeleteRestrictions"); assertNotNull(deleteRestrictions); assertEquals("Capabilities.DeleteRestrictionsType", deleteRestrictions.getType()); } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java deleted file mode 100644 index 0c375ae..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmItem.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -public abstract class AbstractEdmItem implements Serializable { - - private static final long serialVersionUID = 241190986363884784L; - - protected <T extends Named> T getOneByName(final String name, final Collection<T> items) { - final List<T> result = getAllByName(name, items); - return result.isEmpty() ? null : result.get(0); - } - - protected <T extends Named> List<T> getAllByName(final String name, final Collection<T> items) { - final List<T> result = new ArrayList<T>(); - for (T type : items) { - if (name.equals(type.getName())) { - result.add(type); - } - } - return result; - } - - @Override - public boolean equals(final Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); - } - - @Override - public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); - } - - @Override - public String toString() { - return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmProvider.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmProvider.java deleted file mode 100644 index d1ada55..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AbstractEdmProvider.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -import java.util.List; - -import org.apache.olingo.commons.api.ODataException; -import org.apache.olingo.commons.api.edm.FullQualifiedName; - -public abstract class AbstractEdmProvider implements EdmProvider { - - @Override - public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { - return null; - } - - @Override - public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { - return null; - } - - @Override - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { - return null; - } - - @Override - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { - return null; - } - - @Override - public List<Action> getActions(final FullQualifiedName actionName) throws ODataException { - return null; - } - - @Override - public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException { - return null; - } - - @Override - public Term getTerm(final FullQualifiedName termName) throws ODataException { - return null; - } - - @Override - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) - throws ODataException { - return null; - } - - @Override - public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) - throws ODataException { - return null; - } - - @Override - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) - throws ODataException { - return null; - } - - @Override - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) - throws ODataException { - return null; - } - - @Override - public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException { - return null; - } - - @Override - public List<AliasInfo> getAliasInfos() throws ODataException { - return null; - } - - @Override - public List<Schema> getSchemas() throws ODataException { - return null; - } - - @Override - public EntityContainer getEntityContainer() throws ODataException { - return null; - } - - @Override - public Annotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException { - return null; - } - - @Override - public Annotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException { - return null; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java deleted file mode 100644 index 1a614a7..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Action.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -import java.util.List; - -public class Action extends Operation { - - private static final long serialVersionUID = 211295197043448841L; - - @Override - public Action setName(final String name) { - this.name = name; - return this; - } - - @Override - public Action setBound(final boolean isBound) { - this.isBound = isBound; - return this; - } - - @Override - public Action setEntitySetPath(final String entitySetPath) { - this.entitySetPath = entitySetPath; - return this; - } - - @Override - public Action setParameters(final List<Parameter> parameters) { - this.parameters = parameters; - return this; - } - - @Override - public Action setReturnType(final ReturnType returnType) { - this.returnType = returnType; - return this; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java deleted file mode 100644 index a773039..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ActionImport.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; - - -public class ActionImport extends OperationImport { - - private static final long serialVersionUID = 9186148718228340987L; - - private FullQualifiedName action; - - @Override - public ActionImport setName(final String name) { - this.name = name; - return this; - } - - @Override - public ActionImport setEntitySet(final String entitySet) { - this.entitySet = entitySet; - return this; - } - - public String getAction() { - return action.getFullQualifiedNameAsString(); - } - - public FullQualifiedName getActionFQN() { - return action; - } - - public ActionImport setAction(final String action) { - this.action = new FullQualifiedName(action); - return this; - } - - public ActionImport setAction(final FullQualifiedName action) { - this.action = action; - return this; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java deleted file mode 100644 index b4493f5..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/AliasInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -public class AliasInfo { - - private String namespace; - - private String alias; - - public String getNamespace() { - return namespace; - } - - public AliasInfo setNamespace(final String namespace) { - this.namespace = namespace; - return this; - } - - public String getAlias() { - return alias; - } - - public AliasInfo setAlias(final String alias) { - this.alias = alias; - return this; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java deleted file mode 100644 index 1e97719..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotatable.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -import java.util.List; - -public interface Annotatable { - - List<Annotation> getAnnotations(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java deleted file mode 100644 index 67791c9..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotation.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; - -public class Annotation extends AbstractEdmItem implements Annotatable { - - private static final long serialVersionUID = -7137313445729486860L; - - private String term; - - private String qualifier; - - private List<Annotation> annotation = new ArrayList<Annotation>(); - - private AnnotationExpression annotationExpression; - - public AnnotationExpression getExpression() { - return annotationExpression; - } - - public void setExpression(final AnnotationExpression annotationExpression) { - this.annotationExpression = annotationExpression; - } - - public String getTerm() { - return term; - } - - public Annotation setTerm(final String term) { - this.term = term; - return this; - } - - public String getQualifier() { - return qualifier; - } - - public Annotation setQualifier(final String qualifier) { - this.qualifier = qualifier; - return this; - } - -// public List<Annotation> getAnnotation() { -// return annotation; -// } - - public Annotation setAnnotations(final List<Annotation> annotation) { - this.annotation = annotation; - return this; - } - - @Override - public List<Annotation> getAnnotations() { - return annotation; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java deleted file mode 100644 index c01566d..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Annotations.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -import java.util.ArrayList; -import java.util.List; - -public class Annotations extends AbstractEdmItem implements Annotatable{ - - private static final long serialVersionUID = 8283036066408166150L; - - private final List<Annotation> annotations = new ArrayList<Annotation>(); - - private String target; - - private String qualifier; - - public String getTarget() { - return target; - } - - public Annotations setTarget(final String target) { - this.target = target; - return this; - } - - public String getQualifier() { - return qualifier; - } - - public Annotations setQualifier(final String qualifier) { - this.qualifier = qualifier; - return this; - } - - @Override - public List<Annotation> getAnnotations() { - return annotations; - } - - public Annotation getAnnotation(final String term) { - Annotation result = null; - for (Annotation annotation : getAnnotations()) { - if (term.equals(annotation.getTerm())) { - result = annotation; - } - } - return result; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java deleted file mode 100644 index 4612857..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/BindingTarget.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; - -public abstract class BindingTarget extends AbstractEdmItem implements Named, Annotatable { - - private static final long serialVersionUID = -7011724617956042182L; - - protected String name; - - protected FullQualifiedName type; - - protected List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>(); - - private final List<Annotation> annotations = new ArrayList<Annotation>(); - - public String getName() { - return name; - } - - public BindingTarget setName(final String name) { - this.name = name; - return this; - } - - public String getType() { - return type.getFullQualifiedNameAsString(); - } - - public FullQualifiedName getTypeFQN() { - return type; - } - - public BindingTarget setType(final String type) { - this.type = new FullQualifiedName(type); - return this; - } - - public BindingTarget setType(final FullQualifiedName type) { - this.type = type; - return this; - } - - public List<NavigationPropertyBinding> getNavigationPropertyBindings() { - return navigationPropertyBindings; - } - - public BindingTarget setNavigationPropertyBindings(final List<NavigationPropertyBinding> navigationPropertyBindings) { - this.navigationPropertyBindings = navigationPropertyBindings; - return this; - } - - @Override - public List<Annotation> getAnnotations() { - return annotations; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java deleted file mode 100644 index 07f4d3b..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ComplexType.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.commons.api.edm.provider; - -import java.util.List; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; - -public class ComplexType extends StructuralType { - - private static final long serialVersionUID = 1089771609327713928L; - - @Override - public ComplexType setName(final String name) { - this.name = name; - return this; - } - - @Override - public ComplexType setOpenType(final boolean isOpenType) { - this.isOpenType = isOpenType; - return this; - } - - @Override - public ComplexType setBaseType(final String baseType) { - this.baseType = new FullQualifiedName(baseType); - return this; - } - - @Override - public ComplexType setBaseType(final FullQualifiedName baseType) { - this.baseType = baseType; - return this; - } - - @Override - public ComplexType setAbstract(final boolean isAbstract) { - this.isAbstract = isAbstract; - return this; - } - - @Override - public ComplexType setProperties(final List<Property> properties) { - this.properties = properties; - return this; - } - - @Override - public ComplexType setNavigationProperties(final List<NavigationProperty> navigationProperties) { - this.navigationProperties = navigationProperties; - return this; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.java new file mode 100644 index 0000000..0b02947 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmItem.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.provider; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +public abstract class CsdlAbstractEdmItem implements Serializable { + + private static final long serialVersionUID = 241190986363884784L; + + protected <T extends CsdlNamed> T getOneByName(final String name, final Collection<T> items) { + final List<T> result = getAllByName(name, items); + return result.isEmpty() ? null : result.get(0); + } + + protected <T extends CsdlNamed> List<T> getAllByName(final String name, final Collection<T> items) { + final List<T> result = new ArrayList<T>(); + for (T type : items) { + if (name.equals(type.getName())) { + result.add(type); + } + } + return result; + } + + @Override + public boolean equals(final Object obj) { + return EqualsBuilder.reflectionEquals(this, obj); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java new file mode 100644 index 0000000..802cef8 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAbstractEdmProvider.java @@ -0,0 +1,117 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.List; + +import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public abstract class CsdlAbstractEdmProvider implements CsdlEdmProvider { + + @Override + public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException { + return null; + } + + @Override + public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException { + return null; + } + + @Override + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException { + return null; + } + + @Override + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException { + return null; + } + + @Override + public List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException { + return null; + } + + @Override + public List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException { + return null; + } + + @Override + public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException { + return null; + } + + @Override + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + throws ODataException { + return null; + } + + @Override + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) + throws ODataException { + return null; + } + + @Override + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) + throws ODataException { + return null; + } + + @Override + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) + throws ODataException { + return null; + } + + @Override + public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) + throws ODataException { + return null; + } + + @Override + public List<CsdlAliasInfo> getAliasInfos() throws ODataException { + return null; + } + + @Override + public List<CsdlSchema> getSchemas() throws ODataException { + return null; + } + + @Override + public CsdlEntityContainer getEntityContainer() throws ODataException { + return null; + } + + @Override + public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException { + return null; + } + + @Override + public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException { + return null; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java new file mode 100644 index 0000000..bfd0d83 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAction.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.List; + +public class CsdlAction extends CsdlOperation { + + private static final long serialVersionUID = 211295197043448841L; + + @Override + public CsdlAction setName(final String name) { + this.name = name; + return this; + } + + @Override + public CsdlAction setBound(final boolean isBound) { + this.isBound = isBound; + return this; + } + + @Override + public CsdlAction setEntitySetPath(final String entitySetPath) { + this.entitySetPath = entitySetPath; + return this; + } + + @Override + public CsdlAction setParameters(final List<CsdlParameter> parameters) { + this.parameters = parameters; + return this; + } + + @Override + public CsdlAction setReturnType(final CsdlReturnType returnType) { + this.returnType = returnType; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java new file mode 100644 index 0000000..eb47c5c --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlActionImport.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + + +public class CsdlActionImport extends CsdlOperationImport { + + private static final long serialVersionUID = 9186148718228340987L; + + private FullQualifiedName action; + + @Override + public CsdlActionImport setName(final String name) { + this.name = name; + return this; + } + + @Override + public CsdlActionImport setEntitySet(final String entitySet) { + this.entitySet = entitySet; + return this; + } + + public String getAction() { + return action.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getActionFQN() { + return action; + } + + public CsdlActionImport setAction(final String action) { + this.action = new FullQualifiedName(action); + return this; + } + + public CsdlActionImport setAction(final FullQualifiedName action) { + this.action = action; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAliasInfo.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAliasInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAliasInfo.java new file mode 100644 index 0000000..ba6067a --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAliasInfo.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +public class CsdlAliasInfo { + + private String namespace; + + private String alias; + + public String getNamespace() { + return namespace; + } + + public CsdlAliasInfo setNamespace(final String namespace) { + this.namespace = namespace; + return this; + } + + public String getAlias() { + return alias; + } + + public CsdlAliasInfo setAlias(final String alias) { + this.alias = alias; + return this; + } + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotatable.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotatable.java new file mode 100644 index 0000000..393f353 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotatable.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.provider; + +import java.util.List; + +public interface CsdlAnnotatable { + + List<CsdlAnnotation> getAnnotations(); +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java new file mode 100644 index 0000000..580c03f --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotation.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.olingo.commons.api.edm.provider.annotation.AnnotationExpression; + +public class CsdlAnnotation extends CsdlAbstractEdmItem implements CsdlAnnotatable { + + private static final long serialVersionUID = -7137313445729486860L; + + private String term; + + private String qualifier; + + private List<CsdlAnnotation> annotation = new ArrayList<CsdlAnnotation>(); + + private AnnotationExpression annotationExpression; + + public AnnotationExpression getExpression() { + return annotationExpression; + } + + public void setExpression(final AnnotationExpression annotationExpression) { + this.annotationExpression = annotationExpression; + } + + public String getTerm() { + return term; + } + + public CsdlAnnotation setTerm(final String term) { + this.term = term; + return this; + } + + public String getQualifier() { + return qualifier; + } + + public CsdlAnnotation setQualifier(final String qualifier) { + this.qualifier = qualifier; + return this; + } + +// public List<Annotation> getAnnotation() { +// return annotation; +// } + + public CsdlAnnotation setAnnotations(final List<CsdlAnnotation> annotation) { + this.annotation = annotation; + return this; + } + + @Override + public List<CsdlAnnotation> getAnnotations() { + return annotation; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.java new file mode 100644 index 0000000..595eb96 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlAnnotations.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.provider; + +import java.util.ArrayList; +import java.util.List; + +public class CsdlAnnotations extends CsdlAbstractEdmItem implements CsdlAnnotatable { + + private static final long serialVersionUID = 8283036066408166150L; + + private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + private String target; + + private String qualifier; + + public String getTarget() { + return target; + } + + public CsdlAnnotations setTarget(final String target) { + this.target = target; + return this; + } + + public String getQualifier() { + return qualifier; + } + + public CsdlAnnotations setQualifier(final String qualifier) { + this.qualifier = qualifier; + return this; + } + + @Override + public List<CsdlAnnotation> getAnnotations() { + return annotations; + } + + public CsdlAnnotation getAnnotation(final String term) { + CsdlAnnotation result = null; + for (CsdlAnnotation annotation : getAnnotations()) { + if (term.equals(annotation.getTerm())) { + result = annotation; + } + } + return result; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java new file mode 100644 index 0000000..c7143c7 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlBindingTarget.java @@ -0,0 +1,81 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public abstract class CsdlBindingTarget extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = -7011724617956042182L; + + protected String name; + + protected FullQualifiedName type; + + protected List<CsdlNavigationPropertyBinding> navigationPropertyBindings = + new ArrayList<CsdlNavigationPropertyBinding>(); + + private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public CsdlBindingTarget setName(final String name) { + this.name = name; + return this; + } + + public String getType() { + return type.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getTypeFQN() { + return type; + } + + public CsdlBindingTarget setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + public CsdlBindingTarget setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + public List<CsdlNavigationPropertyBinding> getNavigationPropertyBindings() { + return navigationPropertyBindings; + } + + public CsdlBindingTarget setNavigationPropertyBindings( + final List<CsdlNavigationPropertyBinding> navigationPropertyBindings) { + this.navigationPropertyBindings = navigationPropertyBindings; + return this; + } + + @Override + public List<CsdlAnnotation> getAnnotations() { + return annotations; + } + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java new file mode 100644 index 0000000..208d377 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlComplexType.java @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.List; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class CsdlComplexType extends CsdlStructuralType { + + private static final long serialVersionUID = 1089771609327713928L; + + @Override + public CsdlComplexType setName(final String name) { + this.name = name; + return this; + } + + @Override + public CsdlComplexType setOpenType(final boolean isOpenType) { + this.isOpenType = isOpenType; + return this; + } + + @Override + public CsdlComplexType setBaseType(final String baseType) { + this.baseType = new FullQualifiedName(baseType); + return this; + } + + @Override + public CsdlComplexType setBaseType(final FullQualifiedName baseType) { + this.baseType = baseType; + return this; + } + + @Override + public CsdlComplexType setAbstract(final boolean isAbstract) { + this.isAbstract = isAbstract; + return this; + } + + @Override + public CsdlComplexType setProperties(final List<CsdlProperty> properties) { + this.properties = properties; + return this; + } + + @Override + public CsdlComplexType setNavigationProperties(final List<CsdlNavigationProperty> navigationProperties) { + this.navigationProperties = navigationProperties; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java new file mode 100644 index 0000000..db40de1 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEdmProvider.java @@ -0,0 +1,179 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.List; + +import org.apache.olingo.commons.api.ODataException; +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public interface CsdlEdmProvider { + + /** + * This method should return an {@link CsdlEnumType} or <b>null</b> if nothing is found + * + * @param enumTypeName + * @return {@link CsdlEnumType} for given name + * @throws ODataException + */ + public CsdlEnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException; + + /** + * This method should return an {@link CsdlTypeDefinition} or <b>null</b> if nothing is found + * + * @param typeDefinitionName + * @return {@link CsdlTypeDefinition} for given name + * @throws ODataException + */ + public CsdlTypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException; + + /** + * This method should return an {@link CsdlEntityType} or <b>null</b> if nothing is found + * + * @param entityTypeName + * @return {@link CsdlEntityType} for the given name + * @throws ODataException + */ + public CsdlEntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException; + + /** + * This method should return a {@link CsdlComplexType} or <b>null</b> if nothing is found. + * + * @param complexTypeName + * @return {@link CsdlComplexType} for the given name + * @throws ODataException + */ + public CsdlComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException; + + /** + * This method should return a list of all {@link CsdlAction} for the FullQualifiedname + * or <b>null</b> if nothing is found + * + * @param actionName + * @return List of {@link CsdlAction} or null + * @throws ODataException + */ + public List<CsdlAction> getActions(final FullQualifiedName actionName) throws ODataException; + + /** + * This method should return a list of all {@link CsdlFunction} for the FullQualifiedname or <b>null</b> if nothing is + * found + * + * @param functionName + * @return List of {@link CsdlFunction} or null + * @throws ODataException + */ + public List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException; + + /** + * This method should return a {@link CsdlTerm} for the FullQualifiedName or <b>null</b> if nothing is found. + * @param termName the name of the Term + * @return {@link CsdlTerm} or null + * @throws ODataException + */ + public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException; + + /** + * This method should return an {@link CsdlEntitySet} or <b>null</b> if nothing is found + * + * @param entityContainer this EntitySet is contained in + * @param entitySetName + * @return {@link CsdlEntitySet} for the given container and entityset name + * @throws ODataException + */ + public CsdlEntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) + throws ODataException; + + /** + * This method should return an {@link CsdlSingleton} or <b>null</b> if nothing is found + * + * @param entityContainer this Singleton is contained in + * @param singletonName + * @return {@link CsdlSingleton} for given container and singleton name + * @throws ODataException + */ + public CsdlSingleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) + throws ODataException; + + /** + * This method should return an {@link CsdlActionImport} or <b>null</b> if nothing is found + * + * @param entityContainer this ActionImport is contained in + * @param actionImportName + * @return {@link CsdlActionImport} for the given container and ActionImport name + * @throws ODataException + */ + public CsdlActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) + throws ODataException; + + /** + * This method should return a {@link CsdlFunctionImport} or <b>null</b> if nothing is found + * + * @param entityContainer this FunctionImport is contained in + * @param functionImportName + * @return {@link CsdlFunctionImport} for the given container name and function import name + * @throws ODataException + */ + public CsdlFunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) + throws ODataException; + + /** + * This method should return an {@link CsdlEntityContainerInfo} or <b>null</b> if nothing is found + * + * @param entityContainerName (null for default container) + * @return {@link CsdlEntityContainerInfo} for the given name + * @throws ODataException + */ + public CsdlEntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) + throws ODataException; + + /** + * This method should return a list of all namespaces which have an alias + * + * @return List of alias info + * @throws ODataException + */ + public List<CsdlAliasInfo> getAliasInfos() throws ODataException; + + /** + * This method should return a collection of all {@link CsdlSchema} + * + * @return List<{@link Schema}> + * @throws ODataException + */ + public List<CsdlSchema> getSchemas() throws ODataException; + + /** + * Returns the entity container of this edm + * @return {@link CsdlEntityContainer} of this edm + */ + public CsdlEntityContainer getEntityContainer() throws ODataException; + + /** + * @param targetName + * @return {@link CsdlAnnotations} group for the given Target + */ + public CsdlAnnotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException; + + /** + * @param annotatedName + * @return Annotatble element by target name + */ + public CsdlAnnotatable getAnnoatatable(FullQualifiedName annotatedName) throws ODataException; +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java new file mode 100644 index 0000000..ee0a772 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainer.java @@ -0,0 +1,159 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class CsdlEntityContainer extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = 5384682515007129458L; + + private String name; + + private FullQualifiedName extendsContainer; + + private List<CsdlEntitySet> entitySets = new ArrayList<CsdlEntitySet>(); + + private List<CsdlActionImport> actionImports = new ArrayList<CsdlActionImport>(); + + private List<CsdlFunctionImport> functionImports = new ArrayList<CsdlFunctionImport>(); + + private List<CsdlSingleton> singletons = new ArrayList<CsdlSingleton>(); + + private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + // Annotations + public String getName() { + return name; + } + + public CsdlEntityContainer setName(final String name) { + this.name = name; + return this; + } + + public String getExtendsContainer() { + if (extendsContainer != null) { + return extendsContainer.getFullQualifiedNameAsString(); + } + return null; + } + + public FullQualifiedName getExtendsContainerFQN() { + return extendsContainer; + } + + public CsdlEntityContainer setExtendsContainer(final String extendsContainer) { + this.extendsContainer = new FullQualifiedName(extendsContainer); + return this; + } + + public List<CsdlEntitySet> getEntitySets() { + return entitySets; + } + + public CsdlEntitySet getEntitySet(final String name) { + return getOneByName(name, getEntitySets()); + } + + public CsdlEntityContainer setEntitySets(final List<CsdlEntitySet> entitySets) { + this.entitySets = entitySets; + return this; + } + + public List<CsdlActionImport> getActionImports() { + return actionImports; + } + + /** + * Gets the first action import with given name. + * + * @param name name. + * @return action import. + */ + public CsdlActionImport getActionImport(final String name) { + return getOneByName(name, getActionImports()); + } + + /** + * Gets all action imports with given name. + * + * @param name name. + * @return action imports. + */ + public List<CsdlActionImport> getActionImports(final String name) { + return getAllByName(name, getActionImports()); + } + + public CsdlEntityContainer setActionImports(final List<CsdlActionImport> actionImports) { + this.actionImports = actionImports; + return this; + } + + public List<CsdlFunctionImport> getFunctionImports() { + return functionImports; + } + + /** + * Gets the first function import with given name. + * + * @param name name. + * @return function import. + */ + public CsdlFunctionImport getFunctionImport(final String name) { + return getOneByName(name, getFunctionImports()); + } + + /** + * Gets all function imports with given name. + * + * @param name name. + * @return function imports. + */ + public List<CsdlFunctionImport> getFunctionImports(final String name) { + return getAllByName(name, getFunctionImports()); + } + + public CsdlEntityContainer setFunctionImports(final List<CsdlFunctionImport> functionImports) { + this.functionImports = functionImports; + return this; + } + + public List<CsdlSingleton> getSingletons() { + return singletons; + } + + public CsdlSingleton getSingleton(final String name) { + return getOneByName(name, getSingletons()); + } + + public CsdlEntityContainer setSingletons(final List<CsdlSingleton> singletons) { + this.singletons = singletons; + return this; + } + + @Override + public List<CsdlAnnotation> getAnnotations() { + return annotations; + } + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainerInfo.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainerInfo.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainerInfo.java new file mode 100644 index 0000000..9445c89 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityContainerInfo.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.provider; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class CsdlEntityContainerInfo { + + private FullQualifiedName containerName; + + private FullQualifiedName extendsContainer; + + public FullQualifiedName getContainerName() { + return containerName; + } + + public CsdlEntityContainerInfo setContainerName(final FullQualifiedName containerName) { + this.containerName = containerName; + return this; + } + + public FullQualifiedName getExtendsContainer() { + return extendsContainer; + } + + public CsdlEntityContainerInfo setExtendsContainer(final FullQualifiedName extendsContainer) { + this.extendsContainer = extendsContainer; + return this; + } + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java new file mode 100644 index 0000000..d4a6002 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySet.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.List; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class CsdlEntitySet extends CsdlBindingTarget { + + private static final long serialVersionUID = 5291570018480936643L; + + //Default for EntitySets is true + private boolean includeInServiceDocument = true; + + @Override + public CsdlEntitySet setName(final String name) { + this.name = name; + return this; + } + + @Override + public CsdlEntitySet setNavigationPropertyBindings( + final List<CsdlNavigationPropertyBinding> navigationPropertyBindings) { + this.navigationPropertyBindings = navigationPropertyBindings; + return this; + } + + @Override + public CsdlEntitySet setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + @Override + public CsdlEntitySet setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + public boolean isIncludeInServiceDocument() { + return includeInServiceDocument; + } + + public CsdlEntitySet setIncludeInServiceDocument(final boolean includeInServiceDocument) { + this.includeInServiceDocument = includeInServiceDocument; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2318953c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySetPath.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySetPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySetPath.java new file mode 100644 index 0000000..073559e --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntitySetPath.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +public class CsdlEntitySetPath { + + private String bindingParameter; + + private String path; + + public String getBindingParameter() { + return bindingParameter; + } + + public CsdlEntitySetPath setBindingParameter(final String bindingParameter) { + this.bindingParameter = bindingParameter; + return this; + } + + public String getPath() { + return path; + } + + public CsdlEntitySetPath setPath(final String path) { + this.path = path; + return this; + } +}
