http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.java new file mode 100644 index 0000000..c2c2c6d --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/EnumType.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 java.util.ArrayList; +import java.util.List; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class EnumType extends AbstractEdmItem implements Named, Annotatable { + + private static final long serialVersionUID = -718032622783883403L; + + private String name; + + private boolean isFlags; + + private FullQualifiedName underlyingType; + + private List<EnumMember> members = new ArrayList<EnumMember>(); + + private final List<Annotation> annotations = new ArrayList<Annotation>(); + + public String getName() { + return name; + } + + public EnumType setName(final String name) { + this.name = name; + return this; + } + + public boolean isFlags() { + return isFlags; + } + + public EnumType setFlags(final boolean isFlags) { + this.isFlags = isFlags; + return this; + } + + //TODO: Underlying type has a default + public String getUnderlyingType() { + if(underlyingType != null){ + return underlyingType.getFullQualifiedNameAsString(); + } + return null; + } + + public EnumType setUnderlyingType(final String underlyingType) { + this.underlyingType = new FullQualifiedName(underlyingType); + return this; + } + + public EnumType setUnderlyingType(final FullQualifiedName underlyingType) { + this.underlyingType = underlyingType; + return this; + } + + + public List<EnumMember> getMembers() { + return members; + } + + public EnumMember getMember(final String name) { + EnumMember result = null; + if (getMembers() != null) { + for (EnumMember member : getMembers()) { + if (name.equals(member.getName())) { + result = member; + } + } + } + return result; + } + + public EnumMember getMember(final Integer value) { + EnumMember result = null; + if (getMembers() != null) { + for (EnumMember member : getMembers()) { + if (String.valueOf(value).equals(member.getValue())) { + result = member; + } + } + } + return result; + } + + public EnumType setMembers(final List<EnumMember> members) { + this.members = members; + return this; + } + + @Override + public List<Annotation> getAnnotations() { + return annotations; + } +}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.java new file mode 100644 index 0000000..1784dad --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Expression.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 Expression { +//TODO: Expression implementation +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.java new file mode 100644 index 0000000..04f0521 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Function.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 Function extends Operation { + + private static final long serialVersionUID = 673858921468578957L; + + private boolean isComposable = false; + + public boolean isComposable() { + return isComposable; + } + + public Function setComposable(final boolean isComposable) { + this.isComposable = isComposable; + return this; + } + + @Override + public Function setName(final String name) { + this.name = name; + return this; + } + + @Override + public Function setBound(final boolean isBound) { + this.isBound = isBound; + return this; + } + + @Override + public Function setEntitySetPath(final String entitySetPath) { + this.entitySetPath = entitySetPath; + return this; + } + + @Override + public Function setParameters(final List<Parameter> parameters) { + this.parameters = parameters; + return this; + } + + @Override + public Function setReturnType(final ReturnType returnType) { + this.returnType = returnType; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java new file mode 100644 index 0000000..71223ae --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java @@ -0,0 +1,76 @@ +/* + * 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 FunctionImport extends OperationImport { + + private static final long serialVersionUID = 8479762299534736719L; + + private FullQualifiedName function; + + private boolean includeInServiceDocument; + + @Override + public String getName() { + return name; + } + + @Override + public FunctionImport setName(final String name) { + this.name = name; + return this; + } + + @Override + public FunctionImport setEntitySet(final String entitySet) { + this.entitySet = entitySet; + return this; + } + + public String getFunction() { + return function.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getFunctionFQN() { + return function; + } + + + public FunctionImport setFunction(final FullQualifiedName function) { + this.function = function; + return this; + } + + public FunctionImport setFunction(final String function) { + this.function = new FullQualifiedName(function); + return this; + } + + public boolean isIncludeInServiceDocument() { + return includeInServiceDocument; + } + + public FunctionImport setIncludeInServiceDocument(final boolean includeInServiceDocument) { + this.includeInServiceDocument = includeInServiceDocument; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.java new file mode 100644 index 0000000..472a28e --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Mapping.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 Mapping 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 Mapping 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/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.java new file mode 100644 index 0000000..6b716a6 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Named.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 Named extends Serializable { + + String getName(); +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java new file mode 100644 index 0000000..bfb74b0 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationProperty.java @@ -0,0 +1,137 @@ +/* + * 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 NavigationProperty extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -788021920718310799L; + + private String name; + + private FullQualifiedName type; + + private boolean isCollection; + + private String partner; + + private boolean containsTarget = false; + + private List<ReferentialConstraint> referentialConstraints = new ArrayList<ReferentialConstraint>(); + + // Facets + private boolean nullable = true; + + private OnDelete onDelete; + + private List<Annotation> annotations = new ArrayList<Annotation>(); + + public String getName() { + return name; + } + + public boolean isCollection() { + return isCollection; + } + + public NavigationProperty setCollection(final boolean isCollection) { + this.isCollection = isCollection; + return this; + } + + public NavigationProperty 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 NavigationProperty setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + public NavigationProperty setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + public String getPartner() { + return partner; + } + + public NavigationProperty setPartner(final String partner) { + this.partner = partner; + return this; + } + + public boolean isContainsTarget() { + return containsTarget; + } + + public NavigationProperty setContainsTarget(final boolean containsTarget) { + this.containsTarget = containsTarget; + return this; + } + + public List<ReferentialConstraint> getReferentialConstraints() { + return referentialConstraints; + } + + public NavigationProperty setReferentialConstraints(final List<ReferentialConstraint> referentialConstraints) { + this.referentialConstraints = referentialConstraints; + return this; + } + + public Boolean isNullable() { + return nullable; + } + + public NavigationProperty setNullable(final Boolean nullable) { + this.nullable = nullable; + return this; + } + + public OnDelete getOnDelete() { + return onDelete; + } + + public NavigationProperty setOnDelete(final OnDelete onDelete) { + this.onDelete = onDelete; + return this; + } + + @Override + public List<Annotation> getAnnotations() { + return annotations; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.java new file mode 100644 index 0000000..1ac7d6b --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/NavigationPropertyBinding.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 NavigationPropertyBinding extends AbstractEdmItem { + + private static final long serialVersionUID = 770380971233808502L; + + private String path; + + private String target; + + public String getPath() { + return path; + } + + public NavigationPropertyBinding setPath(final String path) { + this.path = path; + return this; + } + + public String getTarget() { + return target; + } + + public NavigationPropertyBinding setTarget(final String target) { + this.target = target; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.java new file mode 100644 index 0000000..e699dbb --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDelete.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 OnDelete extends AbstractEdmItem { + + private static final long serialVersionUID = -7130889202653716784L; + + private OnDeleteAction action = OnDeleteAction.None; + + public OnDeleteAction getAction() { + return action; + } + + public OnDelete setAction(final OnDeleteAction action) { + this.action = action; + return this; + } + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.java new file mode 100644 index 0000000..a5bf50b --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OnDeleteAction.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 OnDeleteAction { + + Cascade, + None, + SetNull, + SetDefault + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.java new file mode 100644 index 0000000..882087c --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Operation.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 Operation extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -3842411084067064086L; + + protected String name; + + protected boolean isBound = false; + + protected String entitySetPath; + + protected List<Parameter> parameters = new ArrayList<Parameter>(); + + protected ReturnType returnType; + + protected final List<Annotation> annotations = new ArrayList<Annotation>(); + + public String getName() { + return name; + } + + public Operation setName(final String name) { + this.name = name; + return this; + } + + public boolean isBound() { + return isBound; + } + + public Operation setBound(final boolean isBound) { + this.isBound = isBound; + return this; + } + + public String getEntitySetPath() { + return entitySetPath; + } + + public Operation setEntitySetPath(final String entitySetPath) { + this.entitySetPath = entitySetPath; + return this; + } + + public List<Parameter> getParameters() { + return parameters; + } + + public Parameter getParameter(String name) { + return getOneByName(name, getParameters()); + } + + public Operation setParameters(final List<Parameter> parameters) { + this.parameters = parameters; + return this; + } + + public ReturnType getReturnType() { + return returnType; + } + + public Operation setReturnType(final ReturnType returnType) { + this.returnType = returnType; + return this; + } + + public List<Annotation> getAnnotations() { + return annotations; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java new file mode 100644 index 0000000..8aa29db --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.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 abstract class OperationImport extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -8928186067970681061L; + + protected String name; + + protected String entitySet; + + protected final List<Annotation> annotations = new ArrayList<Annotation>(); + + public String getName() { + return name; + } + + public OperationImport setName(final String name) { + this.name = name; + return this; + } + + public String getEntitySet() { + return entitySet; + } + + public OperationImport setEntitySet(final String entitySet) { + this.entitySet = entitySet; + return this; + } + + @Override + public List<Annotation> getAnnotations() { + return annotations; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.java new file mode 100644 index 0000000..fb29da2 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Parameter.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 Parameter extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -7360900923880732015L; + + private String name; + + private FullQualifiedName type; + + private boolean isCollection; + + private Mapping mapping; + + // Facets + private boolean nullable = true; + + private Integer maxLength; + + private Integer precision; + + private Integer scale; + + private SRID srid; + + private final List<Annotation> annotations = new ArrayList<Annotation>(); + + public String getName() { + return name; + } + + public Parameter setName(final String name) { + this.name = name; + return this; + } + + public String getType() { + return type.getFullQualifiedNameAsString(); + } + + public FullQualifiedName getTypeFQN() { + return type; + } + + public Parameter setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + public Parameter setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + public boolean isCollection() { + return isCollection; + } + + public Parameter setCollection(final boolean isCollection) { + this.isCollection = isCollection; + return this; + } + + public boolean isNullable() { + return nullable; + } + + public Parameter setNullable(final boolean nullable) { + this.nullable = nullable; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public Parameter setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public Parameter setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public Parameter setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public SRID getSrid() { + return srid; + } + + public Parameter setSrid(final SRID srid) { + this.srid = srid; + return this; + } + + @Override + public List<Annotation> getAnnotations() { + return annotations; + } + + public Mapping getMapping() { + return mapping; + } + + public Parameter setMapping(final Mapping mapping) { + this.mapping = mapping; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java new file mode 100644 index 0000000..e556e67 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Property.java @@ -0,0 +1,181 @@ +/* + * 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 Property extends AbstractEdmItem implements Named, Annotatable{ + + private static final long serialVersionUID = -4224390853690843450L; + + private String name; + + private String type; + + private boolean collection; + + // TODO: Mimetype and mapping what here + private String mimeType; + + private Mapping 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<Annotation> annotations = new ArrayList<Annotation>(); + + + public String getName() { + return name; + } + + public Property setName(final String name) { + this.name = name; + return this; + } + + public String getType() { + return type; + } + + public Property setType(final String type) { + this.type = type; + return this; + } + + public FullQualifiedName getTypeAsFQNObject(){ + return new FullQualifiedName(type); + } + + public Property setType(FullQualifiedName fqnName){ + this.type = fqnName.getFullQualifiedNameAsString(); + return this; + } + + public boolean isCollection() { + return collection; + } + + public Property setCollection(final boolean isCollection) { + collection = isCollection; + return this; + } + + public String getDefaultValue() { + return defaultValue; + } + + public Property setDefaultValue(final String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public boolean isNullable() { + return nullable; + } + + public Property setNullable(final boolean nullable) { + this.nullable = nullable; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public Property setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public Property setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public Property setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public boolean isUnicode() { + return unicode; + } + + public Property setUnicode(final boolean unicode) { + this.unicode = unicode; + return this; + } + + public String getMimeType() { + return mimeType; + } + + public Property setMimeType(final String mimeType) { + this.mimeType = mimeType; + return this; + } + + public Mapping getMapping() { + return mapping; + } + + public Property setMapping(final Mapping mapping) { + this.mapping = mapping; + return this; + } + + @Override + public List<Annotation> getAnnotations() { + return annotations; + } + + public Property 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/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.java new file mode 100644 index 0000000..6588aaa --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/PropertyRef.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 PropertyRef extends AbstractEdmItem implements Named{ + + private static final long serialVersionUID = 9082892362895660037L; + + private String name; + + private String alias; + + public String getName() { + return name; + } + + public PropertyRef setName(final String name) { + this.name = name; + return this; + } + + public String getAlias() { + return alias; + } + + public PropertyRef setAlias(final String alias) { + this.alias = alias; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.java new file mode 100644 index 0000000..72c84c1 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReferentialConstraint.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 ReferentialConstraint extends AbstractEdmItem implements Annotatable { + + private static final long serialVersionUID = -7467707499798840075L; + + private String property; + + private String referencedProperty; + + private final List<Annotation> annotations = new ArrayList<Annotation>(); + + public String getProperty() { + return property; + } + + public ReferentialConstraint setProperty(final String property) { + this.property = property; + return this; + } + + public String getReferencedProperty() { + return referencedProperty; + } + + public ReferentialConstraint setReferencedProperty(final String referencedProperty) { + this.referencedProperty = referencedProperty; + return this; + } + + @Override + public List<Annotation> getAnnotations() { + return annotations; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.java new file mode 100644 index 0000000..1d58ae1 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/ReturnType.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 ReturnType extends AbstractEdmItem{ + + 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 ReturnType setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + public ReturnType setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + public boolean isCollection() { + return isCollection; + } + + public ReturnType setCollection(final boolean isCollection) { + this.isCollection = isCollection; + return this; + } + + public boolean isNullable() { + return nullable; + } + + public ReturnType setNullable(final boolean nullable) { + this.nullable = nullable; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public ReturnType setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public ReturnType setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public ReturnType setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public SRID getSrid() { + return srid; + } + + public ReturnType setSrid(final SRID srid) { + this.srid = srid; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.java new file mode 100644 index 0000000..183478f --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Schema.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 Schema extends AbstractEdmItem implements Annotatable{ + + private static final long serialVersionUID = -1527213201328056750L; + + private String namespace; + + private String alias; + + private List<EnumType> enumTypes = new ArrayList<EnumType>(); + + private List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>(); + + private List<EntityType> entityTypes = new ArrayList<EntityType>(); + + private List<ComplexType> complexTypes = new ArrayList<ComplexType>(); + + private List<Action> actions = new ArrayList<Action>(); + + private List<Function> functions = new ArrayList<Function>(); + + private EntityContainer entityContainer; + + private List<Term> terms = new ArrayList<Term>(); + + private final List<Annotations> annotationGroups = new ArrayList<Annotations>(); + + private final List<Annotation> annotations = new ArrayList<Annotation>(); + + private Map<String, Annotatable> annotatables; + + + public String getNamespace() { + return namespace; + } + + public Schema setNamespace(final String namespace) { + this.namespace = namespace; + return this; + } + + public String getAlias() { + return alias; + } + + public Schema setAlias(final String alias) { + this.alias = alias; + return this; + } + + public List<EnumType> getEnumTypes() { + return enumTypes; + } + + public EnumType getEnumType(final String name) { + return getOneByName(name, getEnumTypes()); + } + + public Schema setEnumTypes(final List<EnumType> enumTypes) { + this.enumTypes = enumTypes; + return this; + } + + public List<TypeDefinition> getTypeDefinitions() { + return typeDefinitions; + } + + public TypeDefinition getTypeDefinition(final String name) { + return getOneByName(name, getTypeDefinitions()); + } + + public Schema setTypeDefinitions(final List<TypeDefinition> typeDefinitions) { + this.typeDefinitions = typeDefinitions; + return this; + } + + public List<EntityType> getEntityTypes() { + return entityTypes; + } + + public EntityType getEntityType(final String name) { + return getOneByName(name, getEntityTypes()); + } + + public Schema setEntityTypes(final List<EntityType> entityTypes) { + this.entityTypes = entityTypes; + return this; + } + + public List<ComplexType> getComplexTypes() { + return complexTypes; + } + + public ComplexType getComplexType(final String name) { + return getOneByName(name, getComplexTypes()); + } + + public Schema setComplexTypes(final List<ComplexType> complexTypes) { + this.complexTypes = complexTypes; + return this; + } + + public List<Action> getActions() { + return actions; + } + + /** + * All actions with the given name + * @param name + * @return + */ + public List<Action> getActions(final String name) { + return getAllByName(name, getActions()); + } + + public Schema setActions(final List<Action> actions) { + this.actions = actions; + return this; + } + + public List<Function> getFunctions() { + return functions; + } + + /** + * All functions with the given name + * @param name + * @return + */ + public List<Function> getFunctions(final String name) { + return getAllByName(name, getFunctions()); + } + + public Schema setFunctions(final List<Function> functions) { + this.functions = functions; + return this; + } + + public EntityContainer getEntityContainer() { + return entityContainer; + } + + public Schema setEntityContainer(final EntityContainer entityContainer) { + this.entityContainer = entityContainer; + return this; + } + + public List<Term> getTerms() { + return terms; + } + + public Term getTerm(final String name) { + return getOneByName(name, getTerms()); + } + + + public Schema setTerms(final List<Term> terms) { + this.terms = terms; + return this; + } + + public List<Annotations> getAnnotationGroups() { + return annotationGroups; + } + + public Annotations getAnnotationGroup(final String target) { + Annotations result = null; + for (Annotations annots : getAnnotationGroups()) { + if (target.equals(annots.getTarget())) { + result = annots; + } + } + return result; + } + + public Annotation getAnnotation(final String term) { + Annotation result = null; + for (Annotation annot : getAnnotations()) { + if (term.equals(annot.getTerm())) { + result = annot; + } + } + return result; + } + + public List<Annotation> getAnnotations() { + return annotations; + } + + public Map<String, Annotatable> getAnnotatables() { + if (annotatables == null) { + annotatables = new HashMap<String, Annotatable>(); + for (Annotations annotationGroup : getAnnotationGroups()) { + annotatables.put(null, annotationGroup); + } + for (Annotation annotation : getAnnotations()) { + annotatables.put(annotation.getTerm(), annotation); + } + for (Action action : getActions()) { + annotatables.put(action.getName(), action); + } + for (ComplexType complexType : getComplexTypes()) { + annotatables.put(complexType.getName(), complexType); + } + for (EntityType entityType : getEntityTypes()) { + annotatables.put(entityType.getName(), entityType); + } + for (EnumType enumType : getEnumTypes()) { + annotatables.put(enumType.getName(), enumType); + } + for (Function function : getFunctions()) { + annotatables.put(function.getName(), function); + } + for (Term term : getTerms()) { + annotatables.put(term.getName(), term); + } + for (TypeDefinition typedef : getTypeDefinitions()) { + annotatables.put(typedef.getName(), typedef); + } + if (entityContainer != null) { + annotatables.put(entityContainer.getName(), entityContainer); + for (Annotation annotation : entityContainer.getAnnotations()) { + annotatables.put(annotation.getTerm(), annotation); + } + for (ActionImport actionImport : entityContainer.getActionImports()) { + annotatables.put(actionImport.getName(), actionImport); + } + for (FunctionImport functionImport : entityContainer.getFunctionImports()) { + annotatables.put(functionImport.getName(), functionImport); + } + for (EntitySet entitySet : entityContainer.getEntitySets()) { + annotatables.put(entitySet.getName(), entitySet); + } + for (Singleton singleton : entityContainer.getSingletons()) { + annotatables.put(singleton.getName(), singleton); + } + } + } + return annotatables; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java new file mode 100644 index 0000000..e2e14f4 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Singleton.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider; + +import java.util.List; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +public class Singleton extends BindingTarget { + + private static final long serialVersionUID = -3997943079062565895L; + + @Override + public Singleton setName(final String name) { + this.name = name; + return this; + } + + @Override + public Singleton setType(final String type) { + this.type = new FullQualifiedName(type); + return this; + } + + @Override + public Singleton setType(final FullQualifiedName type) { + this.type = type; + return this; + } + + @Override + public Singleton setNavigationPropertyBindings(final List<NavigationPropertyBinding> navigationPropertyBindings) { + this.navigationPropertyBindings = navigationPropertyBindings; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.java new file mode 100644 index 0000000..61d70c7 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/StructuralType.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 StructuralType extends AbstractEdmItem implements Named, Annotatable { + + private static final long serialVersionUID = 8662852373514258646L; + + protected String name; + + protected boolean isOpenType = false; + + protected FullQualifiedName baseType; + + protected boolean isAbstract; + + protected List<Property> properties = new ArrayList<Property>(); + + protected List<NavigationProperty> navigationProperties = new ArrayList<NavigationProperty>(); + + protected final List<Annotation> annotations = new ArrayList<Annotation>(); + + public String getName() { + return name; + } + + public StructuralType setName(final String name) { + this.name = name; + return this; + } + + public boolean isOpenType() { + return isOpenType; + } + + public StructuralType 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 StructuralType setBaseType(final String baseType) { + this.baseType = new FullQualifiedName(baseType); + return this; + } + + public StructuralType setBaseType(final FullQualifiedName baseType) { + this.baseType = baseType; + return this; + } + + public boolean isAbstract() { + return isAbstract; + } + + public StructuralType setAbstract(final boolean isAbstract) { + this.isAbstract = isAbstract; + return this; + } + + public List<Property> getProperties() { + return properties; + } + + public Property getProperty(String name) { + return getOneByName(name, properties); + } + + public StructuralType setProperties(final List<Property> properties) { + this.properties = properties; + return this; + } + + public List<NavigationProperty> getNavigationProperties() { + return navigationProperties; + } + + public NavigationProperty getNavigationProperty(String name) { + return getOneByName(name, navigationProperties); + } + + public StructuralType setNavigationProperties(final List<NavigationProperty> navigationProperties) { + this.navigationProperties = navigationProperties; + return this; + } + + @Override + public List<Annotation> getAnnotations() { + return annotations; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.java new file mode 100644 index 0000000..45b9afe --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/Term.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 Term extends AbstractEdmItem implements Named, Annotatable{ + + 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<Annotation> annotations = new ArrayList<Annotation>(); + + public String getName() { + return name; + } + + public Term setName(final String name) { + this.name = name; + return this; + } + + public String getType() { + return type; + } + + public Term setType(final String type) { + this.type = type; + return this; + } + + public String getBaseTerm() { + return baseTerm; + } + + public Term setBaseTerm(final String baseTerm) { + this.baseTerm = baseTerm; + return this; + } + + public List<String> getAppliesTo() { + return appliesTo; + } + + public Term setAppliesTo(final List<String> appliesTo) { + this.appliesTo = appliesTo; + return this; + } + + public boolean isCollection() { + return isCollection; + } + + public Term setCollection(final boolean isCollection) { + this.isCollection = isCollection; + return this; + } + + public String getDefaultValue() { + return defaultValue; + } + + public Term setDefaultValue(final String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public boolean isNullable() { + return nullable; + } + + public Term setNullable(final boolean nullable) { + this.nullable = nullable; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public Term setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public Term setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public Term setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public List<Annotation> getAnnotations() { + return annotations; + } + + public Term setAnnotations(final List<Annotation> annotations) { + this.annotations = annotations; + return this; + } + + public SRID getSrid() { + return srid; + } + + public Term setSrid(final SRID srid) { + this.srid = srid; + return this; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java new file mode 100644 index 0000000..7ef8b36 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/TypeDefinition.java @@ -0,0 +1,120 @@ +/* + * 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 TypeDefinition extends AbstractEdmItem implements Named, Annotatable { + + 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<Annotation> annotations = new ArrayList<Annotation>(); + + public String getName() { + return name; + } + + public TypeDefinition setName(final String name) { + this.name = name; + return this; + } + + public String getUnderlyingType() { + return underlyingType.getFullQualifiedNameAsString(); + } + + public TypeDefinition setUnderlyingType(final String underlyingType) { + this.underlyingType = new FullQualifiedName(underlyingType); + return this; + } + + public TypeDefinition setUnderlyingType(final FullQualifiedName underlyingType) { + this.underlyingType = underlyingType; + return this; + } + + public Integer getMaxLength() { + return maxLength; + } + + public TypeDefinition setMaxLength(final Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + public Integer getPrecision() { + return precision; + } + + public TypeDefinition setPrecision(final Integer precision) { + this.precision = precision; + return this; + } + + public Integer getScale() { + return scale; + } + + public TypeDefinition setScale(final Integer scale) { + this.scale = scale; + return this; + } + + public boolean isUnicode() { + return unicode; + } + + public TypeDefinition setUnicode(final boolean unicode) { + this.unicode = unicode; + return this; + } + + public SRID getSrid() { + return srid; + } + + public TypeDefinition setSrid(final SRID srid) { + this.srid = srid; + return this; + } + + @Override + public List<Annotation> getAnnotations() { + return annotations; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java new file mode 100644 index 0000000..0a8796c --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationExpression.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider.annotation; + +public interface AnnotationExpression { + + boolean isConstant(); + + ConstantAnnotationExpression asConstant(); + + boolean isDynamic(); + + DynamicAnnotationExpression asDynamic(); +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java new file mode 100644 index 0000000..c000b88 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/AnnotationPath.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider.annotation; + +public interface AnnotationPath extends DynamicAnnotationExpression { + + String getValue(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java new file mode 100644 index 0000000..0cea344 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Apply.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider.annotation; + +import java.util.List; + +import org.apache.olingo.commons.api.edm.provider.Annotatable; + +public interface Apply extends DynamicAnnotationExpression, Annotatable { + + String getFunction(); + + List<AnnotationExpression> getParameters(); +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.java new file mode 100644 index 0000000..a091fe0 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Cast.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.annotation; + +import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Annotatable; + +public interface Cast extends DynamicAnnotationExpression, Annotatable { + + Integer getMaxLength(); + + Integer getPrecision(); + + Integer getScale(); + + SRID getSrid(); + + String getType(); + + DynamicAnnotationExpression getValue(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java new file mode 100644 index 0000000..6c7862a --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/Collection.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider.annotation; + +import java.util.List; + +public interface Collection extends DynamicAnnotationExpression { + + List<AnnotationExpression> getItems(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.java new file mode 100644 index 0000000..72889e5 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/ConstantAnnotationExpression.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.annotation; + +public interface ConstantAnnotationExpression extends AnnotationExpression { + + public enum Type { + + Binary, + Bool, + Date, + DateTimeOffset, + Decimal, + Duration, + EnumMember, + Float, + Guid, + Int, + String, + TimeOfDay; + + public static Type fromString(final String value) { + Type result = null; + try { + result = valueOf(value); + } catch (IllegalArgumentException e) { + // ignore + } + return result; + } + } + + Type getType(); + + void setType(Type type); + + String getValue(); + + void setValue(String value); +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java new file mode 100644 index 0000000..83ff1cd --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/DynamicAnnotationExpression.java @@ -0,0 +1,91 @@ +/* + * 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.annotation; + +public interface DynamicAnnotationExpression extends AnnotationExpression { + + boolean isNot(); + + Not asNot(); + + boolean isTwoParamsOp(); + + TwoParamsOpDynamicAnnotationExpression asTwoParamsOp(); + + boolean isAnnotationPath(); + + AnnotationPath asAnnotationPath(); + + boolean isApply(); + + Apply asApply(); + + boolean isCast(); + + Cast asCast(); + + boolean isCollection(); + + Collection asCollection(); + + boolean isIf(); + + If asIf(); + + boolean isIsOf(); + + IsOf asIsOf(); + + boolean isLabeledElement(); + + LabeledElement asLabeledElement(); + + boolean isLabeledElementReference(); + + LabeledElementReference asLabeledElementReference(); + + boolean isNull(); + + Null asNull(); + + boolean isNavigationPropertyPath(); + + NavigationPropertyPath asNavigationPropertyPath(); + + boolean isPath(); + + Path asPath(); + + boolean isPropertyPath(); + + PropertyPath asPropertyPath(); + + boolean isPropertyValue(); + + PropertyValue asPropertyValue(); + + boolean isRecord(); + + Record asRecord(); + + boolean isUrlRef(); + + UrlRef asUrlRef(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java new file mode 100644 index 0000000..86661c2 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/If.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider.annotation; + +import org.apache.olingo.commons.api.edm.provider.Annotatable; + +public interface If extends DynamicAnnotationExpression, Annotatable { + + AnnotationExpression getGuard(); + + AnnotationExpression getThen(); + + AnnotationExpression getElse(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.java new file mode 100644 index 0000000..6bbc6b5 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/IsOf.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.annotation; + +import org.apache.olingo.commons.api.edm.geo.SRID; +import org.apache.olingo.commons.api.edm.provider.Annotatable; + +public interface IsOf extends DynamicAnnotationExpression, Annotatable { + + Integer getMaxLength(); + + Integer getPrecision(); + + Integer getScale(); + + SRID getSrid(); + + String getType(); + + DynamicAnnotationExpression getValue(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java new file mode 100644 index 0000000..2f1aace --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElement.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider.annotation; + +import org.apache.olingo.commons.api.edm.provider.Annotatable; + +public interface LabeledElement extends DynamicAnnotationExpression, Annotatable { + + String getName(); + + DynamicAnnotationExpression getValue(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a58a678/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java new file mode 100644 index 0000000..1772921 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/LabeledElementReference.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.olingo.commons.api.edm.provider.annotation; + +public interface LabeledElementReference extends DynamicAnnotationExpression { + + String getValue(); + +}
