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/CsdlEntityType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java new file mode 100644 index 0000000..fad6e7a --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEntityType.java @@ -0,0 +1,92 @@ +/* + * 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 CsdlEntityType extends CsdlStructuralType { + + private static final long serialVersionUID = -1564752618679704024L; + + private List<CsdlPropertyRef> key; + + private boolean hasStream = false; + + public boolean hasStream() { + return hasStream; + } + + public CsdlEntityType setHasStream(final boolean hasStream) { + this.hasStream = hasStream; + return this; + } + + public List<CsdlPropertyRef> getKey() { + return key; + } + + public CsdlEntityType setKey(final List<CsdlPropertyRef> key) { + this.key = key; + return this; + } + + @Override + public CsdlEntityType setName(final String name) { + this.name = name; + return this; + } + + @Override + public CsdlEntityType setOpenType(final boolean isOpenType) { + this.isOpenType = isOpenType; + return this; + } + + @Override + public CsdlEntityType setBaseType(final String baseType) { + this.baseType = new FullQualifiedName(baseType); + return this; + } + + @Override + public CsdlEntityType setBaseType(final FullQualifiedName baseType) { + this.baseType = baseType; + return this; + } + + @Override + public CsdlEntityType setAbstract(final boolean isAbstract) { + this.isAbstract = isAbstract; + return this; + } + + @Override + public CsdlEntityType setProperties(final List<CsdlProperty> properties) { + this.properties = properties; + return this; + } + + @Override + public CsdlEntityType 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/CsdlEnumMember.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.java new file mode 100644 index 0000000..8f11bf0 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumMember.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.provider; + +import java.util.ArrayList; +import java.util.List; + +public class CsdlEnumMember extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = 5618984420582832094L; + + private String name; + + private String value; + + private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public CsdlEnumMember setName(final String name) { + this.name = name; + return this; + } + + public String getValue() { + return value; + } + + public CsdlEnumMember setValue(final String value) { + this.value = value; + 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/CsdlEnumType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java new file mode 100644 index 0000000..314ac04 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlEnumType.java @@ -0,0 +1,113 @@ +/* + * 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 CsdlEnumType extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = -718032622783883403L; + + private String name; + + private boolean isFlags; + + private FullQualifiedName underlyingType; + + private List<CsdlEnumMember> members = new ArrayList<CsdlEnumMember>(); + + private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public CsdlEnumType setName(final String name) { + this.name = name; + return this; + } + + public boolean isFlags() { + return isFlags; + } + + public CsdlEnumType setFlags(final boolean isFlags) { + this.isFlags = isFlags; + return this; + } + + public String getUnderlyingType() { + if(underlyingType != null){ + return underlyingType.getFullQualifiedNameAsString(); + } + return null; + } + + public CsdlEnumType setUnderlyingType(final String underlyingType) { + this.underlyingType = new FullQualifiedName(underlyingType); + return this; + } + + public CsdlEnumType setUnderlyingType(final FullQualifiedName underlyingType) { + this.underlyingType = underlyingType; + return this; + } + + + public List<CsdlEnumMember> getMembers() { + return members; + } + + public CsdlEnumMember getMember(final String name) { + CsdlEnumMember result = null; + if (getMembers() != null) { + for (CsdlEnumMember member : getMembers()) { + if (name.equals(member.getName())) { + result = member; + } + } + } + return result; + } + + public CsdlEnumMember getMember(final Integer value) { + CsdlEnumMember result = null; + if (getMembers() != null) { + for (CsdlEnumMember member : getMembers()) { + if (String.valueOf(value).equals(member.getValue())) { + result = member; + } + } + } + return result; + } + + public CsdlEnumType setMembers(final List<CsdlEnumMember> members) { + this.members = members; + 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/CsdlExpression.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java new file mode 100644 index 0000000..cb3f765 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlExpression.java @@ -0,0 +1,23 @@ +/* + * 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 CsdlExpression { +//TODO: Expression implementation +} 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/CsdlFunction.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java new file mode 100644 index 0000000..38b32c7 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunction.java @@ -0,0 +1,67 @@ +/* + * 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 CsdlFunction extends CsdlOperation { + + private static final long serialVersionUID = 673858921468578957L; + + private boolean isComposable = false; + + public boolean isComposable() { + return isComposable; + } + + public CsdlFunction setComposable(final boolean isComposable) { + this.isComposable = isComposable; + return this; + } + + @Override + public CsdlFunction setName(final String name) { + this.name = name; + return this; + } + + @Override + public CsdlFunction setBound(final boolean isBound) { + this.isBound = isBound; + return this; + } + + @Override + public CsdlFunction setEntitySetPath(final String entitySetPath) { + this.entitySetPath = entitySetPath; + return this; + } + + @Override + public CsdlFunction setParameters(final List<CsdlParameter> parameters) { + this.parameters = parameters; + return this; + } + + @Override + public CsdlFunction 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/CsdlFunctionImport.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.java new file mode 100644 index 0000000..ed14759 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlFunctionImport.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 org.apache.olingo.commons.api.edm.FullQualifiedName; + + +public class CsdlFunctionImport extends CsdlOperationImport { + + private static final long serialVersionUID = 8479762299534736719L; + + private FullQualifiedName function; + + //Default include in service document is false for function imports + private boolean includeInServiceDocument; + + @Override + public String getName() { + return name; + } + + @Override + public CsdlFunctionImport setName(final String name) { + this.name = name; + return this; + } + + @Override + public CsdlFunctionImport setEntitySet(final String entitySet) { + this.entitySet = entitySet; + return this; + } + + public String getFunction() { + return function.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getFunctionFQN() { + return function; + } + + + public CsdlFunctionImport setFunction(final FullQualifiedName function) { + this.function = function; + return this; + } + + public CsdlFunctionImport setFunction(final String function) { + this.function = new FullQualifiedName(function); + return this; + } + + public boolean isIncludeInServiceDocument() { + return includeInServiceDocument; + } + + public CsdlFunctionImport 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/CsdlMapping.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java new file mode 100644 index 0000000..32bc782 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlMapping.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import org.apache.olingo.commons.api.edm.EdmMapping; + +/** + * Content of this class does not appear within the CSDL metadata document. This class is used to perform server + * internal mapping for edm primitive types to java types. + */ +public class CsdlMapping implements EdmMapping { + + private Class<?> mappedJavaClass; + + /** + * Sets the class to be used during deserialization to transform an EDM primitive type into this java class. To see + * which classes work for which primitive type refer to {@link org.apache.olingo.commons.api.edm.EdmPrimitiveType}. + * @param mappedJavaClass class to which is mapped + * @return this for method chaining + */ + public CsdlMapping setMappedJavaClass(Class<?> mappedJavaClass) { + this.mappedJavaClass = mappedJavaClass; + return this; + } + + /* (non-Javadoc) + * @see org.apache.olingo.commons.api.edm.EdmMapping#getMappedJavaClass() + */ + @Override + public Class<?> getMappedJavaClass() { + return mappedJavaClass; + } + +} 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/CsdlNamed.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNamed.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNamed.java new file mode 100644 index 0000000..24a5803 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNamed.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.io.Serializable; + +public interface CsdlNamed extends Serializable { + + String getName(); +} 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/CsdlNavigationProperty.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java new file mode 100644 index 0000000..16fc68e --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationProperty.java @@ -0,0 +1,138 @@ +/* + * 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 CsdlNavigationProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = -788021920718310799L; + + private String name; + + private FullQualifiedName type; + + private boolean isCollection; + + private String partner; + + private boolean containsTarget = false; + + private List<CsdlReferentialConstraint> referentialConstraints = new ArrayList<CsdlReferentialConstraint>(); + + // Facets + private boolean nullable = true; + + private CsdlOnDelete onDelete; + + private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public boolean isCollection() { + return isCollection; + } + + public CsdlNavigationProperty setCollection(final boolean isCollection) { + this.isCollection = isCollection; + return this; + } + + public CsdlNavigationProperty setName(final String name) { + this.name = name; + return this; + } + + public FullQualifiedName getTypeFQN() { + return type; + } + + public String getType() { + if(type != null){ + return type.getFullQualifiedNameAsString(); + } + return null; + } + + public CsdlNavigationProperty setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + public CsdlNavigationProperty setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + public String getPartner() { + return partner; + } + + public CsdlNavigationProperty setPartner(final String partner) { + this.partner = partner; + return this; + } + + public boolean isContainsTarget() { + return containsTarget; + } + + public CsdlNavigationProperty setContainsTarget(final boolean containsTarget) { + this.containsTarget = containsTarget; + return this; + } + + public List<CsdlReferentialConstraint> getReferentialConstraints() { + return referentialConstraints; + } + + public CsdlNavigationProperty setReferentialConstraints( + final List<CsdlReferentialConstraint> referentialConstraints) { + this.referentialConstraints = referentialConstraints; + return this; + } + + public Boolean isNullable() { + return nullable; + } + + public CsdlNavigationProperty setNullable(final Boolean nullable) { + this.nullable = nullable; + return this; + } + + public CsdlOnDelete getOnDelete() { + return onDelete; + } + + public CsdlNavigationProperty setOnDelete(final CsdlOnDelete onDelete) { + this.onDelete = onDelete; + 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/CsdlNavigationPropertyBinding.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.java new file mode 100644 index 0000000..ce14ead --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlNavigationPropertyBinding.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; + + +public class CsdlNavigationPropertyBinding extends CsdlAbstractEdmItem { + + private static final long serialVersionUID = 770380971233808502L; + + private String path; + + private String target; + + public String getPath() { + return path; + } + + public CsdlNavigationPropertyBinding setPath(final String path) { + this.path = path; + return this; + } + + public String getTarget() { + return target; + } + + public CsdlNavigationPropertyBinding setTarget(final String target) { + this.target = target; + 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/CsdlOnDelete.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java new file mode 100644 index 0000000..1b03ba8 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDelete.java @@ -0,0 +1,38 @@ +/* + * 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 CsdlOnDelete extends CsdlAbstractEdmItem { + + private static final long serialVersionUID = -7130889202653716784L; + + private CsdlOnDeleteAction action = CsdlOnDeleteAction.None; + + public CsdlOnDeleteAction getAction() { + return action; + } + + public CsdlOnDelete setAction(final CsdlOnDeleteAction 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/CsdlOnDeleteAction.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDeleteAction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDeleteAction.java new file mode 100644 index 0000000..822f0ce --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOnDeleteAction.java @@ -0,0 +1,28 @@ +/* + * 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 enum CsdlOnDeleteAction { + + Cascade, + None, + SetNull, + SetDefault + +} 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/CsdlOperation.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java new file mode 100644 index 0000000..e7cd6af --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperation.java @@ -0,0 +1,92 @@ +/* + * 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 abstract class CsdlOperation extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = -3842411084067064086L; + + protected String name; + + protected boolean isBound = false; + + protected String entitySetPath; + + protected List<CsdlParameter> parameters = new ArrayList<CsdlParameter>(); + + protected CsdlReturnType returnType; + + protected final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public CsdlOperation setName(final String name) { + this.name = name; + return this; + } + + public boolean isBound() { + return isBound; + } + + public CsdlOperation setBound(final boolean isBound) { + this.isBound = isBound; + return this; + } + + public String getEntitySetPath() { + return entitySetPath; + } + + public CsdlOperation setEntitySetPath(final String entitySetPath) { + this.entitySetPath = entitySetPath; + return this; + } + + public List<CsdlParameter> getParameters() { + return parameters; + } + + public CsdlParameter getParameter(String name) { + return getOneByName(name, getParameters()); + } + + public CsdlOperation setParameters(final List<CsdlParameter> parameters) { + this.parameters = parameters; + return this; + } + + public CsdlReturnType getReturnType() { + return returnType; + } + + public CsdlOperation setReturnType(final CsdlReturnType returnType) { + this.returnType = returnType; + return this; + } + + 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/CsdlOperationImport.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java new file mode 100644 index 0000000..af21471 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlOperationImport.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; + +public abstract class CsdlOperationImport extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = -8928186067970681061L; + + protected String name; + protected String entitySet; + protected final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public CsdlOperationImport setName(final String name) { + this.name = name; + return this; + } + + public String getEntitySet() { + return entitySet; + } + + public CsdlOperationImport setEntitySet(final String entitySet) { + this.entitySet = entitySet; + 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/CsdlParameter.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java new file mode 100644 index 0000000..15c2c3a --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlParameter.java @@ -0,0 +1,146 @@ +/* + * 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; +import org.apache.olingo.commons.api.edm.geo.SRID; + +public class CsdlParameter extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = -7360900923880732015L; + + private String name; + + private FullQualifiedName type; + + private boolean isCollection; + + private CsdlMapping mapping; + + // Facets + private boolean nullable = true; + + private Integer maxLength; + + private Integer precision; + + private Integer scale; + + private SRID srid; + + private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public CsdlParameter setName(final String name) { + this.name = name; + return this; + } + + public String getType() { + return type.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getTypeFQN() { + return type; + } + + public CsdlParameter setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + public CsdlParameter setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + public boolean isCollection() { + return isCollection; + } + + public CsdlParameter setCollection(final boolean isCollection) { + this.isCollection = isCollection; + return this; + } + + public boolean isNullable() { + return nullable; + } + + public CsdlParameter setNullable(final boolean nullable) { + this.nullable = nullable; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public CsdlParameter setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public CsdlParameter setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public CsdlParameter setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public SRID getSrid() { + return srid; + } + + public CsdlParameter setSrid(final SRID srid) { + this.srid = srid; + return this; + } + + @Override + public List<CsdlAnnotation> getAnnotations() { + return annotations; + } + + public CsdlMapping getMapping() { + return mapping; + } + + public CsdlParameter setMapping(final CsdlMapping mapping) { + this.mapping = mapping; + 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/CsdlProperty.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java new file mode 100644 index 0000000..42f7b65 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlProperty.java @@ -0,0 +1,180 @@ +/* + * 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; +import org.apache.olingo.commons.api.edm.geo.SRID; + +public class CsdlProperty extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = -4224390853690843450L; + + private String name; + + private String type; + + private boolean collection; + + private String mimeType; + + private CsdlMapping mapping; + + // Facets + private String defaultValue; + + private boolean nullable = true; + + private Integer maxLength; + + private Integer precision; + + private Integer scale; + + private boolean unicode = true; + + private SRID srid; + + private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + + public String getName() { + return name; + } + + public CsdlProperty setName(final String name) { + this.name = name; + return this; + } + + public String getType() { + return type; + } + + public CsdlProperty setType(final String type) { + this.type = type; + return this; + } + + public FullQualifiedName getTypeAsFQNObject(){ + return new FullQualifiedName(type); + } + + public CsdlProperty setType(FullQualifiedName fqnName){ + this.type = fqnName.getFullQualifiedNameAsString(); + return this; + } + + public boolean isCollection() { + return collection; + } + + public CsdlProperty setCollection(final boolean isCollection) { + collection = isCollection; + return this; + } + + public String getDefaultValue() { + return defaultValue; + } + + public CsdlProperty setDefaultValue(final String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public boolean isNullable() { + return nullable; + } + + public CsdlProperty setNullable(final boolean nullable) { + this.nullable = nullable; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public CsdlProperty setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public CsdlProperty setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public CsdlProperty setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public boolean isUnicode() { + return unicode; + } + + public CsdlProperty setUnicode(final boolean unicode) { + this.unicode = unicode; + return this; + } + + public String getMimeType() { + return mimeType; + } + + public CsdlProperty setMimeType(final String mimeType) { + this.mimeType = mimeType; + return this; + } + + public CsdlMapping getMapping() { + return mapping; + } + + public CsdlProperty setMapping(final CsdlMapping mapping) { + this.mapping = mapping; + return this; + } + + @Override + public List<CsdlAnnotation> getAnnotations() { + return annotations; + } + + public CsdlProperty setSrid(final SRID srid) { + this.srid = srid; + return this; + } + + public SRID getSrid() { + return srid; + } +} 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/CsdlPropertyRef.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java new file mode 100644 index 0000000..a57ce4e --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlPropertyRef.java @@ -0,0 +1,46 @@ +/* + * 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 CsdlPropertyRef extends CsdlAbstractEdmItem implements CsdlNamed { + + private static final long serialVersionUID = 9082892362895660037L; + + private String name; + + private String alias; + + public String getName() { + return name; + } + + public CsdlPropertyRef setName(final String name) { + this.name = name; + return this; + } + + public String getAlias() { + return alias; + } + + public CsdlPropertyRef 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/CsdlReferentialConstraint.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.java new file mode 100644 index 0000000..7c06724 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReferentialConstraint.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.ArrayList; +import java.util.List; + +public class CsdlReferentialConstraint extends CsdlAbstractEdmItem implements CsdlAnnotatable { + + private static final long serialVersionUID = -7467707499798840075L; + + private String property; + + private String referencedProperty; + + private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getProperty() { + return property; + } + + public CsdlReferentialConstraint setProperty(final String property) { + this.property = property; + return this; + } + + public String getReferencedProperty() { + return referencedProperty; + } + + public CsdlReferentialConstraint setReferencedProperty(final String referencedProperty) { + this.referencedProperty = referencedProperty; + 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/CsdlReturnType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java new file mode 100644 index 0000000..f0d5e9e --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlReturnType.java @@ -0,0 +1,114 @@ +/* + * 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; +import org.apache.olingo.commons.api.edm.geo.SRID; + +public class CsdlReturnType extends CsdlAbstractEdmItem { + + private static final long serialVersionUID = 4816954124986010965L; + + private FullQualifiedName type; + + private boolean isCollection; + + // facets + private boolean nullable = true; + + private Integer maxLength; + + private Integer precision; + + private Integer scale; + + private SRID srid; + + public String getType() { + return type.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getTypeFQN() { + return type; + } + + public CsdlReturnType setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + public CsdlReturnType setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + public boolean isCollection() { + return isCollection; + } + + public CsdlReturnType setCollection(final boolean isCollection) { + this.isCollection = isCollection; + return this; + } + + public boolean isNullable() { + return nullable; + } + + public CsdlReturnType setNullable(final boolean nullable) { + this.nullable = nullable; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public CsdlReturnType setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public CsdlReturnType setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public CsdlReturnType setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public SRID getSrid() { + return srid; + } + + public CsdlReturnType setSrid(final SRID srid) { + this.srid = srid; + 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/CsdlSchema.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java new file mode 100644 index 0000000..8300eaa --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSchema.java @@ -0,0 +1,265 @@ +/* + * 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.HashMap; +import java.util.List; +import java.util.Map; + +public class CsdlSchema extends CsdlAbstractEdmItem implements CsdlAnnotatable { + + private static final long serialVersionUID = -1527213201328056750L; + + private String namespace; + + private String alias; + + private List<CsdlEnumType> enumTypes = new ArrayList<CsdlEnumType>(); + + private List<CsdlTypeDefinition> typeDefinitions = new ArrayList<CsdlTypeDefinition>(); + + private List<CsdlEntityType> entityTypes = new ArrayList<CsdlEntityType>(); + + private List<CsdlComplexType> complexTypes = new ArrayList<CsdlComplexType>(); + + private List<CsdlAction> actions = new ArrayList<CsdlAction>(); + + private List<CsdlFunction> functions = new ArrayList<CsdlFunction>(); + + private CsdlEntityContainer entityContainer; + + private List<CsdlTerm> terms = new ArrayList<CsdlTerm>(); + + private final List<CsdlAnnotations> annotationGroups = new ArrayList<CsdlAnnotations>(); + + private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + private Map<String, CsdlAnnotatable> annotatables; + + + public String getNamespace() { + return namespace; + } + + public CsdlSchema setNamespace(final String namespace) { + this.namespace = namespace; + return this; + } + + public String getAlias() { + return alias; + } + + public CsdlSchema setAlias(final String alias) { + this.alias = alias; + return this; + } + + public List<CsdlEnumType> getEnumTypes() { + return enumTypes; + } + + public CsdlEnumType getEnumType(final String name) { + return getOneByName(name, getEnumTypes()); + } + + public CsdlSchema setEnumTypes(final List<CsdlEnumType> enumTypes) { + this.enumTypes = enumTypes; + return this; + } + + public List<CsdlTypeDefinition> getTypeDefinitions() { + return typeDefinitions; + } + + public CsdlTypeDefinition getTypeDefinition(final String name) { + return getOneByName(name, getTypeDefinitions()); + } + + public CsdlSchema setTypeDefinitions(final List<CsdlTypeDefinition> typeDefinitions) { + this.typeDefinitions = typeDefinitions; + return this; + } + + public List<CsdlEntityType> getEntityTypes() { + return entityTypes; + } + + public CsdlEntityType getEntityType(final String name) { + return getOneByName(name, getEntityTypes()); + } + + public CsdlSchema setEntityTypes(final List<CsdlEntityType> entityTypes) { + this.entityTypes = entityTypes; + return this; + } + + public List<CsdlComplexType> getComplexTypes() { + return complexTypes; + } + + public CsdlComplexType getComplexType(final String name) { + return getOneByName(name, getComplexTypes()); + } + + public CsdlSchema setComplexTypes(final List<CsdlComplexType> complexTypes) { + this.complexTypes = complexTypes; + return this; + } + + public List<CsdlAction> getActions() { + return actions; + } + + /** + * All actions with the given name + * @param name + * @return a list of actions + */ + public List<CsdlAction> getActions(final String name) { + return getAllByName(name, getActions()); + } + + public CsdlSchema setActions(final List<CsdlAction> actions) { + this.actions = actions; + return this; + } + + public List<CsdlFunction> getFunctions() { + return functions; + } + + /** + * All functions with the given name + * @param name + * @return a list of functions + */ + public List<CsdlFunction> getFunctions(final String name) { + return getAllByName(name, getFunctions()); + } + + public CsdlSchema setFunctions(final List<CsdlFunction> functions) { + this.functions = functions; + return this; + } + + public CsdlEntityContainer getEntityContainer() { + return entityContainer; + } + + public CsdlSchema setEntityContainer(final CsdlEntityContainer entityContainer) { + this.entityContainer = entityContainer; + return this; + } + + public List<CsdlTerm> getTerms() { + return terms; + } + + public CsdlTerm getTerm(final String name) { + return getOneByName(name, getTerms()); + } + + + public CsdlSchema setTerms(final List<CsdlTerm> terms) { + this.terms = terms; + return this; + } + + public List<CsdlAnnotations> getAnnotationGroups() { + return annotationGroups; + } + + public CsdlAnnotations getAnnotationGroup(final String target) { + CsdlAnnotations result = null; + for (CsdlAnnotations annots : getAnnotationGroups()) { + if (target.equals(annots.getTarget())) { + result = annots; + } + } + return result; + } + + public CsdlAnnotation getAnnotation(final String term) { + CsdlAnnotation result = null; + for (CsdlAnnotation annot : getAnnotations()) { + if (term.equals(annot.getTerm())) { + result = annot; + } + } + return result; + } + + public List<CsdlAnnotation> getAnnotations() { + return annotations; + } + + public Map<String, CsdlAnnotatable> getAnnotatables() { + if (annotatables == null) { + annotatables = new HashMap<String, CsdlAnnotatable>(); + for (CsdlAnnotations annotationGroup : getAnnotationGroups()) { + annotatables.put(null, annotationGroup); + } + for (CsdlAnnotation annotation : getAnnotations()) { + annotatables.put(annotation.getTerm(), annotation); + } + for (CsdlAction action : getActions()) { + annotatables.put(action.getName(), action); + } + for (CsdlComplexType complexType : getComplexTypes()) { + annotatables.put(complexType.getName(), complexType); + } + for (CsdlEntityType entityType : getEntityTypes()) { + annotatables.put(entityType.getName(), entityType); + } + for (CsdlEnumType enumType : getEnumTypes()) { + annotatables.put(enumType.getName(), enumType); + } + for (CsdlFunction function : getFunctions()) { + annotatables.put(function.getName(), function); + } + for (CsdlTerm term : getTerms()) { + annotatables.put(term.getName(), term); + } + for (CsdlTypeDefinition typedef : getTypeDefinitions()) { + annotatables.put(typedef.getName(), typedef); + } + if (entityContainer != null) { + annotatables.put(entityContainer.getName(), entityContainer); + for (CsdlAnnotation annotation : entityContainer.getAnnotations()) { + annotatables.put(annotation.getTerm(), annotation); + } + for (CsdlActionImport actionImport : entityContainer.getActionImports()) { + annotatables.put(actionImport.getName(), actionImport); + } + for (CsdlFunctionImport functionImport : entityContainer.getFunctionImports()) { + annotatables.put(functionImport.getName(), functionImport); + } + for (CsdlEntitySet entitySet : entityContainer.getEntitySets()) { + annotatables.put(entitySet.getName(), entitySet); + } + for (CsdlSingleton singleton : entityContainer.getSingletons()) { + annotatables.put(singleton.getName(), singleton); + } + } + } + return annotatables; + } +} 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/CsdlSingleton.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.java new file mode 100644 index 0000000..c5ca253 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlSingleton.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.provider; + +import java.util.List; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class CsdlSingleton extends CsdlBindingTarget { + + private static final long serialVersionUID = -3997943079062565895L; + + @Override + public CsdlSingleton setName(final String name) { + this.name = name; + return this; + } + + @Override + public CsdlSingleton setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + @Override + public CsdlSingleton setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + @Override + public CsdlSingleton setNavigationPropertyBindings( + final List<CsdlNavigationPropertyBinding> navigationPropertyBindings) { + this.navigationPropertyBindings = navigationPropertyBindings; + 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/CsdlStructuralType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java new file mode 100644 index 0000000..fdadf48 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlStructuralType.java @@ -0,0 +1,122 @@ +/* + * 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 CsdlStructuralType extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = 8662852373514258646L; + + protected String name; + + protected boolean isOpenType = false; + + protected FullQualifiedName baseType; + + protected boolean isAbstract; + + protected List<CsdlProperty> properties = new ArrayList<CsdlProperty>(); + + protected List<CsdlNavigationProperty> navigationProperties = new ArrayList<CsdlNavigationProperty>(); + + protected final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public CsdlStructuralType setName(final String name) { + this.name = name; + return this; + } + + public boolean isOpenType() { + return isOpenType; + } + + public CsdlStructuralType setOpenType(final boolean isOpenType) { + this.isOpenType = isOpenType; + return this; + } + + public String getBaseType() { + if (baseType != null) { + return baseType.getFullQualifiedNameAsString(); + } + return null; + } + + public FullQualifiedName getBaseTypeFQN() { + return baseType; + } + + public CsdlStructuralType setBaseType(final String baseType) { + this.baseType = new FullQualifiedName(baseType); + return this; + } + + public CsdlStructuralType setBaseType(final FullQualifiedName baseType) { + this.baseType = baseType; + return this; + } + + public boolean isAbstract() { + return isAbstract; + } + + public CsdlStructuralType setAbstract(final boolean isAbstract) { + this.isAbstract = isAbstract; + return this; + } + + public List<CsdlProperty> getProperties() { + return properties; + } + + public CsdlProperty getProperty(String name) { + return getOneByName(name, properties); + } + + public CsdlStructuralType setProperties(final List<CsdlProperty> properties) { + this.properties = properties; + return this; + } + + public List<CsdlNavigationProperty> getNavigationProperties() { + return navigationProperties; + } + + public CsdlNavigationProperty getNavigationProperty(String name) { + return getOneByName(name, navigationProperties); + } + + public CsdlStructuralType setNavigationProperties(final List<CsdlNavigationProperty> navigationProperties) { + this.navigationProperties = navigationProperties; + 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/CsdlTerm.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java new file mode 100644 index 0000000..ace5e36 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTerm.java @@ -0,0 +1,162 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.olingo.commons.api.edm.geo.SRID; + +public class CsdlTerm extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = 3843929000407818103L; + + private String name; + + private String type; + + private String baseTerm; + + private List<String> appliesTo = new ArrayList<String>(); + + private boolean isCollection; + + // Facets + private String defaultValue; + + private boolean nullable = true; + + private Integer maxLength; + + private Integer precision; + + private Integer scale; + + private SRID srid; + + private List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public CsdlTerm setName(final String name) { + this.name = name; + return this; + } + + public String getType() { + return type; + } + + public CsdlTerm setType(final String type) { + this.type = type; + return this; + } + + public String getBaseTerm() { + return baseTerm; + } + + public CsdlTerm setBaseTerm(final String baseTerm) { + this.baseTerm = baseTerm; + return this; + } + + public List<String> getAppliesTo() { + return appliesTo; + } + + public CsdlTerm setAppliesTo(final List<String> appliesTo) { + this.appliesTo = appliesTo; + return this; + } + + public boolean isCollection() { + return isCollection; + } + + public CsdlTerm setCollection(final boolean isCollection) { + this.isCollection = isCollection; + return this; + } + + public String getDefaultValue() { + return defaultValue; + } + + public CsdlTerm setDefaultValue(final String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public boolean isNullable() { + return nullable; + } + + public CsdlTerm setNullable(final boolean nullable) { + this.nullable = nullable; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public CsdlTerm setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public CsdlTerm setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public CsdlTerm setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public List<CsdlAnnotation> getAnnotations() { + return annotations; + } + + public CsdlTerm setAnnotations(final List<CsdlAnnotation> annotations) { + this.annotations = annotations; + return this; + } + + public SRID getSrid() { + return srid; + } + + public CsdlTerm setSrid(final SRID srid) { + this.srid = srid; + 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/CsdlTypeDefinition.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java new file mode 100644 index 0000000..705c040 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/CsdlTypeDefinition.java @@ -0,0 +1,123 @@ +/* + * 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; +import org.apache.olingo.commons.api.edm.geo.SRID; + +public class CsdlTypeDefinition extends CsdlAbstractEdmItem implements CsdlNamed, CsdlAnnotatable { + + private static final long serialVersionUID = 3718980071229613048L; + + private String name; + + private FullQualifiedName underlyingType; + + // Facets + private Integer maxLength; + + private Integer precision; + + private Integer scale; + + private boolean unicode = true; + + private SRID srid; + + private final List<CsdlAnnotation> annotations = new ArrayList<CsdlAnnotation>(); + + public String getName() { + return name; + } + + public CsdlTypeDefinition setName(final String name) { + this.name = name; + return this; + } + + public String getUnderlyingType() { + if(underlyingType != null){ + return underlyingType.getFullQualifiedNameAsString(); + } + return null; + } + + public CsdlTypeDefinition setUnderlyingType(final String underlyingType) { + this.underlyingType = new FullQualifiedName(underlyingType); + return this; + } + + public CsdlTypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) { + this.underlyingType = underlyingType; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public CsdlTypeDefinition setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public CsdlTypeDefinition setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public CsdlTypeDefinition setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public boolean isUnicode() { + return unicode; + } + + public CsdlTypeDefinition setUnicode(final boolean unicode) { + this.unicode = unicode; + return this; + } + + public SRID getSrid() { + return srid; + } + + public CsdlTypeDefinition setSrid(final SRID srid) { + this.srid = srid; + 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/EdmProvider.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java deleted file mode 100644 index f3511d7..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EdmProvider.java +++ /dev/null @@ -1,177 +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 interface EdmProvider { - - /** - * This method should return an {@link EnumType} or <b>null</b> if nothing is found - * - * @param enumTypeName - * @return {@link EnumType} for given name - * @throws ODataException - */ - public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException; - - /** - * This method should return an {@link TypeDefinition} or <b>null</b> if nothing is found - * - * @param typeDefinitionName - * @return {@link TypeDefinition} for given name - * @throws ODataException - */ - public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException; - - /** - * This method should return an {@link EntityType} or <b>null</b> if nothing is found - * - * @param entityTypeName - * @return {@link EntityType} for the given name - * @throws ODataException - */ - public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException; - - /** - * This method should return a {@link ComplexType} or <b>null</b> if nothing is found. - * - * @param complexTypeName - * @return {@link ComplexType} for the given name - * @throws ODataException - */ - public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException; - - /** - * This method should return a list of all {@link Action} for the FullQualifiedname or <b>null</b> if nothing is found - * - * @param actionName - * @return List of {@link Action} or null - * @throws ODataException - */ - public List<Action> getActions(final FullQualifiedName actionName) throws ODataException; - - /** - * This method should return a list of all {@link Function} for the FullQualifiedname or <b>null</b> if nothing is - * found - * - * @param functionName - * @return List of {@link Function} or null - * @throws ODataException - */ - public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException; - - /** - * This method should return a {@link Term} for the FullQualifiedName or <b>null</b> if nothing is found. - * @param termName the name of the Term - * @return {@link Term} or null - * @throws ODataException - */ - public Term getTerm(final FullQualifiedName termName) throws ODataException; - - /** - * This method should return an {@link EntitySet} or <b>null</b> if nothing is found - * - * @param entityContainer this EntitySet is contained in - * @param entitySetName - * @return {@link EntitySet} for the given container and entityset name - * @throws ODataException - */ - public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName) - throws ODataException; - - /** - * This method should return an {@link Singleton} or <b>null</b> if nothing is found - * - * @param entityContainer this Singleton is contained in - * @param singletonName - * @return {@link Singleton} for given container and singleton name - * @throws ODataException - */ - public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName) - throws ODataException; - - /** - * This method should return an {@link ActionImport} or <b>null</b> if nothing is found - * - * @param entityContainer this ActionImport is contained in - * @param actionImportName - * @return {@link ActionImport} for the given container and ActionImport name - * @throws ODataException - */ - public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName) - throws ODataException; - - /** - * This method should return a {@link FunctionImport} or <b>null</b> if nothing is found - * - * @param entityContainer this FunctionImport is contained in - * @param functionImportName - * @return {@link FunctionImport} for the given container name and function import name - * @throws ODataException - */ - public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName) - throws ODataException; - - /** - * This method should return an {@link EntityContainerInfo} or <b>null</b> if nothing is found - * - * @param entityContainerName (null for default container) - * @return {@link EntityContainerInfo} for the given name - * @throws ODataException - */ - public EntityContainerInfo 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<AliasInfo> getAliasInfos() throws ODataException; - - /** - * This method should return a collection of all {@link Schema} - * - * @return List<{@link Schema}> - * @throws ODataException - */ - public List<Schema> getSchemas() throws ODataException; - - /** - * Returns the entity container of this edm - * @return {@link EntityContainer} of this edm - */ - public EntityContainer getEntityContainer() throws ODataException; - - /** - * @param targetName - * @return {@link Annotations} group for the given Target - */ - public Annotations getAnnotationsGroup(FullQualifiedName targetName) throws ODataException; - - /** - * @param annotatedName - * @return Annotatble element by target name - */ - public Annotatable 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/EntityContainer.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainer.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainer.java deleted file mode 100644 index 802da48..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EntityContainer.java +++ /dev/null @@ -1,159 +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 class EntityContainer extends AbstractEdmItem implements Named, Annotatable { - - private static final long serialVersionUID = 5384682515007129458L; - - private String name; - - private FullQualifiedName extendsContainer; - - private List<EntitySet> entitySets = new ArrayList<EntitySet>(); - - private List<ActionImport> actionImports = new ArrayList<ActionImport>(); - - private List<FunctionImport> functionImports = new ArrayList<FunctionImport>(); - - private List<Singleton> singletons = new ArrayList<Singleton>(); - - private final List<Annotation> annotations = new ArrayList<Annotation>(); - - // Annotations - public String getName() { - return name; - } - - public EntityContainer 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 EntityContainer setExtendsContainer(final String extendsContainer) { - this.extendsContainer = new FullQualifiedName(extendsContainer); - return this; - } - - public List<EntitySet> getEntitySets() { - return entitySets; - } - - public EntitySet getEntitySet(final String name) { - return getOneByName(name, getEntitySets()); - } - - public EntityContainer setEntitySets(final List<EntitySet> entitySets) { - this.entitySets = entitySets; - return this; - } - - public List<ActionImport> getActionImports() { - return actionImports; - } - - /** - * Gets the first action import with given name. - * - * @param name name. - * @return action import. - */ - public ActionImport getActionImport(final String name) { - return getOneByName(name, getActionImports()); - } - - /** - * Gets all action imports with given name. - * - * @param name name. - * @return action imports. - */ - public List<ActionImport> getActionImports(final String name) { - return getAllByName(name, getActionImports()); - } - - public EntityContainer setActionImports(final List<ActionImport> actionImports) { - this.actionImports = actionImports; - return this; - } - - public List<FunctionImport> getFunctionImports() { - return functionImports; - } - - /** - * Gets the first function import with given name. - * - * @param name name. - * @return function import. - */ - public FunctionImport getFunctionImport(final String name) { - return getOneByName(name, getFunctionImports()); - } - - /** - * Gets all function imports with given name. - * - * @param name name. - * @return function imports. - */ - public List<FunctionImport> getFunctionImports(final String name) { - return getAllByName(name, getFunctionImports()); - } - - public EntityContainer setFunctionImports(final List<FunctionImport> functionImports) { - this.functionImports = functionImports; - return this; - } - - public List<Singleton> getSingletons() { - return singletons; - } - - public Singleton getSingleton(final String name) { - return getOneByName(name, getSingletons()); - } - - public EntityContainer setSingletons(final List<Singleton> singletons) { - this.singletons = singletons; - return this; - } - - @Override - public List<Annotation> getAnnotations() { - return annotations; - } - -}
